Class for calculating values based off of an ADSR Envelope.
ADSR Envelopes are treated as percentages, with 1.0 (100%) as the value of the peak, and 0.0 for the value of nil. This is intended to allow for easy usage of lerp functions.
Returns the time (in milliseconds) that it takes the envelope to go from nil to peak.
50 Copy
50
Sets the time (in milliseconds) for the envelope's attack value.
Value must be equal or greater than zero.
Returns the time (in milliseconds) that it takes the envelope to go from peak to it's sustain level.
100 Copy
100
Sets the time (in milliseconds) for the envelope's decay value.
Returns the time (in milleseconds) that it takes the envelope to go from the sustain level to nil.
300 Copy
300
Sets the time (in milleseconds) for the envelope's release value.
Returns the sustain level of the envelope.
Sustain level is stored as a percentage, specifically as a number between 0.0 and 1.0 (both inclusive).
0.5 Copy
0.5
Sets the sustain level of the envelope.
Value must be between 0.0 and 1.0 (both inclusive).
Calculates a level given the current parameters of a note.
If the note being checked is currently active.
The time since the note was last turned on/off.
TimeSinceStateChange must be equal or greater than zero.
Class for calculating values based off of an ADSR Envelope.
ADSR Envelopes are treated as percentages, with 1.0 (100%) as the value of the peak, and 0.0 for the value of nil. This is intended to allow for easy usage of lerp functions.