public class ZMap extends UGen implements DataBeadReceiver
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
ZMap(AudioContext context)
Constructor for a 1-channel mapping object with default parameters
(mapping [0,1] to [0,1] with no clipping, or multiplying by 1 and adding
0).
|
ZMap(AudioContext context,
int channels)
Constructor for a mapping object with the specified number of channels
and the default parameters (mapping [0,1] to [0,1] with no clipping, or
multiplying by 1 and adding 0).
|
Modifier and Type | Method and Description |
---|---|
ZMap |
addThenMultiply(float preshift,
float multiplier)
A convenience method; specifies a linear map by adding first, then
multiplying.
|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
ZMap |
clear()
Returns ZMap to its default setting: multiply by 1, add 0 (mapping [0,1]
to [0,1] with no clipping).
|
int |
getChannels()
Gets the number of channels for this ZMap instance.
|
boolean |
getClipping()
Gets whether ZMap clips the incoming values to lie within the specified
range.
|
float |
getMultiplier()
Gets the value that is multiplied by the signal.
|
DataBead |
getParams()
Gets a new DataBead filled with current parameter values.
|
float |
getShift()
Gets the value that is added to the signal after it has been multiplied
by the multiplier.
|
float |
getSourceMaximum()
Gets the "maximum" expected value for the incoming signal.
|
float |
getSourceMinimum()
Gets the "minimum" expected value for the incoming signal.
|
DataBead |
getStaticParams()
Gets a new DataBead filled with current parameter values.
|
float |
getTargetMaximum()
Gets the "maximum" target value for the outgoing signal.
|
float |
getTargetMinimum()
Gets the "minimum" target value for the outgoing signal.
|
ZMap |
multiplyThenAdd(float multiplier,
float shift)
Sets the multiplier and the shift.
|
DataBeadReceiver |
sendData(DataBead db)
Sets the ZMap parameters with a DataBead, using the following properties:
"sourceMinimum", "sourceMaximum", "targetMinimum", "targetMaximum",
"multiplier", "shift", "clipping".
|
ZMap |
setClipping(boolean clip)
Specifies whether ZMap clips the incoming values to lie within the
specified range.
|
ZMap |
setMultiplier(float multiplier)
Sets the value that is multiplied by the signal.
|
ZMap |
setRanges(float sourceMin,
float sourceMax,
float targetMin,
float targetMax)
Sets the source and target ranges for the signal mapping.
|
ZMap |
setShift(float shift)
Sets the value to add to the signal after it has been multiplied by the
multiplier.
|
ZMap |
setSourceMaximun(float sourceMax)
Sets the "maximum" expected value for the incoming signal.
|
ZMap |
setSourceMinimum(float sourceMin)
Sets the "minimum" expected value for the incoming signal.
|
ZMap |
setTargetMaximum(float targetMax)
Sets the "maximum" value for the output signal.
|
ZMap |
setTargetMinimum(float targetMin)
Sets the "minimum" value for the output signal.
|
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
public ZMap(AudioContext context)
context
- The audio context.public ZMap(AudioContext context, int channels)
context
- The audio context.channels
- The number of channels.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 float getSourceMinimum()
public ZMap setSourceMinimum(float sourceMin)
sourceMin
- The "minimum" expected value.public float getSourceMaximum()
public ZMap setSourceMaximun(float sourceMax)
sourceMax
- The "maximum" expected value.public float getTargetMinimum()
public ZMap setTargetMinimum(float targetMin)
targetMin
- The "minimum" output value.public float getTargetMaximum()
public ZMap setTargetMaximum(float targetMax)
targetMax
- The "maximum" output value.public ZMap setRanges(float sourceMin, float sourceMax, float targetMin, float targetMax)
sourceMin
- The "minimum" incoming value.sourceMax
- The "maximum" incoming value.targetMin
- The "minimum" outgoing value.targetMax
- The "maximum" outgoing value.public ZMap clear()
public ZMap multiplyThenAdd(float multiplier, float shift)
multiplier
- The value to multiply by the incoming signal.shift
- The value to then add to the result.public ZMap addThenMultiply(float preshift, float multiplier)
preshift
- The value to first add to the signal.multiplier
- The value then multiplied by the result.public float getMultiplier()
public ZMap setMultiplier(float multiplier)
multiplier
- The multiplierpublic float getShift()
public ZMap setShift(float shift)
shift
- The amount to add.public boolean getClipping()
public ZMap setClipping(boolean clip)
clip
- Whether to clip.public int getChannels()
public DataBeadReceiver sendData(DataBead db)
sendData
in interface DataBeadReceiver
db
- The parameter DataBead.public DataBead getParams()
public DataBead getStaticParams()