Skip to content
Tone.js

NoiseSynth

class Instrument ↳ extends Instrument<NoiseSynthOptions>

Tone.NoiseSynth is composed of Noise through an AmplitudeEnvelope.

+-------+ +-------------------+
| Noise +>--> AmplitudeEnvelope +>--> Output
+-------+ +-------------------+
const noiseSynth = new Tone.NoiseSynth().toDestination();
noiseSynth.triggerAttackRelease("8n", 0.05);
new NoiseSynth(options?: RecursivePartial<NoiseSynthOptions>)

Parameters

read-only

The amplitude envelope.

↳ inherited from Instrument

input: undefined

The instrument only has an output

read-only

name: "NoiseSynth"

The name of the class

Default: "NoiseSynth"

read-only

noise: Noise

The noise source.

↳ inherited from Instrument

output: OutputNode

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

↳ inherited from Instrument

volume: Param<"decibels">

The volume of the output in decibels.

const amSynth = new Tone.AMSynth().toDestination();
amSynth.volume.value = -6;
amSynth.triggerAttackRelease("G#3", 0.2);
dispose(): this

clean up

Returns this this

sync(): this

Sync the instrument to the Transport. All subsequent calls of triggerAttack and triggerRelease will be scheduled along the transport.

const fmSynth = new Tone.FMSynth().toDestination();
fmSynth.volume.value = -6;
fmSynth.sync();
// schedule 3 notes when the transport first starts
fmSynth.triggerAttackRelease("C4", "8n", 0);
fmSynth.triggerAttackRelease("E4", "8n", "8n");
fmSynth.triggerAttackRelease("G4", "8n", "4n");
// start the transport to hear the notes
Tone.Transport.start();

Returns this

triggerAttack(time?: Time, velocity?: number): this

Start the attack portion of the envelopes. Unlike other instruments, Tone.NoiseSynth doesn’t have a note.

const noiseSynth = new Tone.NoiseSynth().toDestination();
noiseSynth.triggerAttack();

Parameters

  • time Time optional
  • velocity number optional default 1

Returns this

triggerAttackRelease(duration: Time, time?: Time, velocity?: number): this

Trigger the attack and then the release after the duration.

const noiseSynth = new Tone.NoiseSynth().toDestination();
// hold the note for 0.5 seconds
noiseSynth.triggerAttackRelease(0.5);

Parameters

  • duration Time

    The amount of time to hold the note for

  • time Time optional

    The time the note should start

  • velocity number optional default 1

    The volume of the note (0-1)

Returns this

triggerRelease(time?: Time): this

Start the release portion of the envelopes.

Parameters

  • time Time optional

Returns this

↳ inherited from Instrument

unsync(): this

Unsync the instrument from the Transport

Returns this

static

getDefaults(): NoiseSynthOptions

Returns all of the default options belonging to the class.

Returns NoiseSynthOptions