|
|||||||||
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.AllpassFilter
public class AllpassFilter
A simple all-pass filter with variable delay. Implements the following formula: Y(n) = X(n-d) + g * (Y(n-d) - X(n)), for delay time d and factor g.
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 int |
bufLen
|
protected int |
delay
|
protected UGen |
delayUGen
|
protected float |
g
|
protected UGen |
gUGen
|
protected int |
ind
|
protected boolean |
isDelayStatic
|
protected boolean |
isGStatic
|
protected int |
maxDelay
|
protected float[] |
xn
|
protected float[] |
yn
|
Fields inherited from class net.beadsproject.beads.core.UGen |
---|
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs |
Constructor Summary | |
---|---|
AllpassFilter(AudioContext context,
int maxdel,
int idel,
float ig)
Constructor with delay and g specified by floats. |
|
AllpassFilter(AudioContext context,
int maxdel,
int idel,
UGen ig)
Constructor with delay specified by a float and g specified by a UGen. |
|
AllpassFilter(AudioContext context,
int maxdel,
UGen idel,
float ig)
Constructor with delay specified by a UGen and g specified by a float. |
|
AllpassFilter(AudioContext context,
int maxdel,
UGen idel,
UGen ig)
Constructor with delay and g specified by UGens. |
Method Summary | |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data. |
int |
getDelay()
Gets the current delay in samples. |
UGen |
getDelayUGen()
Gets the delay UGen, if there is one. |
IIRFilter.IIRFilterAnalysis |
getFilterResponse(float freq)
|
float |
getG()
Gets the current g parameter. |
UGen |
getGUGen()
Gets the g UGen, if there is one. |
DataBead |
getParams()
Gets a DataBead with properties "delay" and "g" set to the corresponding filter parameters. |
DataBead |
getStaticParams()
Gets a DataBead with properties "delay" and "g" set to static float values corresponding to the current filter parameters. |
void |
messageReceived(Bead message)
Responds to an incoming message. |
DataBeadReceiver |
sendData(DataBead db)
Sets the filter's parameters with a DataBead. |
AllpassFilter |
setDelay(int del)
Sets the delay. |
AllpassFilter |
setDelay(UGen del)
Sets a UGen to determine the delay in samples. |
AllpassFilter |
setG(float g)
Sets the g parameter. |
AllpassFilter |
setG(UGen g)
Sets a UGen to determine the g value. |
AllpassFilter |
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 g
protected int maxDelay
protected int delay
protected int ind
protected int bufLen
protected UGen delayUGen
protected UGen gUGen
protected boolean isDelayStatic
protected boolean isGStatic
protected float[] xn
protected float[] yn
Constructor Detail |
---|
public AllpassFilter(AudioContext context, int maxdel, int idel, float ig)
context
- The AudioContext.maxdel
- The maximum delay in samples; cannot be changed.idel
- The initial delay in samples.ig
- The initial g parameter.public AllpassFilter(AudioContext context, int maxdel, UGen idel, float ig)
context
- The AudioContext.maxdel
- The maximum delay in samples; cannot be changed.idel
- The delay UGen.ig
- The initial g parameter.public AllpassFilter(AudioContext context, int maxdel, int idel, UGen ig)
context
- The AudioContext.maxdel
- The maximum delay in samples; cannot be changed.idel
- The initial delay in samples.ig
- The g UGen.public AllpassFilter(AudioContext context, int maxdel, UGen idel, UGen ig)
context
- The AudioContext.maxdel
- The maximum delay in samples; cannot be changed.idel
- The delay UGen.ig
- The g UGen.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 float getG()
public AllpassFilter setG(float g)
g
- The g parameter.
public AllpassFilter setG(UGen g)
g
- The g UGen.
public UGen getGUGen()
public int getDelay()
public AllpassFilter setDelay(int del)
del
- The delay in samples. This will remove the delay UGen if there
is one.
public AllpassFilter setDelay(UGen del)
del
- The delay UGen.
public UGen getDelayUGen()
public AllpassFilter 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 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 |