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();
Properties
Section titled “Properties”input: VolumeThe 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”output: GainThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
volume
Section titled “volume”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);
maxChannelCount
Section titled “maxChannelCount”read-only
maxChannelCount: numberThe maximum number of channels the system can output.
console.log(Tone.Destination.maxChannelCount);
mute: booleanMute the output.
const oscillator = new Tone.Oscillator().start().toDestination();
setTimeout(() => {
// Mute the output.
Tone.Destination.mute = true;
}, 1000);Methods
Section titled “Methods”chain()
Section titled “chain()”chain(...args: (AudioNode | ToneAudioNode<ToneWithContextOptions>)[]): thisAdd 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
-
args
(AudioNode | ToneAudioNode<ToneWithContextOptions>)[]All arguments will be connected in a row, and the master output will be routed through it.
Returns this
Inherited members
Section titled “Inherited members”- From
ToneWithContext: context, blockTime, sampleTime, get(), immediate(), now(), set(), toFrequency(), toSeconds(), toTicks() - From
Tone: debug, disposed, toString() - From
ToneAudioNode: channelCount, channelCountMode, channelInterpretation, numberOfInputs, numberOfOutputs, connect(), disconnect(), fan(), toDestination(), toMaster()