Interactive visual editor for ADSR envelope parameters.
ADSRComponent provides an intuitive graphical interface for editing ADSR (Attack, Decay, Sustain, Release) envelope parameters. Users can drag handles to adjust the envelope shape, with real-time visual feedback and optional phase indication showing the current envelope position.
Key Features:
- Visual envelope curve display
- Draggable handles for Attack, Decay/Sustain, and Release
- Real-time parameter updates while dragging
- Optional phase indicators for showing active voices
- Mouse cursor changes to indicate draggable areas
- Bubble tooltips showing parameter values
The component requires four parameters (attack, decay, sustain, release) and optionally accepts a callback to display current envelope phases for visual feedback during playback.
Usage:
adsrEditor.
setParams(attackParam, decayParam, sustainParam, releaseParam);
adsrEditor.setBounds(0, 0, 300, 150);
std::vector<std::pair<int, float>> phases;
for (auto* voice : activeVoices)
phases.push_back(voice->getEnvelopePhase());
return phases;
};
void setParams(Parameter::Ptr attack, Parameter::Ptr decay, Parameter::Ptr sustain, Parameter::Ptr release)
std::function< std::vector< std::pair< int, float > >()> phaseCallback
Definition gin_adsrcomponent.h:55
- See also
- Parameter, MultiParamComponent, AnalogADSR