Optionaloptions: RecursivePartial<MembraneSynthOptions>the options available for the synth see defaults
ReadonlycontextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
ReadonlydetuneThe detune signal
ReadonlyenvelopeThe envelope
ReadonlyfrequencyThe frequency signal
The instrument only has an output
ReadonlynameThe name of the class
The number of octaves the pitch envelope ramps.
Invoked when the release has finished and the output is silent.
ReadonlyoscillatorThe oscillator.
The output nodes. If the object is a sink, it does not have any output and this.output is undefined.
The amount of time the frequency envelope takes.
ReadonlyportamentoPortamento is ignored in this synth. use pitch decay instead.
The volume of the output in decibels.
StaticversionThe version number semver
channelCount is the number of channels used when up-mixing and down-mixing connections to any inputs to the node. The default value is 2 except for specific nodes where its value is specially determined.
channelCountMode determines how channels will be counted when up-mixing and down-mixing connections to any inputs to the node. The default value is "max". This attribute has no effect for nodes with no inputs.
channelInterpretation determines how individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node. The default value is "speakers".
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The duration in seconds of one sample.
Connect the output of this node to the rest of the nodes in series.
const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/handdrum-loop.mp3");
player.autostart = true;
const filter = new Tone.AutoFilter(4).start();
const distortion = new Tone.Distortion(0.5);
// connect the player to the filter, distortion and then to the master output
player.chain(filter, distortion, Tone.Destination);
connect the output of a ToneAudioNode to an AudioParam, AudioNode, or ToneAudioNode
The output to connect to
The output to connect from
The input to connect to
disconnect the output
Optionaldestination: InputNodeclean up
connect the output of this node to the rest of the nodes in parallel.
const player = new Tone.Player("https://tonejs.github.io/audio/drum-samples/conga-rhythm.mp3");
player.autostart = true;
const pitchShift = new Tone.PitchShift(4).toDestination();
const filter = new Tone.Filter("G5").toDestination();
// connect a node to the pitch shift and filter in parallel
player.fan(pitchShift, filter);
Get the object's attributes.
Set multiple properties at once with an object.
Set the note at the given time. If no time is given, the note will set immediately.
The note to change to.
Optionaltime: Unit.TimeThe time when the note should be set.
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();
Convert the incoming time to seconds. This is calculated against the current TransportInstance bpm
Trigger the attack of the note optionally with a given velocity.
The note to trigger.
Optionaltime: Unit.TimeWhen the note should start.
The velocity determines how "loud" the note will be.
Unsync the instrument from the Transport
Staticget
MembraneSynth makes kick and tom sounds using a single oscillator with an amplitude envelope and frequency ramp. A Tone.OmniOscillator is routed through a Tone.AmplitudeEnvelope to the output. The drum quality of the sound comes from the frequency envelope applied during MembraneSynth.triggerAttack(note). The frequency envelope starts at
note * .octavesand ramps tonoteover the duration of.pitchDecay.Example