Skip to content
Tone.js

Convolver

class Component ↳ extends ToneAudioNode<ConvolverOptions>

Convolver is a wrapper around the Native Web Audio ConvolverNode. Convolution is useful for reverb and filter emulation. Read more about convolution reverb on Wikipedia.

// initializing the convolver with an impulse response
const convolver = new Tone.Convolver("./path/to/ir.wav").toDestination();
new Convolver(url?: string | ToneAudioBuffer | AudioBuffer, onload?: () => void)

Parameters

  • url string | ToneAudioBuffer | AudioBuffer optional

    The URL of the impulse response or the ToneAudioBuffer containing the impulse response.

  • onload () => void optional

    The callback to invoke when the url is loaded.

new Convolver(options?: Partial<ConvolverOptions>)

Parameters

read-only

input: Gain

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: "Convolver"

read-only

output: Gain

The output nodes. If the object is a sink, it does not have any output and this.output is undefined.

buffer: ToneAudioBuffer | null

The convolver’s buffer

normalize: boolean

The normalize property of the ConvolverNode interface is a boolean that controls whether the impulse response from the buffer will be scaled by an equal-power normalization when the buffer attribute is set, or not.

dispose(): this

Dispose and disconnect

Returns this

load(url: string): Promise<void>

Load an impulse response url as an audio buffer. Decodes the audio asynchronously and invokes the callback once the audio buffer loads.

Parameters

  • url string

    The url of the buffer to load. filetype support depends on the browser.

Returns Promise<void>

static

getDefaults(): ConvolverOptions

Returns all of the default options belonging to the class.

Returns ConvolverOptions