public class Compressor extends UGen implements DataBeadReceiver
The following are the default parameter values:
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
Compressor(AudioContext context)
Constructor for a 1-channel compressor with no look-ahead time and other
parameters set to their default values.
|
Compressor(AudioContext context,
int channels)
Constructor for a multi-channel compressor with no look-ahead time and
other parameters set to their default values.
|
Compressor(AudioContext context,
int channels,
float lookAheadDelay)
Constructor for a multi-channel compressor with the specified look-ahead
time and other parameters set to their default values.
|
Compressor(AudioContext context,
int channels,
float lookAheadDelay,
UGen sideChain)
Constructor for a multi-channel compressor with the specified look-ahead
time and side-chain, and other parameters set to their default values.
|
Compressor(AudioContext context,
int channels,
UGen sideChain)
Constructor for a multi-channel compressor with the specified side-chain,
no look-ahead time, and other parameters set to their default values.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
float |
getAttack()
Gets the attack factor.
|
float |
getCurrentCompression()
Gets the current scaling factor - the factor which scales the incoming
signal, determined by the side chain.
|
float |
getDecay()
Gets the decay factor.
|
float |
getKnee()
Gets the knee softness.
|
DataBead |
getParams()
Gets a DataBead filled with properties set to corresponding compressor
parameters: "threshold", "ratio", "attack", "decay", "knee".
|
float |
getRatio()
Gets the compression ratio.
|
float |
getThreshold()
Gets the threshold value.
|
DataBeadReceiver |
sendData(DataBead db)
Sets the compressor parameters with a DataBead.
|
Compressor |
setAttack(float attack)
Sets the attack factor.
|
Compressor |
setDecay(float decay)
Sets the decay factor.
|
Compressor |
setKnee(float knee)
Sets the knee softness.
|
Compressor |
setRatio(float ratio)
Sets the compression ratio.
|
Compressor |
setSideChain(UGen sideChain)
Sets the side chain.
|
Compressor |
setThreshold(float threshold)
Sets the threshold value.
|
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 Compressor(AudioContext context)
context
- The audio context.public Compressor(AudioContext context, int channels)
context
- The audio context.channels
- The number of channels.public Compressor(AudioContext context, int channels, UGen sideChain)
context
- The audio context.channels
- The number of channels.sideChain
- The UGen to use as the side-chain.public Compressor(AudioContext context, int channels, float lookAheadDelay)
context
- The audio context.channels
- The number of channels.lookAheadDelay
- The look-ahead time in milliseconds.public Compressor(AudioContext context, int channels, float lookAheadDelay, UGen sideChain)
context
- The audio context.channels
- The number of channels.lookAheadDelay
- The look-ahead time in milliseconds.sideChain
- The UGen to use as the side-chain.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 Compressor setSideChain(UGen sideChain)
RMS
object) determines how much the compressor scales the input;
by default (and if this method is passed null
), the side
chain is the same as the input.sideChain
- The side chain signal.public float getAttack()
public Compressor setAttack(float attack)
attack
- The attack factor in decibels per millisecond.public float getDecay()
public Compressor setDecay(float decay)
decay
- The decay factor in decibels per millisecond.public float getRatio()
public Compressor setRatio(float ratio)
ratio
- The compression ratio.public float getThreshold()
public Compressor setThreshold(float threshold)
threshold
- The threshold.public float getKnee()
public Compressor setKnee(float knee)
knee
- The knee softness.public DataBeadReceiver sendData(DataBead db)
sendData
in interface DataBeadReceiver
db
- The parameter DataBead.public DataBead getParams()
public float getCurrentCompression()