Panning
|
Pan Value |
Left Multiplier |
Right Multiplier |
1.000 |
0.000 |
1.000 |
0.750 |
0.250 |
0.750 |
0.625 |
0.375 |
0.625 |
0.500 |
0.500 |
0.500 |
0.375 |
0.625 |
0.375 |
0.250 |
0.750 |
0.250 |
0.000 |
1.000 |
0.000 |
Note how the amplitudes change from 0 to 1 in each channel. The overall amplitude remains constant at 1, but is split between the two channels. With the pan value set to 0.5, we have split the amplitude equally between the two output channels. When the pan value is non-zero one channel will sound louder than the other and we will hear this as a spatial movement of the sound.
Although simple and efficient, this calculation produces the well-known "hole in the middle" effect. As the sound intensity increases in the left and right channel it appears to move forward and backward as well as side to side. We can compensate for this by using a non-linear calculation for the left and right values. One common way to do this is to consider the pan position an angle from the center and take the sine of the position:
left = value * sin((1 - pan) * PI/2); right = value * sin(pan * PI/2);
This produces the following values for each channel:
Pan Value |
Left Multiplier |
Right Multiplier |
1.000 |
0.000 |
1.000 |
0.750 |
0.383 |
0.924 |
0.625 |
0.556 |
0.831 |
0.500 |
0.707 |
0.707 |
0.375 |
0.831 |
0.556 |
0.250 |
0.924 |
0.383 |
0.000 |
1.000 |
0.000 |
Alternatively, we can take the square root of the pan settings:
left = value * sqrt(1 - pan); right = value * sqrt(pan);
This produces the following values for each channel:
Pan Value |
Left Multiplier |
Right Multiplier |
1.000 |
0.000 |
1.000 |
0.750 |
0.500 |
0.866 |
0.625 |
0.612 |
0.791 |
0.500 |
0.707 |
0.707 |
0.375 |
0.791 |
0.612 |
0.250 |
0.866 |
0.500 |
0.000 |
1.000 |
0.000 |
Notice that for the non-linear methods the resulting amplitude at center setting is now 1.414 rather than 1.0. We can compensate for this by multiplying each channel by 0.707. This will produce settings that are 0.5 for each channel at a pan setting of 0.5.