DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::Limiter< T > Class Template Reference

High-performance brickwall lookahead limiter. More...

#include <Limiter.h>

Collaboration diagram for dspark::Limiter< T >:

Public Member Functions

 ~Limiter ()=default
 
void prepare (double sampleRate, int numChannels=2, double initialLookaheadMs=-1.0)
 Allocates memory and prepares the limiter for processing.
 
void prepare (const AudioSpec &spec)
 Prepares from AudioSpec (unified API).
 
void processBlock (AudioBufferView< T > buffer) noexcept
 Processes an AudioBufferView in-place.
 
T processSample (T input, int channel) noexcept
 Processes a single sample of one channel.
 
void reset () noexcept
 Resets the internal state (delays, gain reduction). RT-Safe.
 
void setCeiling (T dB) noexcept
 Sets the absolute output ceiling.
 
void setRelease (T ms) noexcept
 Sets the base release time.
 
void setLookahead (T ms) noexcept
 Sets the lookahead time dynamically.
 
void setTruePeak (bool enabled) noexcept
 Enables 4x oversampled ISP true-peak detection. RT-Safe. The attack ramp shortens by the estimator's support (11 samples) so the reduction covers every sample a true-peak reading is formed from.
 
void setAdaptiveRelease (bool enabled) noexcept
 Enables program-dependent adaptive release. RT-Safe.
 
void setHold (T ms) noexcept
 Sets how long the reduction is held after the last peak that asked for it, before the release starts. RT-Safe.
 
T getHold () const noexcept
 
void setSafetyClip (bool enabled) noexcept
 Enables the post-limiter soft-knee safety clipper. RT-Safe.
 
bool isTruePeakEnabled () const noexcept
 
bool isAdaptiveReleaseEnabled () const noexcept
 
bool isSafetyClipEnabled () const noexcept
 
T getLookahead () const noexcept
 
int getLatency () const noexcept
 Reports the processing latency (the lookahead) in samples.
 
T getGainReductionDb () const noexcept
 Current gain reduction in dB (metering).
 
std::vector< uint8_t > getState () const
 Serializes the parameter state (setup/UI threads; allocates).
 
bool setState (const uint8_t *data, size_t size)
 Restores parameters from a blob (tolerant; rejects foreign ids).
 

Protected Member Functions

int lookaheadSamplesFor (T ms) const noexcept
 
void applyLookaheadTarget () noexcept
 
void configureGainComputer () noexcept
 
DSPARK_NOINLINE void resumBoxes () noexcept
 
DSPARK_NOINLINE void restartHoldBlock (int64_t firstFrame) noexcept
 
void resetGainComputer () noexcept
 
void advanceGain (T peak, T ceiling, bool adaptive, T relMs) noexcept
 
void syncParameters () noexcept
 
void updateHoldSamples () noexcept
 
void updateReleaseCoefficient () noexcept
 
T applySafetyClipper (T out, T clipCeil) const noexcept
 

Protected Attributes

TruePeakDetector< T, kMaxChannels > truePeak_
 
bool prepared_ = false
 
double sampleRate_ = 48000.0
 
T invSampleRate_ = T(1.0 / 48000.0)
 
int numChannels_ = 2
 
int lookaheadSamples_ = 96
 Audio-side lookahead (consumed from lookaheadMs_).
 
int maxLimitSamples_ = 96000
 Adaptive-release duration cap (2 s).
 
std::atomic< T > ceilingDb_ { T(-0.3) }
 
std::atomic< T > releaseMs_ { T(100) }
 
std::atomic< T > holdMs_ { T(10) }
 
std::atomic< T > lookaheadMs_ { T(2) }
 
std::atomic< bool > lookaheadDirty_ { false }
 
std::atomic< bool > truePeakEnabled_ { false }
 
std::atomic< bool > adaptiveRelease_ { false }
 
std::atomic< bool > safetyClipEnabled_ { false }
 
SmoothedValue< T > ceilingSmooth_
 
T lastCeilingDb_ = T(-0.3)
 Change detector for the ceiling pow skip.
 
T releaseCoeff_ = T(0)
 
T lastReleaseMs_ = T(-1)
 
T lastHoldMs_ = T(-1)
 
int holdSamples_ = 0
 Hold length in samples.
 
int holdLeft_ = 0
 Hold samples left before the release may act.
 
T currentGain_ = T(1)
 
std::atomic< T > publishedGain_ { T(1) }
 
int limitingDuration_ = 0
 
T lookaheadCurrent_ = T(96)
 Smoothed read offset (glides on live changes).
 
int histSize_ = 0
 
int histMask_ = 0
 
std::vector< double > eHist_
 Released envelope history.
 
std::vector< double > avgHist_
 First moving-average output history.
 
std::vector< double > rHist_
 Required-gain history.
 
std::vector< double > sufMin_
 Suffix minima of the last complete hold block (+1 empty).
 
int blockPos_ = 0
 Position inside the current hold block.
 
double prefixMin_ = 1.0
 Running minimum of the current hold block.
 
int64_t frame_ = 0
 
double envelope_ = 1.0
 
double sum1_ = 1.0
 
double sum2_ = 1.0
 
int boxA_ = 1
 
int boxB_ = 1
 
double invBoxA_ = 1.0
 
double invBoxB_ = 1.0
 
int holdLen_ = 97
 
int sinceResum_ = 0
 
T pendingPeak_ = T(0)
 Other channels' peaks for the next processSample() frame.
 
T chunkPeak_ [kChunk] = {}
 
T chunkCeiling_ [kChunk] = {}
 
T chunkGain_ [kChunk] = {}
 
int chunkLook_ [kChunk] = {}
 
T sampleCeiling_ = T(0.96605)
 
int sampleLookNow_ = 96
 
std::vector< RingBuffer< T > > delayLines_
 

Static Protected Attributes

static constexpr int kMaxChannels = 16
 
static constexpr double kMaxLookaheadMs = 10.0
 
static constexpr T kSafetyClipCeiling = T(0.96605)
 -0.3 dBFS
 
static constexpr int kResumPeriod = 1 << 16
 
static constexpr int kChunk = 128
 

Detailed Description

template<FloatType T>
class dspark::Limiter< T >

High-performance brickwall lookahead limiter.

Template Parameters
TSample type (float or double).

Definition at line 93 of file Limiter.h.

Constructor & Destructor Documentation

◆ ~Limiter()

template<FloatType T>
dspark::Limiter< T >::~Limiter ( )
default

Member Function Documentation

◆ advanceGain()

template<FloatType T>
void dspark::Limiter< T >::advanceGain ( T  peak,
T  ceiling,
bool  adaptive,
T  relMs 
)
inlineprotectednoexcept

One frame of the gain computer; leaves the gain to apply in currentGain_.

Definition at line 642 of file Limiter.h.

◆ applyLookaheadTarget()

template<FloatType T>
void dspark::Limiter< T >::applyLookaheadTarget ( )
inlineprotectednoexcept

Consumes the published lookahead parameter (audio/setup thread).

Definition at line 553 of file Limiter.h.

◆ applySafetyClipper()

template<FloatType T>
T dspark::Limiter< T >::applySafetyClipper ( T  out,
T  clipCeil 
) const
inlineprotectednoexcept

Symmetric soft-knee clipper for the region above the clip threshold, with a hard backstop at 1.05x the threshold.

Definition at line 740 of file Limiter.h.

◆ configureGainComputer()

template<FloatType T>
void dspark::Limiter< T >::configureGainComputer ( )
inlineprotectednoexcept

Sizes the hold window and the two moving averages for the current lookahead / ISP mode and rebuilds their running sums from history.

Definition at line 572 of file Limiter.h.

◆ getGainReductionDb()

template<FloatType T>
T dspark::Limiter< T >::getGainReductionDb ( ) const
inlinenoexcept

Current gain reduction in dB (metering).

Safe from any thread: it loads a published atomic word, so off the audio thread it may be up to one block behind. It used to read currentGain_ directly – a plain word the audio thread writes every sample, read from another thread, which is a data race and not merely an approximate number.

Definition at line 498 of file Limiter.h.

