Creates an Attack Decay Sustain Release envelope (ADSR) for the given AudioNode parameter.
Notice that larger values of time give shorter intervals for the parameter, e.g. a decay time of 10 is shorter than a decay time of 3.
To use purely as attack-decay node, simply leave out the sustain and release parameters.
TODO: The envelope feature should probably be added to individual instruments/plugins.
Parameters:
| Name | Type | Description |
|---|---|---|
param |
AudioParam | The audio parameter to create the envelope for, e.g. frequency for a sine node or gain for a gain node. |
startTime |
int | The start time for the envelope. |
minValue |
float | The minimum value. |
maxValue |
float | The maximum or peak value. |
attack |
int | The attack time. |
decay |
int | The decay time. |
sustainValue |
float | The value for the sustain. |
sustain |
int | The sustain time. |
release |
int | The release time. |
- Source:
Returns:
The end time for the envelope.
- Type
- float