|
|||||||||
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.Phasor
public class Phasor
Produces a cycling linear ramp from 0 to 1, like the Phasor object in Max/MSP. More accurate than WavePlayer for slow speeds, as it calculates it's value for each sample, rather than stepping through a buffer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary | |
---|---|
protected float |
frequency
|
protected double |
one_over_sr
|
protected double |
phase
|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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, messageReceived, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected float frequency
protected double phase
protected double one_over_sr
Constructor Detail |
---|
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.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
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |