Pan class public functions

Additional functions inherited from Filter.

Pan(int aPanType = CONSTANT_POWER_PAN);
Sets the panning method to aPanType and sets initial left and right output values to 0. Sets the name of the object to "Pan".
~Pan();
Does nothing.
void action(void);
Updates the left and right output signal accessed through the output() function. Pans input[0], according to pan location input[1]. if input[1] = 0, then all of the input signal will be placed in the left channel (output[0]), and if input[1] = 1, then all of the input signal will be placed in the right channel (output[1]). Pan locations between 1 and 0 will be split into left and right channels according to the panning method.
void clear(void);
Sets the output values to zero.
void doLinearPan(void);
Sets the panning method to linear panning. When a signal is panned to the middle (0.5) it will seem to recede (or become quieter) since the intensity is less than panned full left or right.
void doPowerPan(void);
Sets the panning method to constant-power panning. This is the default panning method for the Pan class. For this case, the intensity will remain constant (rather than the amplitude sum) in each output channel. This means that the sound will pan more in a straight line between speakers than when using the linear panning method.
sampleType getInput(void);
Returns the current value of the input signal.
sampleType getPan(void);
Returns the current value of the pan location.
int getPanType(void);
Returns the panning method being used. See the #defines below.
sampleType output(int index);
Returns the specified stereo output channel. if index = 0, then return the left channel, if index = 1 then return the right channel.
void printState(void);
Prints the current input signal value and the current pan location. Useful for debugging.
void setInput(sampleType aValue);
void setInput(Signal& aSignal, int outputChannel = 0);
void setInput(Signal* aSignal, int outputChannel = 0);
Sets the input signal to the specified signal or constant value. outputChannel is the output channel of the input signal to read.
void setPan(sampleType aPanLocation);
void setPan(Signal& aSignal, int outputChannel = 0);
void setPan(Signal* aSignal, int outputChannel = 0);
Connects the specified signal or constant value to input[1], which controls the stereo panning location of the input signal (input[0]). outputChannel is the output channel to read in the connected panning location signal.
void setPanType(int aPanType);
Sets the pan type. See the #defines below.

#defines

Value #define Meaning
0 LINEAR_PAN Panning method: Linear panning
1 CONSTANT_POWER_PAN Panning method: Constant-power panning