Sets the attack, decay, sustain, and release times of the envelope.
Syntax
setADSR(attack, decay, sustain, release)
Parameters
attack
Number: how quickly the envelope reaches the maximum level
decay
Number: how quickly the envelope reaches the sustain level
sustain
Number: how long the envelope stays at the decay level
release
Number: how quickly the envelope fades out after the sustain level
Notice any errors or typos? Please let us know. Please feel free to edit src/effects/Envelope.js and open a pull request!
Related References
getAudioContext
Get the window's audio context.
setAudioContext
Sets the AudioContext to a specified context to enable cross library compatibility.
userStartAudio
starts audio processing in the window when called from a user interaction (such as mousePressed()).
userStopAudio
stops audio processing in the browser window.