|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
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 | getEnvelopeNormalized (int channel=0, T floorDb=T(-60)) 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 65 of file EnvelopeFollower.h.
|
strong |
|
inlinenoexcept |
Definition at line 71 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 251 of file EnvelopeFollower.h.
|
inlinenoexcept |
channel as linear amplitude. Definition at line 212 of file EnvelopeFollower.h.
|
inlinenoexcept |
channel in dBFS (floor -120 dB). Definition at line 230 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 220 of file EnvelopeFollower.h.
|
inlinenoexcept |
channel in decibels mapped to 0..1: 0 at floorDb and under it, 1 at 0 dBFS and over it (a modulation source that moves evenly in level). | channel | The channel to read. |
| floorDb | The level that reads 0 (-120 to -1 dBFS; default -60). |
Definition at line 243 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 263 of file EnvelopeFollower.h.
|
inlinenoexcept |
Definition at line 257 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 82 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 141 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 192 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 99 of file EnvelopeFollower.h.
|
inlinenoexcept |
Attack time in milliseconds (default 10, floor 0.01; non-finite values are ignored).
Definition at line 109 of file EnvelopeFollower.h.
|
inlinenoexcept |
Peak (default) or RMS detection. Out-of-range values clamp.
Definition at line 128 of file EnvelopeFollower.h.
|
inlinenoexcept |
Release time in milliseconds (default 150, floor 0.01; non-finite values are ignored).
Definition at line 119 of file EnvelopeFollower.h.