Skip to content

Audio.MultiStageEnvelope

Name Mandatory Description Default Type
⬅️ Input Gate signal where > 0 is gate on, <= 0 is gate off. Audio
Output ➡️ Envelope values from 0.0 to 1.0. Audio
Stages No Sequence of [level, time, curve] stages. Each stage defines target level, time to reach it, and curve shape (-1=log, 0=linear, 1=exp). none [Float3]
SustainIndex No Index of stage to sustain at until gate off (-1 for one-shot, no sustain). -1 IntVar(Int)
Release No Sequence of [level, time, curve] stages for release phase after gate off. none [Float3]
Loop No If true, loop through stages (excluding release) for LFO-like behavior. false BoolVar(Bool)
LoopStart No Stage index to loop back to (default 0). 0 IntVar(Int)

Multi-stage envelope generator with unlimited stages and per-stage curve control. Each stage is defined as [level, time, curve] where curve ranges from -1 (logarithmic) through 0 (linear) to 1 (exponential). Supports sustain at any stage, looping for LFO-like behavior, and separate release stages. Retriggering from any phase restarts attack from current level (no discontinuities). Parameters can be changed dynamically. Note: Stage times should be >= 0.001 seconds to avoid clicks. When looping, ensure the final stage level matches the loop start level for smooth transitions.