21 April 2007

pan~

pan~

This block is a simple panorama block. It has an input to control the position and works according to the equal power idea, using a sine function.

version

v1.0: built 15/04/2007 with Pd v0.40-2 [pd][pdf]
TO DO: the sine function is implemented with a table. When pan~ is used several times in one patch, they'll all have to work with the same control function (sine in this case). I didn't yet find how to comprise the $ argument in the patch so that every pan~ block works with its own table.
v1.1: built 9/05/2007 with Pd v0.40-2 [pd][pdf]

interface

Input1 : the mono audio signal input
Input2 : the control input; ranging from -127 (LEFT) to 127 (RIGHT) where 0 marks the CENTER position

Output1: the left channel audio signal
Output2: the right channel audio signal

Controls: internally one can choose between 4 panning laws: sine, root, gogin and linear. (see the documentation of the monopanner~)

implementation

The inlet receives a control signal as specified in the interface section. This signal is shifted. It's range is then from 0 to 256, which is the same range as the table used. For every value an attenuation factor is looked up in the table. This is then multiplied with the signal itself.
The initialization is done by setting the control value to zero and initializing the table.
Dollar arguments are implemented to make sure multiple use of pan~ in the same patch allows for unique behaviour.








No comments: