Play tells the MonoSynth to start playing a note. This method schedules the calling of .triggerAttack and .triggerRelease.
Examples
Syntax
play(note, [velocity], [secondsFromNow], [sustainTime])
Parameters
note
String | Number:
the note you want to play, specified as a frequency in Hertz (Number) or as a midi value in Note/Octave format ("C4", "Eb3"...etc") See Tone. Defaults to 440 hz.
velocity
Number:
velocity of the note to play (ranging from 0 to 1)
secondsFromNow
Number:
time from now (in seconds) at which to play
sustainTime
Number:
time to sustain before releasing the envelope. Defaults to 0.15 seconds.
Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!