BiquadFilter
class Component ↳ extends ToneAudioNode<BiquadFilterOptions>
Thin wrapper around the native Web Audio BiquadFilterNode. BiquadFilter is similar to Filter but doesn’t have the option to set the “rolloff” value.
Constructor
Section titled “Constructor”new BiquadFilter(frequency?: Frequency, type?: BiquadFilterType)Parameters
-
frequency
FrequencyoptionalThe cutoff frequency of the filter.
-
type
BiquadFilterTypeoptionalThe type of filter.
new BiquadFilter(options?: Partial<BiquadFilterOptions>)Parameters
- options
Partial<BiquadFilterOptions>optional
Properties
Section titled “Properties”detune
Section titled “detune”read-only
detune: Param<"cents">A detune value, in cents, for the frequency.
frequency
Section titled “frequency”read-only
frequency: Param<"frequency">The frequency of the filter
read-only
gain: Param<"decibels">The gain of the filter. Its value is in dB units. The gain is only used for lowshelf, highshelf, and peaking filters.
read-only
input: BiquadFilterNodeThe input node or nodes. If the object is a source, it does not have any input and this.input is undefined.
output
Section titled “output”read-only
output: BiquadFilterNodeThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
read-only
Q: Param<"number">The Q factor of the filter. For lowpass and highpass filters the Q value is interpreted to be in dB. For these filters the nominal range is [−𝑄𝑙𝑖𝑚,𝑄𝑙𝑖𝑚] where 𝑄𝑙𝑖𝑚 is the largest value for which 10𝑄/20 does not overflow. This is approximately 770.63678. For the bandpass, notch, allpass, and peaking filters, this value is a linear value. The value is related to the bandwidth of the filter and hence should be a positive value. The nominal range is [0,3.4028235𝑒38], the upper limit being the most-positive-single-float. This is not used for the lowshelf and highshelf filters.
type: BiquadFilterTypeThe type of this BiquadFilterNode. For a complete list of types and their attributes, see the Web Audio API
Methods
Section titled “Methods”getFrequencyResponse()
Section titled “getFrequencyResponse()”getFrequencyResponse(len?: number): Float32ArrayGet the frequency response curve. This curve represents how the filter responses to frequencies between 20hz-20khz.
Parameters
-
len
numberoptional default128The number of values to return
Returns Float32Array The frequency response curve between 20-20kHz
getDefaults()
Section titled “getDefaults()”static
getDefaults(): BiquadFilterOptionsReturns all of the default options belonging to the class.
Returns BiquadFilterOptions
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, version, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, chain(), connect(), disconnect(), fan(), toDestination(), toMaster()