|
Gin
|
Envelope follower for dynamics processing. More...
#include <gin_dynamics.h>
Public Types | |
| enum | Mode { peak , ms , rms } |
| Envelope detection modes. More... | |
Public Member Functions | |
| EnvelopeDetector ()=default | |
| ~EnvelopeDetector ()=default | |
| void | setSampleRate (double f) |
| void | setParams (float attackS, float holdS, float releaseS, bool analogTC, Mode detect, bool logDetector) |
| void | setRMSWindow (float seconds) |
| Averaging window for the ms and rms modes, in seconds. | |
| void | reset () |
| float | process (float input) |
Protected Member Functions | |
| void | setAttackTime (float attackS) |
| void | setHoldTime (float holdS) |
| void | setReleaseTime (float releaseS) |
Protected Attributes | |
| double | sampleRate = 44100.0 |
| Mode | mode = peak |
| float | attackTime = 0.0f |
| float | releaseTime = 0.0f |
| float | envelope = 0.0 |
| float | holdTime = 0.0f |
| float | holdRemaining = 0.0f |
| bool | analogTC = false |
| bool | logDetector = false |
| float | rmsWindow = 0.010f |
| float | rmsA = 1.0f |
| float | rmsB = 0.0f |
| float | rmsState = 0.0f |
Envelope follower for dynamics processing.
EnvelopeDetector tracks the amplitude envelope of an audio signal using configurable attack, hold, and release times. It supports multiple detection modes (peak, mean-square, RMS) and can use analog-style or digital time constants for natural or precise envelope following.
Key Features:
The envelope detector is the core component for gain reduction calculations in dynamics processors, providing a smooth representation of signal level over time.
Envelope detection modes.
Determines how the input signal is converted to an envelope value:
| Enumerator | |
|---|---|
| peak | Peak detection (absolute value) |
| ms | Mean square detection. |
| rms | RMS (root mean square) detection. |
|
default |
|
default |
References rmsWindow, sampleRate, and setRMSWindow().
| void EnvelopeDetector::setParams | ( | float | attackS, |
| float | holdS, | ||
| float | releaseS, | ||
| bool | analogTC, | ||
| Mode | detect, | ||
| bool | logDetector | ||
| ) |
Averaging window for the ms and rms modes, in seconds.
This is what makes RMS detection mean anything: the squared input is averaged over the window before the attack and release stages see it, so the detector responds to how much energy is in the signal rather than to individual samples. Short windows (1 ms) approach peak detection, long ones (50 ms+) ignore transients almost entirely, which is the loudness-following behaviour a bus compressor wants.
Has no effect in peak mode.
Referenced by setSampleRate().
| void EnvelopeDetector::reset | ( | ) |
|
protected |
Referenced by setSampleRate().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by setSampleRate().
|
protected |
|
protected |
|
protected |