◆ getHold()

template<FloatType T>
T dspark::Limiter< T >::getHold ( ) const
inlinenoexcept
Returns
The hold time in milliseconds.

Definition at line 462 of file Limiter.h.

◆ getLatency()

template<FloatType T>
int dspark::Limiter< T >::getLatency ( ) const
inlinenoexcept

Reports the processing latency (the lookahead) in samples.

Derived from the published lookahead parameter, so it is correct immediately after setLookahead() from any thread (the audio thread may consume the change one block later; the glide covers the transition).

Definition at line 486 of file Limiter.h.

◆ getLookahead()

template<FloatType T>
T dspark::Limiter< T >::getLookahead ( ) const
inlinenoexcept

Definition at line 477 of file Limiter.h.

◆ getState()

template<FloatType T>
std::vector< uint8_t > dspark::Limiter< T >::getState ( ) const
inline

Serializes the parameter state (setup/UI threads; allocates).

Definition at line 505 of file Limiter.h.

◆ isAdaptiveReleaseEnabled()

template<FloatType T>
bool dspark::Limiter< T >::isAdaptiveReleaseEnabled ( ) const
inlinenoexcept

Definition at line 475 of file Limiter.h.

◆ isSafetyClipEnabled()

template<FloatType T>
bool dspark::Limiter< T >::isSafetyClipEnabled ( ) const
inlinenoexcept

Definition at line 476 of file Limiter.h.

◆ isTruePeakEnabled()

template<FloatType T>
bool dspark::Limiter< T >::isTruePeakEnabled ( ) const
inlinenoexcept

Definition at line 474 of file Limiter.h.

◆ lookaheadSamplesFor()

template<FloatType T>
int dspark::Limiter< T >::lookaheadSamplesFor ( T  ms) const
inlineprotectednoexcept

Lookahead in samples for a given ms parameter (shared by the audio-side recompute and getLatency() so both always agree exactly). The product is capped in double before the int cast (out-of-range casts are UB).

Definition at line 545 of file Limiter.h.

◆ prepare() [1/2]

template<FloatType T>
void dspark::Limiter< T >::prepare ( const AudioSpec &  spec)
inline

Prepares from AudioSpec (unified API).

Preserves the configured lookahead parameter (it does NOT reset it to the constructor default), so a host re-activation keeps the latency the user dialled in.

Definition at line 187 of file Limiter.h.

◆ prepare() [2/2]

template<FloatType T>
void dspark::Limiter< T >::prepare ( double  sampleRate,
int  numChannels = 2,
double  initialLookaheadMs = -1.0 
)
inline

Allocates memory and prepares the limiter for processing.

Invalid arguments are release-safe: a non-positive or non-finite sample rate makes this call a no-op (the previous state, if any, is kept). Configured parameters (ceiling, release, lookahead, toggles) survive re-preparation.

Warning
Must be called from the main/setup thread, NEVER from the audio thread.
Parameters
sampleRateSample rate in Hz (must be > 0).
numChannelsNumber of channels to process (clamped to [1, 16]).
initialLookaheadMsOptional lookahead override in ms; any non-positive or non-finite value (the default) keeps the current lookahead parameter.

Definition at line 116 of file Limiter.h.

◆ processBlock()

template<FloatType T>
void dspark::Limiter< T >::processBlock ( AudioBufferView< T >  buffer)
inlinenoexcept

Processes an AudioBufferView in-place.

RT-Safe: Yes. Lock-free and allocation-free.

The gain envelope is linked: the loudest channel drives the reduction applied to all channels. Channels beyond the prepared count pass through untouched (and undelayed).

Parameters
bufferAudio buffer view.

Definition at line 203 of file Limiter.h.

◆ processSample()

template<FloatType T>
T dspark::Limiter< T >::processSample ( T  input,
int  channel 
)
inlinenoexcept

Processes a single sample of one channel.

The shared state (ceiling smoother, lookahead glide and gain computer) advances on channel 0, so call channel 0 first within each sample frame. For mono streams (channel 0 only) this path is bit-identical to processBlock(). Peaks of the other channels enter the gain computer one frame late; for properly linked multi-channel limiting prefer processBlock().

