Reference play()

play()

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.

This page is generated from the comments in lib/addons/p5.sound.js . Please feel free to edit it and submit a pull request!

Related References