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();Constructor
Section titled “Constructor”new Convolver(url?: string | ToneAudioBuffer | AudioBuffer, onload?: () => void)Parameters
-
url
string | ToneAudioBuffer | AudioBufferoptionalThe URL of the impulse response or the ToneAudioBuffer containing the impulse response.
-
onload
() => voidoptionalThe callback to invoke when the url is loaded.
new Convolver(options?: Partial<ConvolverOptions>)Parameters
- options
Partial<ConvolverOptions>optional
Properties
Section titled “Properties”read-only
input: GainThe 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: GainThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
normalize
Section titled “normalize”normalize: booleanThe 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.
Methods
Section titled “Methods”load()
Section titled “load()”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
stringThe url of the buffer to load. filetype support depends on the browser.
Returns Promise<void>
getDefaults()
Section titled “getDefaults()”static
getDefaults(): ConvolverOptionsReturns all of the default options belonging to the class.
Returns ConvolverOptions
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()