Note
No DenormalGuard here (per-sample hot path); per-sample callers are expected to guard their own processing loop.

Definition at line 308 of file Limiter.h.

◆ reset()

template<FloatType T>
void dspark::Limiter< T >::reset ( )
inlinenoexcept

Resets the internal state (delays, gain reduction). RT-Safe.

Definition at line 365 of file Limiter.h.

◆ resetGainComputer()

template<FloatType T>
void dspark::Limiter< T >::resetGainComputer ( )
inlineprotectednoexcept

Clears the gain computer to unity gain (history included).

Definition at line 624 of file Limiter.h.

◆ restartHoldBlock()

template<FloatType T>
DSPARK_NOINLINE void dspark::Limiter< T >::restartHoldBlock ( int64_t  firstFrame)
inlineprotectednoexcept

Sliding minimum (van Herk / Gil-Werman, streaming form): the frames are cut into blocks of holdLen_. Once a block is complete its suffix minima are stored; the window ending at a frame of the next block is then the minimum of one stored suffix and the running prefix of that block. Branch-free per frame, one backward pass per block (amortised O(1)). This stores the suffix minima of the block starting at firstFrame and starts a new block at the following frame.

Definition at line 610 of file Limiter.h.

◆ resumBoxes()

template<FloatType T>
DSPARK_NOINLINE void dspark::Limiter< T >::resumBoxes ( )
inlineprotectednoexcept

Recomputes both moving-average sums exactly from their histories.

Definition at line 593 of file Limiter.h.

◆ setAdaptiveRelease()

template<FloatType T>
void dspark::Limiter< T >::setAdaptiveRelease ( bool  enabled)
inlinenoexcept

Enables program-dependent adaptive release. RT-Safe.

Definition at line 436 of file Limiter.h.

◆ setCeiling()

template<FloatType T>
void dspark::Limiter< T >::setCeiling ( T  dB)
inlinenoexcept

Sets the absolute output ceiling.

Parameters
dBCeiling in dBFS (e.g., -1.0 for streaming). RT-Safe. Non-finite values are ignored.

Definition at line 387 of file Limiter.h.

◆ setHold()

template<FloatType T>
void dspark::Limiter< T >::setHold ( T  ms)
inlinenoexcept

Sets how long the reduction is held after the last peak that asked for it, before the release starts. RT-Safe.

Without a hold the gain recovers between the crests of a low tone and dips again at the next one, and that ripple is distortion: a 50 Hz sine driven 6 dB over the ceiling (5 ms lookahead, 50 ms release) measures -56.8 dB THD+N with no hold and -149.6 dB with the default 10 ms, and 40 Hz goes from -47.4 to -149.7 dB (30 Hz: -38.4 to -84.7); the 60 Hz + 7 kHz intermodulation products fall from -62.4 to -74.2 dB. The price is loudness after isolated peaks: 0.21 dB of integrated loudness on a dense mix driven 12 dB over the ceiling.

Parameters
msHold in milliseconds, clamped to [0, 50] (default 10; 0 is the previous release-only behaviour). Non-finite values are ignored.

Definition at line 455 of file Limiter.h.

◆ setLookahead()

template<FloatType T>
void dspark::Limiter< T >::setLookahead ( T  ms)
inlinenoexcept

Sets the lookahead time dynamically.

Note
RT-Safe (atomic publication from any thread). It only adjusts read pointers up to the max memory allocated during prepare(); the read offset glides to the new value at one sample per sample. Non-finite values are ignored. getLatency() reflects the new value immediately.
Parameters
msLookahead in milliseconds (clamped to 0.5 to 10.0 ms).

Definition at line 416 of file Limiter.h.

◆ setRelease()

template<FloatType T>
void dspark::Limiter< T >::setRelease ( T  ms)
inlinenoexcept

Sets the base release time.

Parameters
msRelease time in milliseconds (floored to 1 ms). RT-Safe. Non-finite values are ignored.

Definition at line 400 of file Limiter.h.

◆ setSafetyClip()

