|
| void | prepare (const AudioSpec &spec) noexcept |
| | Prepares the follower for the given audio environment.
|
| |
| void | setAttackMs (float ms) noexcept |
| | Sets the attack time for peak metering.
|
| |
| void | setReleaseMs (float ms) noexcept |
| | Sets the release time for peak metering.
|
| |
| void | setRmsWindowMs (float ms) noexcept |
| | Sets the integration time constant for RMS metering.
|
| |
| T | getAttackMs () const noexcept |
| | Returns the peak attack time in milliseconds.
|
| |
| T | getReleaseMs () const noexcept |
| | Returns the peak release time in milliseconds.
|
| |
| T | getRmsWindowMs () const noexcept |
| | Returns the RMS integration time constant in milliseconds.
|
| |
| void | reset () noexcept |
| | Resets all envelope states to zero safely.
|
| |
| void | process (AudioBufferView< const T > buffer) noexcept |
| | Processes a block of audio and updates level tracking.
|
| |
| T | getPeakLevel (int channel) const noexcept |
| | Returns the current peak level for the given channel safely.
|
| |
| T | getRmsLevel (int channel) const noexcept |
| | Returns the current RMS level for the given channel safely.
|
| |
| T | getPeakLevelDb (int channel) const noexcept |
| | Returns the current peak level in decibels.
|
| |
| T | getRmsLevelDb (int channel) const noexcept |
| | Returns the current RMS level in decibels (optimized).
|
| |
template<FloatType T, int MaxChannels = 16>
class dspark::LevelFollower< T, MaxChannels >
Per-channel peak and RMS envelope follower with lock-free readout.
One-pole envelope followers with a branchless attack/release selector in the hot loop (avoids branch mispredictions on noisy program material; the per-sample recursion itself is inherently serial). Channels beyond the prepared count (or beyond MaxChannels) are not metered. A non-finite input sample would stick in the recursions forever, so the published state is sanitized once per block: the meter recovers on the next block instead of reporting NaN until reset().
- Template Parameters
-
| T | Sample type (float or double). |
| MaxChannels | Maximum number of channels supported. |
Definition at line 74 of file LevelFollower.h.
template<FloatType T, int MaxChannels = 16>
Prepares the follower for the given audio environment.
Recomputes coefficients for the new sample rate and resets all envelope states. An invalid spec (non-positive or non-finite fields) is ignored, keeping the previous state.
- Parameters
-
| spec | Audio specification (sample rate, block size, channels). |
Definition at line 86 of file LevelFollower.h.
template<FloatType T, int MaxChannels = 16>
Sets the integration time constant for RMS metering.
The RMS detector is a one-pole exponential integrator over the squared signal; this is its time constant (63% settling on a level step), not the length of a rectangular window.
- Parameters
-
| ms | Time constant in milliseconds (floored to 0.001; non-finite values are ignored). |
Definition at line 133 of file LevelFollower.h.