Skip to content
Tone.js

DestinationInstance

interface Core ↳ extends ToneAudioNode<DestinationOptions>

A single master output that is connected to the AudioDestinationNode (i.e. your speakers).

It provides useful conveniences, such as the ability to set the volume and mute the entire application.

It also gives you the ability to apply master effects to your application.

const oscillator = new Tone.Oscillator().start();
// The audio will go from the oscillator to the speakers.
oscillator.connect(Tone.getDestination());
// A convenience for connecting to the master output is also provided:
oscillator.toDestination();
input: Volume

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

output: Gain

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

volume: Param<"decibels">

The volume of the master output in decibels.

-Infinity is silent, and 0 is no change.

const osc = new Tone.Oscillator().toDestination();
osc.start();
// Ramp the volume down to silent over 10 seconds.
Tone.getDestination().volume.rampTo(-Infinity, 10);

read-only

maxChannelCount: number

The maximum number of channels the system can output.

console.log(Tone.Destination.maxChannelCount);
mute: boolean

Mute the output.

const oscillator = new Tone.Oscillator().start().toDestination();
setTimeout(() => {
	// Mute the output.
	Tone.Destination.mute = true;
}, 1000);
chain(...args: (AudioNode | ToneAudioNode<ToneWithContextOptions>)[]): this

Add a master effects chain.

NOTE: This will disconnect any nodes that were previously chained in the master effects chain.

// Route all audio through a filter and compressor.
const lowpass = new Tone.Filter(800, "lowpass");
const compressor = new Tone.Compressor(-18);
Tone.Destination.chain(lowpass, compressor);

Parameters

Returns this

dispose(): this

Clean up

Returns this