|
|||||||||
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.IIRFilter
net.beadsproject.beads.ugens.OnePoleFilter
public class OnePoleFilter
A simple one-pole filter implementation. Cut-off frequency can be specified either by UGen or a float.
It uses the formula: y(n) = a * x(n) + (1 - a) * y(n - 1)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.beadsproject.beads.ugens.IIRFilter |
---|
IIRFilter.IIRFilterAnalysis |
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen |
---|
UGen.OutputInitializationRegime, UGen.OutputPauseRegime |
Field Summary | |
---|---|
protected boolean |
isFreqStatic
|
protected float |
samplingfreq
|
protected float |
two_pi_over_sf
|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class net.beadsproject.beads.ugens.IIRFilter |
---|
analyzeFilter, calculateFilterResponse, calculateGroupDelay, getAmplitudeResponse, getGroupDelay, getPhaseDelay, getPhaseResponse |
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, setKillListener, setName, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected float samplingfreq
protected float two_pi_over_sf
protected boolean isFreqStatic
Constructor Detail |
---|
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.Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |