|
Gin
|
Analog-modeled ADSR envelope generator for smooth, musical envelopes. More...
#include <gin_analogadsr.h>
Public Types | |
| enum class | State { idle , attack , decay , sustain , release } |
Public Member Functions | |
| AnalogADSR () | |
| ~AnalogADSR ()=default | |
| void | setSampleRate (double sr) |
| float | process () |
| float | process (int num) |
| void | process (juce::AudioSampleBuffer &buffer) |
| void | process (juce::AudioSampleBuffer &buffer, int startSample, int numSamples) |
| void | processMultiplying (juce::AudioSampleBuffer &buffer) |
| void | processMultiplying (juce::AudioSampleBuffer &buffer, int startSample, int numSamples) |
| float | getOutput () |
| State | getState () |
| void | noteOn () |
| void | noteOff () |
| void | setAttack (float seconds) |
| void | setDecay (float seconds) |
| void | setRelease (float seconds) |
| void | setSustainLevel (float level) |
| void | reset () |
| std::pair< int, float > | getCurrentPhase () |
Protected Member Functions | |
| void | calculateAttack () |
| void | calculateDecay () |
| void | calculateRelease () |
Protected Attributes | |
| State | state = State::idle |
| double | sampleRate = 44100.0 |
| float | attack = 0.0f |
| float | decay = 0.0f |
| float | sustain = 0.0f |
| float | release = 0.0f |
| float | attackCoeff = 0.0f |
| float | decayCoeff = 0.0f |
| float | releaseCoeff = 0.0f |
| float | attackOffset = 0.0f |
| float | decayOffset = 0.0f |
| float | releaseOffset = 0.0f |
| float | output = 0.0f |
Analog-modeled ADSR envelope generator for smooth, musical envelopes.
AnalogADSR provides an envelope generator that emulates the behavior of analog synthesizer envelopes with smooth, exponential curves. It's ideal for controlling audio levels (amplitude envelopes) and produces more natural-sounding results than linear envelopes.
Based on the ADSR implementation from Will Pirkle's book "Designing Software Synthesizer Plug-Ins in C++".
Key Features:
Envelope Stages:
Usage:
|
strong |
| AnalogADSR::AnalogADSR | ( | ) |
|
default |
References sampleRate.
Referenced by GateEffect::setSampleRate().
| float AnalogADSR::process | ( | ) |
Referenced by GateEffect::process().
| void AnalogADSR::process | ( | juce::AudioSampleBuffer & | buffer | ) |
| void AnalogADSR::processMultiplying | ( | juce::AudioSampleBuffer & | buffer | ) |
| void AnalogADSR::processMultiplying | ( | juce::AudioSampleBuffer & | buffer, |
| int | startSample, | ||
| int | numSamples | ||
| ) |
| void AnalogADSR::noteOn | ( | ) |
Referenced by GateEffect::process().
| void AnalogADSR::noteOff | ( | ) |
Referenced by GateEffect::process().
Referenced by GateEffect::setAttack().
Referenced by GateEffect::GateEffect().
Referenced by GateEffect::setRelease().
Referenced by GateEffect::GateEffect().
| void AnalogADSR::reset | ( | ) |
Referenced by GateEffect::reset().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getCurrentPhase(), and getState().
|
protected |
Referenced by setSampleRate().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by getCurrentPhase(), and getOutput().