Linear ADSR envelope generator optimized for modulation sources.
ADSR provides a simple, linear envelope generator with attack, decay, sustain, and release stages. Unlike AnalogADSR which uses exponential curves for audio, this class uses linear ramps making it ideal for modulation sources (LFO depth, filter cutoff, etc.) where linear response is often preferred.
Key Features:
- Linear attack, decay, and release stages
- Constant sustain level while note is held
- Per-sample or block processing
- State tracking for envelope phase
- Can fill buffer with envelope values
Envelope Stages:
- Attack: Linear rise from 0 to 1
- Decay: Linear fall from 1 to sustain level
- Sustain: Held at sustain level while note is on
- Release: Linear fall from current level to 0
Usage:
Linear ADSR envelope generator optimized for modulation sources.
Definition gin_adsr.h:56
void setAttack(float seconds)
void noteOn()
Definition gin_adsr.h:104
void noteOff()
Definition gin_adsr.h:105
void setRelease(float seconds)
void setDecay(float seconds)
void setSampleRate(double sr)
Definition gin_adsr.h:71
void setSustainLevel(float level)
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
- See also
- AnalogADSR