|
| | TriggeredEnvelope () noexcept |
| |
| void | prepare (double sampleRate) noexcept |
| | Prepares for a sample rate (invalid rates are ignored).
|
| |
| void | setDelay (T ms) noexcept |
| | Delay before the attack, in ms (>= 0; non-finite ignored).
|
| |
| void | setAttack (T ms) noexcept |
| | Attack, 0 to 1, in ms.
|
| |
| void | setHold (T ms) noexcept |
| | Hold at the top, in ms.
|
| |
| void | setDecay (T ms) noexcept |
| | Decay, 1 to the sustain, in ms.
|
| |
| void | setRelease (T ms) noexcept |
| | Release, full scale to 0, in ms (from a lower value it arrives earlier).
|
| |
| void | setTimes (T delayMs, T attackMs, T holdMs, T decayMs, T releaseMs) noexcept |
| | All five times at once, in ms.
|
| |
| void | setSustain (T level) noexcept |
| | The sustain level, 0..1 (non-finite ignored). During the decay the rest of the decay bends to it; during the sustain the output moves to it at the decay's pace.
|
| |
| void | setCurves (T attack, T decay, T release) noexcept |
| | The curves of the attack, the decay and the release, -1 (slow start) to 1 (fast start), 0 straight (non-finite ignored). A curve that changes in the middle of its stage keeps the output where it is.
|
| |
| void | setBipolar (bool on) noexcept |
| | Output centred on the sustain (see the file notes).
|
| |
| bool | isBipolar () const noexcept |
| |
| void | setTrigger (Trigger trigger) noexcept |
| | Notes (noteOn()/noteOff()) or the audio of the key signal.
|
| |
| Trigger | getTrigger () const noexcept |
| |
| void | setThresholdDb (T db) noexcept |
| | Level of the key above which the audio trigger starts the envelope, in dB (non-finite ignored).
|
| |
| void | setHysteresisDb (T db) noexcept |
| | How far below the threshold the key must fall to let go, in dB (0..40; 6 by default).
|
| |
| void | setReleaseWaitMs (T ms) noexcept |
| | How long the key must stay below that before the release, in ms (>= 0; 50 by default).
|
| |
| void | noteOn () noexcept |
| | Starts the envelope (from where the output is).
|
| |
| void | noteOff () noexcept |
| | Lets the envelope go to its release (from where the output is).
|
| |
| void | reset () noexcept |
| | Back to rest at 0, the trigger disarmed.
|
| |
| Stage | getStage () const noexcept |
| |
| T | getValue () const noexcept |
| | The envelope now, 0..1 (before the bipolar mapping).
|
| |
| bool | isActive () const noexcept |
| |
| T | process (T key=T(0)) noexcept |
| | One sample: the key (read by the audio trigger), then the output.
|
| |
| void | processBlock (const T *key, T *out, int numSamples) noexcept |
| | A block: key drives the audio trigger (may be null with the note trigger), the envelope goes to out.
|
| |
template<FloatType T>
class dspark::TriggeredEnvelope< T >
DAHDSR envelope with bending curves, triggered by notes or by audio.
env.
setTimes(0.0f, 5.0f, 20.0f, 150.0f, 300.0f);
DAHDSR envelope with bending curves, triggered by notes or by audio.
void processBlock(const T *key, T *out, int numSamples) noexcept
A block: key drives the audio trigger (may be null with the note trigger), the envelope goes to out.
void setThresholdDb(T db) noexcept
Level of the key above which the audio trigger starts the envelope, in dB (non-finite ignored).
void setSustain(T level) noexcept
The sustain level, 0..1 (non-finite ignored). During the decay the rest of the decay bends to it; dur...
void prepare(double sampleRate) noexcept
Prepares for a sample rate (invalid rates are ignored).
void setTrigger(Trigger trigger) noexcept
Notes (noteOn()/noteOff()) or the audio of the key signal.
void setTimes(T delayMs, T attackMs, T holdMs, T decayMs, T releaseMs) noexcept
All five times at once, in ms.
- Template Parameters
-
| T | Sample type (float or double). The phases are double. |
Definition at line 70 of file TriggeredEnvelope.h.