public abstract class Function extends UGen
UGen
on the fly. Subclasses of Function must implement calculate()
, getting data from the array x
, and returning the result. x
provides access to the array of UGen
s that are passed to Function's constructor.UGen.OutputInitializationRegime, UGen.OutputPauseRegime
Modifier and Type | Field and Description |
---|---|
protected float[] |
x
An array representing the current values from the array of input UGens.
|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
Function(UGen... inputs)
Instantiates a new function.
|
Function(UGen input)
Instantiates a new function.
|
Modifier and Type | Method and Description |
---|---|
abstract float |
calculate()
Override this to calculate what to do.
|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
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[] x
public Function(UGen input)
input
- the inputpublic Function(UGen... inputs)
inputs
- the set of input UGens.public final 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 abstract float calculate()
UGen
s.