template<FloatType T>
void dspark::Limiter< T >::setSafetyClip ( bool  enabled)
inlinenoexcept

Enables the post-limiter soft-knee safety clipper. RT-Safe.

Softens the region above -0.3 dBFS up to the ceiling; it only has an effect when the ceiling is set above -0.3 dBFS (below that, the brickwall clamp already keeps the output under the clipper threshold).

Definition at line 471 of file Limiter.h.

◆ setState()

template<FloatType T>
bool dspark::Limiter< T >::setState ( const uint8_t *  data,
size_t  size 
)
inline

Restores parameters from a blob (tolerant; rejects foreign ids).

Definition at line 519 of file Limiter.h.

◆ setTruePeak()

template<FloatType T>
void dspark::Limiter< T >::setTruePeak ( bool  enabled)
inlinenoexcept

Enables 4x oversampled ISP true-peak detection. RT-Safe. The attack ramp shortens by the estimator's support (11 samples) so the reduction covers every sample a true-peak reading is formed from.

Definition at line 429 of file Limiter.h.

◆ syncParameters()

template<FloatType T>
void dspark::Limiter< T >::syncParameters ( )
inlineprotectednoexcept

Definition at line 703 of file Limiter.h.

◆ updateHoldSamples()

template<FloatType T>
void dspark::Limiter< T >::updateHoldSamples ( )
inlineprotectednoexcept

Definition at line 727 of file Limiter.h.

◆ updateReleaseCoefficient()

template<FloatType T>
void dspark::Limiter< T >::updateReleaseCoefficient ( )
inlineprotectednoexcept

Definition at line 732 of file Limiter.h.

Member Data Documentation

◆ adaptiveRelease_

template<FloatType T>
std::atomic<bool> dspark::Limiter< T >::adaptiveRelease_ { false }
protected

Definition at line 767 of file Limiter.h.

◆ avgHist_

template<FloatType T>
std::vector<double> dspark::Limiter< T >::avgHist_
protected

First moving-average output history.

Definition at line 794 of file Limiter.h.

◆ blockPos_

template<FloatType T>
int dspark::Limiter< T >::blockPos_ = 0
protected

Position inside the current hold block.

Definition at line 797 of file Limiter.h.

◆ boxA_

template<FloatType T>
int dspark::Limiter< T >::boxA_ = 1
protected

Definition at line 803 of file Limiter.h.

◆ boxB_

template<FloatType T>
int dspark::Limiter< T >::boxB_ = 1
protected

Definition at line 804 of file Limiter.h.

◆ ceilingDb_

template<FloatType T>
std::atomic<T> dspark::Limiter< T >::ceilingDb_ { T(-0.3) }
protected

Definition at line 761 of file Limiter.h.

◆ ceilingSmooth_

template<FloatType T>
SmoothedValue<T> dspark::Limiter< T >::ceilingSmooth_
protected

Definition at line 770 of file Limiter.h.

◆ chunkCeiling_

template<FloatType T>
T dspark::Limiter< T >::chunkCeiling_[kChunk] = {}
protected

Definition at line 814 of file Limiter.h.

◆ chunkGain_

template<FloatType T>
T dspark::Limiter< T >::chunkGain_[kChunk] = {}
protected

Definition at line 815 of file Limiter.h.

◆ chunkLook_

template<FloatType T>
int dspark::Limiter< T >::chunkLook_[kChunk] = {}
protected

Definition at line 816 of file Limiter.h.

◆ chunkPeak_

template<FloatType T>
T dspark::Limiter< T >::chunkPeak_[kChunk] = {}
protected

Definition at line 813 of file Limiter.h.

◆ currentGain_

template<FloatType T>
T dspark::Limiter< T >::currentGain_ = T(1)
protected

Definition at line 779 of file Limiter.h.

◆ delayLines_

template<FloatType T>
std::vector<RingBuffer<T> > dspark::Limiter< T >::delayLines_
protected

Definition at line 822 of file Limiter.h.

◆ eHist_

template<FloatType T>
std::vector<double> dspark::Limiter< T >::eHist_
protected

Released envelope history.

Definition at line 793 of file Limiter.h.

◆ envelope_

