public class OnePoleFilter extends IIRFilter implements DataBeadReceiver
It uses the formula: y(n) = a * x(n) + (1 - a) * y(n - 1)
IIRFilter.IIRFilterAnalysis
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
Modifier and Type | Field and Description |
---|---|
protected boolean |
isFreqStatic |
protected float |
samplingfreq |
protected float |
two_pi_over_sf |
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
OnePoleFilter(AudioContext con,
float freq)
Constructor for cut-off frequency specified by a static float.
|
OnePoleFilter(AudioContext con,
UGen freq)
Constructor for cut-off frequency specified by a UGen.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
protected void |
calcVals() |
IIRFilter.IIRFilterAnalysis |
getFilterResponse(float freq) |
float |
getFreq()
Deprecated.
Use
getFrequency() . |
float |
getFrequency()
Gets the current cut-off frequency.
|
UGen |
getFrequencyUGen()
Gets the cut-off frequency UGen; returns null if frequency is static.
|
UGen |
getFreqUGen()
Deprecated.
Use
getFrequencyUGen() . |
DataBead |
getParams()
Gets a DataBead with the filter frequency (whether float or UGen), stored
in the key "frequency".
|
DataBead |
getStaticParams()
Gets a DataBead with property "frequency" set to its current float value.
|
void |
messageReceived(Bead message)
Responds to an incoming message.
|
DataBeadReceiver |
sendData(DataBead db)
Sets the filter frequency with a DataBead.
|
OnePoleFilter |
setFreq(float freq)
Deprecated.
Use
setFrequency(float) . |
OnePoleFilter |
setFreq(UGen freqUGen)
Deprecated.
Use
setFrequency(UGen) . |
OnePoleFilter |
setFrequency(float freq)
Sets the cut-off frequency to a static float.
|
OnePoleFilter |
setFrequency(UGen freqUGen)
Sets a UGen to specify the cut-off frequency; passing null freezes the
frequency at its current value.
|
OnePoleFilter |
setParams(DataBead paramBead)
Sets the filter parameters with a DataBead.
|
analyzeFilter, calculateFilterResponse, calculateGroupDelay, getAmplitudeResponse, getGroupDelay, getPhaseDelay, getPhaseResponse
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
protected float samplingfreq
protected float two_pi_over_sf
protected boolean isFreqStatic
public OnePoleFilter(AudioContext con, float freq)
con
- The audio context.freq
- The cut-off frequency.public OnePoleFilter(AudioContext con, UGen freq)
con
- The audio context.freq
- The cut-off frequency UGen.protected void calcVals()
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 getFrequency()
public OnePoleFilter setFrequency(float freq)
freq
- The cut-off frequency.public OnePoleFilter setFrequency(UGen freqUGen)
freqUGen
- The cut-off frequency UGen.public UGen getFrequencyUGen()
@Deprecated public float getFreq()
getFrequency()
.@Deprecated public OnePoleFilter setFreq(float freq)
setFrequency(float)
.freq
- The cut-off frequency.@Deprecated public OnePoleFilter setFreq(UGen freqUGen)
setFrequency(UGen)
.freqUGen
- The cut-off frequency UGen.@Deprecated public UGen getFreqUGen()
getFrequencyUGen()
.public OnePoleFilter setParams(DataBead paramBead)
Use the "frequency" properties to specify filter frequency.
paramBead
- The DataBead specifying parameters.public void messageReceived(Bead message)
Bead
messageReceived
in class Bead
message
- the messagepublic DataBead getParams()
public DataBead getStaticParams()
public DataBeadReceiver sendData(DataBead db)
sendData
in interface DataBeadReceiver
db
- The DataBead message.setParams(DataBead)
public IIRFilter.IIRFilterAnalysis getFilterResponse(float freq)
getFilterResponse
in class IIRFilter