PluckSynth
class Instrument ↳ extends Instrument<PluckSynthOptions>
Karplus-Strong string synthesis.
const plucky = new Tone.PluckSynth().toDestination();
plucky.triggerAttack("C4", "+0.5");
plucky.triggerAttack("C3", "+1");
plucky.triggerAttack("C2", "+1.5");
plucky.triggerAttack("C1", "+2");Constructor
Section titled “Constructor”new PluckSynth(options?: RecursivePartial<PluckSynthOptions>)Parameters
- options
RecursivePartial<PluckSynthOptions>optional
Properties
Section titled “Properties”attackNoise
Section titled “attackNoise”attackNoise: numberThe amount of noise at the attack. Nominal range of [0.1, 20]
Range: 0.1 to 20
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.
release
Section titled “release”release: TimeThe release time which corresponds to a resonance ramp down to 0
resonance
Section titled “resonance”resonance: numberThe amount of resonance of the pluck. Also correlates to the sustain duration.
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);dampening
Section titled “dampening”dampening: FrequencyThe dampening control. i.e. the lowpass filter frequency of the comb filter
Range: 0 to 7000
Methods
Section titled “Methods”sync()
Section titled “sync()”↳ inherited from Instrument
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
triggerAttackRelease()
Section titled “triggerAttackRelease()”↳ inherited from Instrument
Trigger the attack and then the release after the duration.
const synth = new Tone.Synth().toDestination();
// trigger "C4" for the duration of an 8th note
synth.triggerAttackRelease("C4", "8n");Parameters
Returns this
triggerRelease()
Section titled “triggerRelease()”triggerRelease(time?: Time): thisRamp down the resonance to 0 over the duration of the release time.
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(): PluckSynthOptionsReturns all of the default options belonging to the class.
Returns PluckSynthOptions
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()