template<FloatType T>
double dspark::Limiter< T >::envelope_ = 1.0
protected

Definition at line 800 of file Limiter.h.

◆ frame_

template<FloatType T>
int64_t dspark::Limiter< T >::frame_ = 0
protected

Definition at line 799 of file Limiter.h.

◆ histMask_

template<FloatType T>
int dspark::Limiter< T >::histMask_ = 0
protected

Definition at line 792 of file Limiter.h.

◆ histSize_

template<FloatType T>
int dspark::Limiter< T >::histSize_ = 0
protected

Definition at line 791 of file Limiter.h.

◆ holdLeft_

template<FloatType T>
int dspark::Limiter< T >::holdLeft_ = 0
protected

Hold samples left before the release may act.

Definition at line 777 of file Limiter.h.

◆ holdLen_

template<FloatType T>
int dspark::Limiter< T >::holdLen_ = 97
protected

Definition at line 807 of file Limiter.h.

◆ holdMs_

template<FloatType T>
std::atomic<T> dspark::Limiter< T >::holdMs_ { T(10) }
protected

Definition at line 763 of file Limiter.h.

◆ holdSamples_

template<FloatType T>
int dspark::Limiter< T >::holdSamples_ = 0
protected

Hold length in samples.

Definition at line 776 of file Limiter.h.

◆ invBoxA_

template<FloatType T>
double dspark::Limiter< T >::invBoxA_ = 1.0
protected

Definition at line 805 of file Limiter.h.

◆ invBoxB_

template<FloatType T>
double dspark::Limiter< T >::invBoxB_ = 1.0
protected

Definition at line 806 of file Limiter.h.

◆ invSampleRate_

template<FloatType T>
T dspark::Limiter< T >::invSampleRate_ = T(1.0 / 48000.0)
protected

Definition at line 756 of file Limiter.h.

◆ kChunk

template<FloatType T>
constexpr int dspark::Limiter< T >::kChunk = 128
staticconstexprprotected

Definition at line 812 of file Limiter.h.

◆ kMaxChannels

template<FloatType T>
constexpr int dspark::Limiter< T >::kMaxChannels = 16
staticconstexprprotected

Definition at line 535 of file Limiter.h.

◆ kMaxLookaheadMs

template<FloatType T>
constexpr double dspark::Limiter< T >::kMaxLookaheadMs = 10.0
staticconstexprprotected

Definition at line 536 of file Limiter.h.

◆ kResumPeriod

template<FloatType T>
constexpr int dspark::Limiter< T >::kResumPeriod = 1 << 16
staticconstexprprotected

Definition at line 790 of file Limiter.h.

◆ kSafetyClipCeiling

template<FloatType T>
constexpr T dspark::Limiter< T >::kSafetyClipCeiling = T(0.96605)
staticconstexprprotected

-0.3 dBFS

Definition at line 537 of file Limiter.h.

◆ lastCeilingDb_

template<FloatType T>
T dspark::Limiter< T >::lastCeilingDb_ = T(-0.3)
protected

Change detector for the ceiling pow skip.

Definition at line 771 of file Limiter.h.

◆ lastHoldMs_

template<FloatType T>
T dspark::Limiter< T >::lastHoldMs_ = T(-1)
protected

Definition at line 775 of file Limiter.h.

◆ lastReleaseMs_

template<FloatType T>
T dspark::Limiter< T >::lastReleaseMs_ = T(-1)
protected

Definition at line 774 of file Limiter.h.

◆ limitingDuration_

template<FloatType T>
int dspark::Limiter< T >::limitingDuration_ = 0
protected

Definition at line 785 of file Limiter.h.

◆ lookaheadCurrent_

template<FloatType T>
T dspark::Limiter< T >::lookaheadCurrent_ = T(96)
protected

Smoothed read offset (glides on live changes).

Definition at line 786 of file Limiter.h.

◆ lookaheadDirty_

template<FloatType T>
std::atomic<bool> dspark::Limiter< T >::lookaheadDirty_ { false }
protected

Definition at line 765 of file Limiter.h.

◆ lookaheadMs_

