|
|||||||||
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.Compressor
public class Compressor
A simple multi-channel dynamic range compression UGen. Users can vary the threshold (set in RMS power units), the compression ratio, the rate of attack/decay, look-ahead time (delay), and the hardness/softness of the knee. The amount of compression can also be controlled by an alternate side-chain.
The following are the default parameter values:
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary |
---|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
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 |
Constructor Detail |
---|
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.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 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |