how multi track recording is performed? [duplicate]

I have a doubt regarding multi track/multi layer recording of audio signals. in recording studio each instrument or chorus,playback will use a independent layer/track..so after recording a all tracks ..how do they mix all of those into a single track ..any mixing scheme?..or it is the simple time division multiplexing??

I am asking this because while I read any mp3 or wav file in Matlab..I can see only a one channel or 2 channel signal...

any help would be appreciated...

• "or it is the simple time division multiplexing??" nooooooo. you just sum them together. – endolith May 6 '14 at 18:44

Most of recordings nowadays are being done in stereo - two channels. So when you do a recording in studio, then most of tracks are mono (i.e. microphones, guitars). The main job of sound engineer is to place them in panorama (Left - Centre - Right) to create a nice spatial feeling. For this purpose you have pan knob to set this mono track to the left or right speaker (make it more louder or quieter in either of them). Many tracks are useful when you want to apply different filtering to different instruments or add some reverb, change the volume, etc. In the end all waveforms are being summed and voila!

The main track is obviously a stereo track based on your adjustments of track's pan - that's why you have two channels loaded into your MATLAB.

Mixing is done by summing signals. Typically a mixing algorithm would work something like this:

Signal a;
Signal b;
Signal c;
Gain g1;
Gain g2;
Pan p1;
Pan p2;

//where signal is a buffer of sound
//gain is a scalar for amplitude mixing
//and pan is a pan amount from left to right (i use from 0-1)

//now the mixing

c = pan(a,p1)*g1 + pan(b,p2)*g2;//where pan() is a panning function of some sort

//so if we have
Sample a(1,1);//left and right channel are equal to 1
Sample b(0.5,1);//same idea
Sample c;//storage for output

//now step by step
a = pan(a,0)*.75;//pan left and scale gain by 3/4;
//a = l:0.75 r:0
b = pan(b,1)*.75;//pan right and scale gain by 3/4;
//b = l:0 r:0.75
c = a +b;
//c = l:0.75 r:0.75


There are some more complexities involved sometimes but that is the basics as far as i understand. I tried to give my explanation in a pseudo code kind of manor I hope it is readable. Also my panning calculations are off but I think they make the point.

Good Luck