|
DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
|
Attack/release envelope detector (Peak or RMS). More...
#include <EnvelopeFollower.h>
Public Types | |
| enum class | Mode { Peak , RMS } |
| Detection law. More... | |
Public Member Functions | |
| EnvelopeFollower () noexcept | |
| void | prepare (const AudioSpec &spec) noexcept |
| Prepares the follower. Allocation-free. | |
| void | reset () noexcept |
| Clears all envelopes. | |
| void | setAttack (T ms) noexcept |
| Attack time in milliseconds (default 10, floor 0.01; non-finite values are ignored). | |
| void | setRelease (T ms) noexcept |
| Release time in milliseconds (default 150, floor 0.01; non-finite values are ignored). | |
| void | setMode (Mode m) noexcept |
| Peak (default) or RMS detection. Out-of-range values clamp. | |
| void | processBlock (AudioBufferView< const T > buffer) noexcept |
| Analyzes a block (read-only) and updates per-channel envelopes. | |
| T | processSample (T input) noexcept |
| Single-sample path on channel 0 (for embedding in processors). | |
| T | getEnvelope (int channel=0) const noexcept |
| T | getEnvelopeMax () const noexcept |
| T | getEnvelopeDb (int channel=0) const noexcept |
| T | getAttack () const noexcept |
| T | getRelease () const noexcept |
| Mode | getMode () const noexcept |
Attack/release envelope detector (Peak or RMS).
| T | Sample type (float or double). |
| MaxChannels | Maximum tracked channels. |
Definition at line 55 of file EnvelopeFollower.h.
|
strong |
|
inlinenoexcept |
Definition at line 61 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 227 of file EnvelopeFollower.h.
|
inlinenoexcept |
channel as linear amplitude. Definition at line 202 of file EnvelopeFollower.h.
|
inlinenoexcept |
channel in dBFS (floor -120 dB). Definition at line 220 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 210 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 239 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 233 of file EnvelopeFollower.h.
|
inlinenoexcept |
Prepares the follower. Allocation-free.
An invalid or non-finite specification is ignored (conservative no-op: the previous state is kept). Channels beyond MaxChannels are clamped.
Definition at line 72 of file EnvelopeFollower.h.
|
inlinenoexcept |
Analyzes a block (read-only) and updates per-channel envelopes.
Channels beyond the prepared count are ignored.
Definition at line 131 of file EnvelopeFollower.h.
|
inlinenoexcept |
Single-sample path on channel 0 (for embedding in processors).
Also publishes to the lock-free readout, so getEnvelope() stays coherent with this path.
Definition at line 182 of file EnvelopeFollower.h.
|
inlinenoexcept |
Clears all envelopes.
Allocation-free, but it writes the same plain per-channel state the processing calls own: call it from the stream owner (or with the stream stopped).
Definition at line 89 of file EnvelopeFollower.h.
|
inlinenoexcept |
Attack time in milliseconds (default 10, floor 0.01; non-finite values are ignored).
Definition at line 99 of file EnvelopeFollower.h.
|
inlinenoexcept |
Peak (default) or RMS detection. Out-of-range values clamp.
Definition at line 118 of file EnvelopeFollower.h.
|
inlinenoexcept |
Release time in milliseconds (default 150, floor 0.01; non-finite values are ignored).
Definition at line 109 of file EnvelopeFollower.h.