Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class BiquadFilterNode

  1. Object
  2. AudioNode
  3. BiquadFilterNode
A second order filter, the Web Audio BiquadFilterNode: low and high pass, band pass, shelves, peaking, notch and all pass. Coefficients follow the specification’s formulas and are recomputed per sample only while a parameter changes. The output has the input’s channel count.

Methods

public AudioParam getFrequency()The cutoff or center frequency in Hz, 350 by default.
public AudioParam getDetune()A detune of the frequency in cents, 0 by default.
public AudioParam getQ()The quality factor, 1 by default: resonance in dB for low and high pass, width for band pass, peaking, notch and all pass.
public AudioParam getGain()The boost in dB for the shelves and peaking, 0 by default.
public BiquadFilterType getType()The filter type.
public void setType(BiquadFilterType type)Sets the filter type.
public void getFrequencyResponse(float[] frequencyHz, float[] magResponse, float[] phaseResponse)Computes the response of the filter, with the parameters’ current values, at each of frequencyHz.

Inherited methods

Method details

getFrequency

public AudioParam getFrequency()
The cutoff or center frequency in Hz, 350 by default.

Returns

the parameter

getDetune

public AudioParam getDetune()
A detune of the frequency in cents, 0 by default.

Returns

the parameter

getQ

public AudioParam getQ()
The quality factor, 1 by default: resonance in dB for low and high pass, width for band pass, peaking, notch and all pass. Unused by the shelves.

Returns

the parameter

getGain

public AudioParam getGain()
The boost in dB for the shelves and peaking, 0 by default.

Returns

the parameter

getType

public BiquadFilterType getType()
The filter type.

Returns

the type

setType

public void setType(BiquadFilterType type)
Sets the filter type.

Parameters

type BiquadFilterType
the type

getFrequencyResponse

public void getFrequencyResponse(float[] frequencyHz, float[] magResponse, float[] phaseResponse)
Computes the response of the filter, with the parameters’ current values, at each of frequencyHz.

Parameters

frequencyHz float[]
the frequencies to evaluate
magResponse float[]
receives the linear magnitude at each frequency
phaseResponse float[]
receives the phase in radians at each frequency