template<FloatType T>
std::atomic<T> dspark::Limiter< T >::lookaheadMs_ { T(2) }
protected

Definition at line 764 of file Limiter.h.

◆ lookaheadSamples_

template<FloatType T>
int dspark::Limiter< T >::lookaheadSamples_ = 96
protected

Audio-side lookahead (consumed from lookaheadMs_).

Definition at line 758 of file Limiter.h.

◆ maxLimitSamples_

template<FloatType T>
int dspark::Limiter< T >::maxLimitSamples_ = 96000
protected

Adaptive-release duration cap (2 s).

Definition at line 759 of file Limiter.h.

◆ numChannels_

template<FloatType T>
int dspark::Limiter< T >::numChannels_ = 2
protected

Definition at line 757 of file Limiter.h.

◆ pendingPeak_

template<FloatType T>
T dspark::Limiter< T >::pendingPeak_ = T(0)
protected

Other channels' peaks for the next processSample() frame.

Definition at line 809 of file Limiter.h.

◆ prefixMin_

template<FloatType T>
double dspark::Limiter< T >::prefixMin_ = 1.0
protected

Running minimum of the current hold block.

Definition at line 798 of file Limiter.h.

◆ prepared_

template<FloatType T>
bool dspark::Limiter< T >::prepared_ = false
protected

Definition at line 754 of file Limiter.h.

◆ publishedGain_

template<FloatType T>
std::atomic<T> dspark::Limiter< T >::publishedGain_ { T(1) }
protected

Cross-thread metering readout of currentGain_: published once per processBlock() and once per processSample() call. processSample() is the per-sample entry point, so there the store does run once per sample – what it never does is sit inside processBlock()'s own sample loop.

Definition at line 784 of file Limiter.h.

◆ releaseCoeff_

template<FloatType T>
T dspark::Limiter< T >::releaseCoeff_ = T(0)
protected

Definition at line 773 of file Limiter.h.

◆ releaseMs_

template<FloatType T>
std::atomic<T> dspark::Limiter< T >::releaseMs_ { T(100) }
protected

Definition at line 762 of file Limiter.h.

◆ rHist_

template<FloatType T>
std::vector<double> dspark::Limiter< T >::rHist_
protected

Required-gain history.

Definition at line 795 of file Limiter.h.

◆ safetyClipEnabled_

template<FloatType T>
std::atomic<bool> dspark::Limiter< T >::safetyClipEnabled_ { false }
protected

Definition at line 768 of file Limiter.h.

◆ sampleCeiling_

template<FloatType T>
T dspark::Limiter< T >::sampleCeiling_ = T(0.96605)
protected

Definition at line 819 of file Limiter.h.

◆ sampleLookNow_

template<FloatType T>
int dspark::Limiter< T >::sampleLookNow_ = 96
protected

Definition at line 820 of file Limiter.h.

◆ sampleRate_

template<FloatType T>
double dspark::Limiter< T >::sampleRate_ = 48000.0
protected

Definition at line 755 of file Limiter.h.

◆ sinceResum_

template<FloatType T>
int dspark::Limiter< T >::sinceResum_ = 0
protected

Definition at line 808 of file Limiter.h.

◆ sufMin_

template<FloatType T>
std::vector<double> dspark::Limiter< T >::sufMin_
protected

Suffix minima of the last complete hold block (+1 empty).

Definition at line 796 of file Limiter.h.

◆ sum1_

template<FloatType T>
double dspark::Limiter< T >::sum1_ = 1.0
protected

Definition at line 801 of file Limiter.h.

◆ sum2_

template<FloatType T>
double dspark::Limiter< T >::sum2_ = 1.0
protected

Definition at line 802 of file Limiter.h.

◆ truePeak_

template<FloatType T>
TruePeakDetector<T, kMaxChannels> dspark::Limiter< T >::truePeak_
protected

Definition at line 540 of file Limiter.h.

◆ truePeakEnabled_

template<FloatType T>
std::atomic<bool> dspark::Limiter< T >::truePeakEnabled_ { false }
protected

Definition at line 766 of file Limiter.h.


The documentation for this class was generated from the following file: