Click here to Skip to main content
15,867,308 members
Articles / Programming Languages / C#

Audio Mixer - Console Simulator

Rate me:
Please Sign up or sign in to vote.
3.39/5 (43 votes)
22 Mar 2010CPOL4 min read 128.4K   4.1K   84   30
C# .NET - MCI audio mixer with multiple tracks and buses

Introduction

This is a nice Audio Mixer I made in C# .NET - VS8. It uses MCI component to play media files, it may work with video files too.

I would like to add in the future with your help:

  • equalization in each track and master
  • recording button in each bus and master
  • mic and line-in selection (in each track at input-selector sector)
  • spectrum board or leds indicating volume and activity
screen.PNG

It took me long to made this, so please comment and enjoy it!

I used some stuff from CodeProject.com such as Knob-Control, MCI classes, etc.

Credits go to the respective owners.

I took the time to explain a bit of how this works and the project idea. In time, I'll be adding detailed information.

First of all, this is an "Audio Mixer Console Simulator", what does an audio mixer do? It mixes sounds. These kind of consoles are used in recording studios and live performances for mixing audio, for example when bands do live presentations the mixer is what unifies the bass, guitar, drums, vocals and all other instruments, so signals can go out by the same pair of speakers with the correct volume level, panning, equalization, etc..

This project is a Console Simulation, so does not work like a real mixer console. It only mixes media files such as mp3, wav, ogg, etc.

In this case, I made a 10x4 console, that means 10tracks x 4buses (we can mix up-to 10 media files simultaneously, with 4 different output settings.)

Let's go to the project.

frmMain.PNG - Click to enlarge image

This is the main window, there are 10 tracks, and at the right we have a master volume control and Bus-Output selection where we can choose which signal we listen to.

frmInputs

frmInputs.PNG

Here is where we choose the 10 media files. We can see how this part of the console would look in a real mixer (behind the form title), where you plug-in the cable coming from the mics/instruments; here we don't have cables, we have files.

Here, I'll be explaining each part of a Track at the main panel.

track.PNG

  1. track caption: It's the title of the track. By double-clicking, you can edit it and put things like 'bass' so you know what signal that track manipulates.
  2. input selection: Where you select the number of input signal from the frmInputs

    inputSelection.PNG

  3. pre-amplification volume level: It's the level of the incoming signal before it is manipulated (in this case, we don't manipulate it but in the future we can add an equalizer and some other stuff into the tracks.)
  4. buses-exit: Here you adjust the level of the signal that you want to send to each bus. For example, if you leave the green track with 0, when you change in the Bus-Output selection (at the right part of the main form) to Aux2, you won't listen to the track.
  5. pan level: It's the signal position in the stereo speakers. 0 means that the sound goes to both speakers by the same level. -100 means that all the signal will go into the left speaker, and +100 ito the rightone. So if we put +50, we will be having more signal in the right speaker than in the leftone.
  6. solo switch: This button activates the solo-mode. This means that all other tracks without this button pressed will be muted.
  7. mute switch: Mutes the track.
  8. track main volume level: it works like the pre-amplification volume level, with the difference of changing the signal volume after being manipulated -by equalizer and other stuff.

Ok, hope you understand better the idea and how the console works. I will be explaining how I use the MCI, but basically this is the idea:

There are MCI controls into each track and each Input-Player-Control (the 10 controls from the frmInputs). When you click OK button from frmInputs, each track synchronizes itself with the position of the Input-Player-Controls. That was the way I do manipulate with ease the signals and synchronize them as if it was into a live mode.

Here I paste the simple code that makes this feeling of having the signals accessible to all the tracks as if they were connected with a cable.

C#
foreach (Track.Track _ArrayTracks in _Tracks)
{
    _ArrayTracks.Paths = loFrmInputs.Paths;
    _ArrayTracks.PlayState = loFrmInputs.PlayState;
    _ArrayTracks.Position = loFrmInputs.Position;
    _ArrayTracks.LoadSongToTrack();
} 

This goes for each track and synchronizes the filename, playstate and position of the file.

_ArrayTracks is an object of the type Track and _Tracks is an arraylist that has all the tracks inside.

Ok, that's all for the moment. I love making interesting audio projects, so I decided to share this with you. I really hope you enjoy it and make better ones!

Thanks! Comment, share and credit please. :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Argentina Argentina
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
yannlh28-Dec-09 8:59
yannlh28-Dec-09 8:59 
GeneralArticle feedback [modified] Pin
jeffb4223-Dec-09 8:43
jeffb4223-Dec-09 8:43 
GeneralRe: Article feedback Pin
Jonathan C Dickinson28-Dec-09 8:50
Jonathan C Dickinson28-Dec-09 8:50 
GeneralRe: Article feedback Pin
jeffb4228-Dec-09 13:02
jeffb4228-Dec-09 13:02 
GeneralMy vote of 1 Pin
ehenry723-Dec-09 4:51
ehenry723-Dec-09 4:51 
GeneralMy vote of 1 Pin
Michael E. Jones23-Dec-09 0:26
Michael E. Jones23-Dec-09 0:26 
GeneralNice work Amigo [modified] Pin
a_pess22-Dec-09 19:23
a_pess22-Dec-09 19:23 
GeneralMy vote of 1 Pin
Bill SerGio, The Infomercial King22-Dec-09 10:28
Bill SerGio, The Infomercial King22-Dec-09 10:28 
GeneralMy vote of 1 Pin
Johann Krenn22-Dec-09 7:11
Johann Krenn22-Dec-09 7:11 
GeneralMy vote of 2 Pin
eran202222-Dec-09 7:08
professionaleran202222-Dec-09 7:08 
Generalyou are crazy!! Pin
reborn_zhang22-Dec-09 5:17
reborn_zhang22-Dec-09 5:17 
GeneralMy vote of 1 Pin
leeloo99921-Dec-09 20:27
leeloo99921-Dec-09 20:27 
GeneralRe: My vote of 1 Pin
Rodrigo Rodriguez22-Dec-09 1:27
Rodrigo Rodriguez22-Dec-09 1:27 
GeneralRe: My vote of 1 Pin
Bill SerGio, The Infomercial King23-Dec-09 4:27
Bill SerGio, The Infomercial King23-Dec-09 4:27 
GeneralRe: My vote of 1 Pin
Rodrigo Rodriguez23-Dec-09 4:58
Rodrigo Rodriguez23-Dec-09 4:58 
GeneralRe: My vote of 1 Pin
Bill SerGio, The Infomercial King23-Dec-09 5:06
Bill SerGio, The Infomercial King23-Dec-09 5:06 
QuestionGreat Job!! Pin
ezcodez26-Jul-09 19:11
ezcodez26-Jul-09 19:11 
GeneralExcellent work Pin
GeertD19-Nov-08 4:31
GeertD19-Nov-08 4:31 
GeneralWonderful...... Friend It Works Pin
D V L6-Nov-08 4:06
professionalD V L6-Nov-08 4:06 
GeneralCool idea Pin
Maximilian Korporal26-Oct-08 10:07
Maximilian Korporal26-Oct-08 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.