Skip to content
Tone.js

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.

new BiquadFilter(frequency?: Frequency, type?: BiquadFilterType)

Parameters

  • frequency Frequency optional

    The cutoff frequency of the filter.

  • type BiquadFilterType optional

    The type of filter.

new BiquadFilter(options?: Partial<BiquadFilterOptions>)

Parameters

read-only

detune: Param<"cents">

A detune value, in cents, for the 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: BiquadFilterNode

The input node or nodes. If the object is a source, it does not have any input and this.input is undefined.

read-only

name: string

The name of the class

Default: "BiquadFilter"

read-only

output: BiquadFilterNode

The 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: BiquadFilterType

The type of this BiquadFilterNode. For a complete list of types and their attributes, see the Web Audio API

dispose(): this

Dispose and disconnect

Returns this

getFrequencyResponse(len?: number): Float32Array

Get the frequency response curve. This curve represents how the filter responses to frequencies between 20hz-20khz.

Parameters

  • len number optional default 128

    The number of values to return

Returns Float32Array The frequency response curve between 20-20kHz

static

getDefaults(): BiquadFilterOptions

Returns all of the default options belonging to the class.

Returns BiquadFilterOptions