public class Panner extends UGen implements DataBeadReceiver
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
Modifier and Type | Field and Description |
---|---|
protected boolean |
isPosStatic |
protected float |
p1 |
protected float |
p2 |
protected float |
pos |
protected UGen |
posUGen |
static float[] |
ROOTS |
protected static int |
rootSize |
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
Panner(AudioContext con)
Constructor that sets the pan to the middle by default.
|
Panner(AudioContext con,
float ipos)
Constructor that sets the pan to a static value.
|
Panner(AudioContext con,
UGen posUGen)
Constructor that sets a UGen to specify the pan value.
|
Modifier and Type | Method and Description |
---|---|
protected static float[] |
buildRoots(int rs)
Calculates an array of square-roots from 0 to 1.
|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
DataBead |
getParams()
Gets a DataBead with the pan position (whether float or UGen), stored in
the key "position".
|
float |
getPos()
Gets the current pan position.
|
UGen |
getPosUGen()
Gets the pan UGen, if it exists.
|
DataBead |
getStaticParams()
Gets a DataBead with property "position" set to its current float value.
|
void |
messageReceived(Bead message)
Responds to an incoming message.
|
DataBeadReceiver |
sendData(DataBead db)
Sets the pan position with a DataBead.
|
Panner |
setParams(DataBead paramBead)
Sets the parameter with a DataBead.
|
Panner |
setPos(float pos)
Sets the pan position to a static float value.
|
Panner |
setPos(UGen posUGen)
Sets a UGen to specify the pan position.
|
addDependent, addInput, addInput, clearDependents, clearInputConnections, containsInput, crossfadeInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfConnectedUGens, getNumberOfDependents, getOutBuffer, getOuts, getTimeTakenLastUpdate, getValue, getValue, getValueDouble, getValueDouble, initializeOuts, isTimerMode, isUpdated, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeAllConnections, removeConnection, removeDependent, setOutsToPause, setTimerMode, setValue, update, zeroIns, zeroOuts
protected static int rootSize
public static float[] ROOTS
protected float pos
protected float p1
protected float p2
protected UGen posUGen
protected boolean isPosStatic
public Panner(AudioContext con)
con
- The audio context.public Panner(AudioContext con, float ipos)
con
- The audio context.ipos
- The initial pan value.public Panner(AudioContext con, UGen posUGen)
con
- The audio context.posUGen
- The pan UGen.public void calculateBuffer()
UGen
UGen.bufIn
and putting data
into UGen.bufOut
in some way. UGen.bufIn
and UGen.bufOut
are 2D arrays of floats of the form float[numChannels][bufferSize]. The length of the buffers is given by
UGen.bufferSize
, and the number of channels of the input and output buffers are given by UGen.ins
and UGen.outs
respectively.calculateBuffer
in class UGen
protected static float[] buildRoots(int rs)
rs
- The size of the array minus 2.public float getPos()
public Panner setPos(float pos)
pos
- The pan position.public Panner setPos(UGen posUGen)
posUGen
- The pan UGen.public UGen getPosUGen()
public Panner setParams(DataBead paramBead)
Use the "position" property to specify pan position.
paramBead
- The DataBead specifying parameters.public void messageReceived(Bead message)
Bead
messageReceived
in class Bead
message
- the messagepublic DataBead getParams()
public DataBead getStaticParams()
public DataBeadReceiver sendData(DataBead db)
sendData
in interface DataBeadReceiver
db
- The DataBead message.this
.setParams(DataBead)