|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.beadsproject.beads.core.Bead
net.beadsproject.beads.core.UGen
net.beadsproject.beads.ugens.Panner
public class Panner
A simple panning object that takes a mono input and gives stereo output. Power is kept constant regardless of position; note that center-panning a signal will yield the input signal multiplied by 1 / sqrt(2) in each output channel as a result. A pan value of -1 pans completely to the left, 1 pans completely to the right, and 0 results in center panning. It uses an array to approximate square roots for efficiency.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary | |
---|---|
protected boolean |
isPosStatic
|
protected float |
p1
|
protected float |
p2
|
protected float |
pos
|
protected UGen |
posUGen
|
static float[] |
ROOTS
|
protected static int |
rootSize
|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class net.beadsproject.beads.core.UGen |
---|
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 |
Methods inherited from class net.beadsproject.beads.core.Bead |
---|
getKillListener, getName, isDeleted, isPaused, kill, message, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static int rootSize
public static float[] ROOTS
protected float pos
protected float p1
protected float p2
protected UGen posUGen
protected boolean isPosStatic
Constructor Detail |
---|
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.Method Detail |
---|
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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |