public class Phasor extends UGen
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
Modifier and Type | Field and Description |
---|---|
protected float |
frequency |
protected double |
one_over_sr |
protected double |
phase |
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
Phasor(AudioContext con)
Basic constructor.
|
Phasor(AudioContext con,
float frequency)
Constructor that sets the initial frequency to a float value.
|
Phasor(AudioContext con,
UGen frequencyUGen)
Constructor that sets a UGen to control the frequency.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
float |
getFrequency()
Gets the current frequency.
|
UGen |
getFrequencyUGen()
Gets the UGen that controls the frequency.
|
float |
getPhase()
Gets the current phase.
|
Phasor |
setFrequency(float frequency)
Sets the frequency to a static value.
|
Phasor |
setFrequency(UGen frequencyUGen)
Sets a UGen to control the frequency.
|
Phasor |
setPhase(float phase)
Sets the phase.
|
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
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString
protected float frequency
protected double phase
protected double one_over_sr
public Phasor(AudioContext con)
con
- The AudioContext.public Phasor(AudioContext con, float frequency)
con
- The AudioContext.frequency
- The initial frequency.public Phasor(AudioContext con, UGen frequencyUGen)
con
- The AudioContext.frequencyUGen
- The frequency controller 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
public UGen getFrequencyUGen()
public float getFrequency()
public Phasor setFrequency(UGen frequencyUGen)
frequencyUGen
- The new frequency controller.public Phasor setFrequency(float frequency)
frequency
- The new frequency value.public float getPhase()
public Phasor setPhase(float phase)
phase
- The new phase.