public class CrossoverFilter extends UGen implements DataBeadReceiver
A key feature of Linkwitz-Riley filters is that the low- and high-pass bands added together produce a flat frequency response, making them particularly useful as crossover filters. A 4th-order version is equivalent to cascading two identical 2nd-order Butterworth filters.
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
Modifier and Type | Field and Description |
---|---|
static float |
SQRT2 |
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
Constructor and Description |
---|
CrossoverFilter(AudioContext context)
Constructor for a one-channel crossover filter, initialized with a cutoff
frequency of 800Hz.
|
CrossoverFilter(AudioContext context,
int channels)
Constructor for a crossover filter with the specified number of channels,
initialized with a cutoff frequency of 800Hz.
|
CrossoverFilter(AudioContext context,
int channels,
float freq)
Constructor for a crossover filter with the specified number of channels,
set at the specified frequency.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateBuffer()
Called by the signal chain to update this UGen's ouput data.
|
CrossoverFilter |
drawFromHighOutput(int channel,
UGen target,
int targetInputIndex) |
CrossoverFilter |
drawFromHighOutput(UGen target) |
CrossoverFilter |
drawFromLowOutput(int channel,
UGen target,
int targetInputIndex) |
CrossoverFilter |
drawFromLowOutput(UGen target) |
int |
getChannels()
Gets the number of channels.
|
float |
getFreq()
Deprecated.
Use
getFrequency() . |
float |
getFrequency()
Gets the current cutoff frequency.
|
UGen |
getFrequencyUGen()
Gets the UGen controlling the cutoff frequency, if there is one.
|
UGen |
getFreqUGen()
Deprecated.
Use
getFrequencyUGen() . |
void |
messageReceived(Bead message)
Responds to an incoming message.
|
void |
reset()
Resets the filter in case it "explodes".
|
DataBeadReceiver |
sendData(DataBead db)
Sets the crossover frequency with a DataBead.
|
CrossoverFilter |
setFreq(float freq)
Deprecated.
Use
setFrequency(float) . |
CrossoverFilter |
setFreq(UGen freqUGen)
Deprecated.
Use
setFrequency(UGen) . |
CrossoverFilter |
setFrequency(float freq)
Sets the cutoff frequency to a static float value.
|
CrossoverFilter |
setFrequency(UGen freqUGen)
Sets a UGen to control the cutoff frequency.
|
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 CrossoverFilter(AudioContext context)
context
- The audio context.public CrossoverFilter(AudioContext context, int channels)
context
- The audio context.channels
- The number of channels.public CrossoverFilter(AudioContext context, int channels, float freq)
context
- The audio context.channels
- The number of channels.freq
- The initial cutoff frequency.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 float getFrequency()
public CrossoverFilter setFrequency(float freq)
freq
- The cutoff frequency in Hertz.public CrossoverFilter setFrequency(UGen freqUGen)
freqUGen
- The UGen to control the cutoff frequency.public UGen getFrequencyUGen()
@Deprecated public float getFreq()
getFrequency()
.@Deprecated public CrossoverFilter setFreq(float freq)
setFrequency(float)
.freq
- The cutoff frequency in Hertz.@Deprecated public CrossoverFilter setFreq(UGen freqUGen)
setFrequency(UGen)
.freqUGen
- The UGen to control the cutoff frequency.@Deprecated public UGen getFreqUGen()
getFrequencyUGen()
.public int getChannels()
public DataBeadReceiver sendData(DataBead db)
sendData
in interface DataBeadReceiver
db
- The DataBead message.this
.public void messageReceived(Bead message)
Bead
messageReceived
in class Bead
message
- the messagepublic CrossoverFilter drawFromLowOutput(UGen target)
public CrossoverFilter drawFromLowOutput(int channel, UGen target, int targetInputIndex)
public CrossoverFilter drawFromHighOutput(UGen target)
public CrossoverFilter drawFromHighOutput(int channel, UGen target, int targetInputIndex)