Reference play()

play()

Play a note by triggering noteAttack and noteRelease with sustain time

Examples

Syntax

play([note], [velocity], [secondsFromNow], [sustainTime])

Parameters

note
Number:

midi note to play (ranging from 0 to 127 - 60 being a middle C)

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

Notice any errors or typos? Please let us know. Please feel free to edit lib/addons/p5.sound.js and open a pull request!

Related References