From: Tim E. R. <ter...@ro...> - 2013-03-11 07:55:54
|
Hey. I'm working in the audio mixing engine again. I'm finally adding sample-accurate track controllers such as volume and pan. The code also demonstrates the place to inject sample-accurate faders and cross-faders when we get around to adding them. I've noticed that we do possibly incorrect things with the pan control. Our pan knob goes from -1.0 to 1.0. The pan formula we use is: vol_L = _volume * (1.0 - _pan); vol_R = _volume * (1.0 + _pan); where _volume is the volume fader value, _pan is the pan knob value. vol_L and vol_R are the factors that are applied to (multiplied by) the audio data values. In the case of a mono track, this is how much of the signal is applied to the L and R right outputs. In the case of a stereo track, this is how much of each of the L and R signals are applied. You can see that for a mono track, when 'pan' is in the center, 100% of the signal is applied to the L and R, and when the knob is turned to full L or R, it actually *increases* the L or R to twice the value, +3dB (power), while decreasing the other channel to zero of course. According to places like wikipedia, when pan is at center, the L and R outputs should be, depending on the chosen Pan Law [1], around 3dB to 6dB *lower* than when pan is at full L or R. 4.5dB is a common compromise between the 3dB and 6dB. So we're apparently doing this wrong by increasing the values *above* 0dB at pan extremities. The situation for stereo tracks is apparently even worse. In the case of stereo tracks the 'pan' knob should really be called a 'balance' control. And we are therefore not computing balance correctly, according to [2]. We are applying these vol_L and vol_R factors to the two channels, which is wrong - it needs to operate like a balance control. Anyone have any objections to me attempting to fix this? Also, I'm reading about mixers and Pre Fader Listening buttons trying to understand if our button is working correctly, and if it might be desirable to embellish the mixer strips with an extra pre/post button or two, or some other small handy button goodies. Apparently PFL is used in conjunction with monitor buses, but in MusE tracks are so generalized that we don't have a 'monitor' bus. But we have 'Aux' tracks using aux 'buses', if you want to call them that. Someone a long time ago added a 'monitor' buffer to our Audio Output tracks, but it is totally unused and I'm thinking of removing it - but maybe not? Can we utilize this, and how do you think a 'monitor' feature in general should work, behave, and appear in MusE, if at all, or are Aux tracks good enough and just stick to making them better with a few pre/post buttons and so on? I know it might be desirable to allow effects after the fader so that for example reverb 'tails' will still sound, but for now until such features are added I'm reasoning that such operations should be done with the (reverb) plugin's level controls and the track volume fader really should cut off *all* sound as it does now, after all it is a /track/ fader... Cheers. Tim. [1] http://en.wikipedia.org/wiki/Pan_law [2] http://www.rane.com/par-b.html#balance |