pink.space
Functions for processing spatial qualities of sound
pan
(pan afn loc)
Stereo panning using formula from MIDI GM-2 Default Pan Curve (RP-036)
Left Channel Gain [dB] = 20*log (cos (Pi/2* max(0,CC#10 ? 1)/126))
Right Channel Gain [dB] = 20*log (sin (Pi /2* max(0,CC#10 ? 1)/126))
Instead of range 0-127, use [-1.0,1.0]
If loc is an audio-function, it should be a non-ending signal generator
otherwise on pre-mature end, the signal may zero out until the nil end
signal is given. This would caues the loc to snap to center during the
last buffer generated.