public class CombFilter extends IIRFilter
y(n) = a * x(n) + g * x(n - d) - h * y(n - d)
IIRFilter.IIRFilterAnalysis
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
CombFilter(AudioContext con,
int maxdel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
float |
getA()
Gets the 'a' parameter.
|
UGen |
getAUGen()
Gets the 'a' UGen, if it exists.
|
int |
getDelay()
Gets the current delay in samples.
|
UGen |
getDelayUGen()
Gets the delay UGen, if it exists.
|
IIRFilter.IIRFilterAnalysis |
getFilterResponse(float freq) |
float |
getG()
Gets the g parameter.
|
UGen |
getGUGen()
Gets the g UGen, if it exists.
|
float |
getH()
Gets the h parameter.
|
UGen |
getHUGen()
Gets the h UGen, if it exists.
|
int |
getMaxDelay()
Gets the maximum delay in samples.
|
DataBead |
getParams()
Gets a DataBead with properties "a", "g", "h", and "delay" set to the
corresponding filter parameters.
|
DataBead |
getStaticParams()
Gets a DataBead with properties "a", "g", "h", and "delay" set to static
float values corresponding to the current filter parameters.
|
void |
messageReceived(Bead message)
Responds to an incoming message.
|
void |
reset()
Use this to reset the filter if it explodes.
|
CombFilter |
setA(float a)
Sets the 'a' parameter to a float value.
|
CombFilter |
setA(UGen a)
Sets a UGen to specify the 'a' parameter.
|
CombFilter |
setDelay(int delay)
Sets the delay time in samples.
|
CombFilter |
setDelay(UGen delay)
Sets a UGen to specify the delay in samples (converted to ints).
|
CombFilter |
setG(float g)
Sets the g parameter to a float value.
|
CombFilter |
setG(UGen g)
Sets a UGen to specify the g parameter.
|
CombFilter |
setH(float h)
Sets the h parameter to a float value.
|
CombFilter |
setH(UGen h)
Sets a UGen to specify the h parameter.
|
CombFilter |
setParams(DataBead paramBead)
Sets the filter parameters with a DataBead.
|
CombFilter |
setParams(int delay,
float a,
float g,
float h)
Sets all the parameters at once.
|
CombFilter |
setParams(UGen delUGen,
UGen aUGen,
UGen gUGen,
UGen hUGen)
Sets the parameter UGens.
|
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
public CombFilter(AudioContext con, int maxdel)
con
- The audio context.maxdel
- The maximum delay in samples.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 void reset()
public int getMaxDelay()
public int getDelay()
public CombFilter setDelay(int delay)
delay
- The delay in samples.public CombFilter setDelay(UGen delay)
delay
- The delay UGen.public UGen getDelayUGen()
public float getG()
public CombFilter setG(float g)
g
- The g parameter.public CombFilter setG(UGen g)
g
- The g UGen.public UGen getGUGen()
public float getH()
public CombFilter setH(float h)
h
- The h parameter.public CombFilter setH(UGen h)
h
- The h UGen.public UGen getHUGen()
public float getA()
public CombFilter setA(float a)
a
- The 'a' parameter.public CombFilter setA(UGen a)
a
- The 'a' UGen.public UGen getAUGen()
public CombFilter setParams(int delay, float a, float g, float h)
delay
- The delay in samples.a
- The 'a' parameter.g
- The g parameter.h
- The h parameter.public CombFilter setParams(UGen delUGen, UGen aUGen, UGen gUGen, UGen hUGen)
delUGen
- The delay UGen.aUGen
- The 'a' UGen.gUGen
- The g UGen.hUGen
- The h UGen.public CombFilter setParams(DataBead paramBead)
Use the following properties to specify filter parameters:
paramBead
- The DataBead specifying parameters.public void messageReceived(Bead message)
Bead
messageReceived
in class Bead
message
- the messagepublic DataBead getParams()
public DataBead getStaticParams()
public IIRFilter.IIRFilterAnalysis getFilterResponse(float freq)
getFilterResponse
in class IIRFilter