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);Constructor
Section titled “Constructor”new NoiseSynth(options?: RecursivePartial<NoiseSynthOptions>)Parameters
- options
RecursivePartial<NoiseSynthOptions>optional
Properties
Section titled “Properties”output
Section titled “output”↳ inherited from Instrument
output: OutputNodeThe output nodes. If the object is a sink, it does not have any output and this.output is undefined.
volume
Section titled “volume”↳ 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);Methods
Section titled “Methods”sync()
Section titled “sync()”sync(): thisSync 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()
Section titled “triggerAttack()”triggerAttack(time?: Time, velocity?: number): thisStart 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
Timeoptional - velocity
numberoptional default1
Returns this
triggerAttackRelease()
Section titled “triggerAttackRelease()”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
Returns this
triggerRelease()
Section titled “triggerRelease()”triggerRelease(time?: Time): thisStart the release portion of the envelopes.
Parameters
- time
Timeoptional
Returns this
unsync()
Section titled “unsync()”↳ inherited from Instrument
unsync(): thisUnsync the instrument from the Transport
Returns this
getDefaults()
Section titled “getDefaults()”static
getDefaults(): NoiseSynthOptionsReturns all of the default options belonging to the class.
Returns NoiseSynthOptions
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()