DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
dspark::Smoothers::ExponentialSmoother Class Reference

Exponential (multiplicative) smoother for natural, perceptual responses. More...

#include <Smoothers.h>

Public Member Functions

void reset (double sampleRate, float timeConstantMilliseconds, float initialValue=1.0f) noexcept
 
void setTargetValue (float newTarget) noexcept
 
float getNextValue () noexcept
 
float getCurrentValue () const noexcept
 
float getTargetValue () const noexcept
 
void setCurrentAndTargetValue (float value) noexcept
 
bool isSmoothing () const noexcept
 
void skip () noexcept
 

Static Public Attributes

static constexpr float epsilon = 1e-10f
 

Detailed Description

Exponential (multiplicative) smoother for natural, perceptual responses.

Use for: Filter cutoffs, frequencies, volumes in dB.

Warning
Geometric smoothing is only defined for same-sign transitions. If the new target's sign differs from the current value (ratio <= 0), or the current value is zero, the smoother snaps instantly to the target: an audible step. Keep this class for strictly-positive parameters (Hz, linear gain); use LinearSmoother or OnePoleSmoother for bipolar values (pan, offsets).

Definition at line 100 of file Smoothers.h.

Member Function Documentation

◆ getCurrentValue()

float dspark::Smoothers::ExponentialSmoother::getCurrentValue ( ) const
inlinenoexcept

Definition at line 109 of file Smoothers.h.

◆ getNextValue()

float dspark::Smoothers::ExponentialSmoother::getNextValue ( )
inlinenoexcept

Definition at line 433 of file Smoothers.h.

◆ getTargetValue()

float dspark::Smoothers::ExponentialSmoother::getTargetValue ( ) const
inlinenoexcept

Definition at line 110 of file Smoothers.h.

◆ isSmoothing()

bool dspark::Smoothers::ExponentialSmoother::isSmoothing ( ) const
inlinenoexcept

Definition at line 450 of file Smoothers.h.

◆ reset()

void dspark::Smoothers::ExponentialSmoother::reset ( double  sampleRate,
float  timeConstantMilliseconds,
float  initialValue = 1.0f 
)
inlinenoexcept

Definition at line 401 of file Smoothers.h.

◆ setCurrentAndTargetValue()

void dspark::Smoothers::ExponentialSmoother::setCurrentAndTargetValue ( float  value)
inlinenoexcept

Definition at line 442 of file Smoothers.h.

◆ setTargetValue()

void dspark::Smoothers::ExponentialSmoother::setTargetValue ( float  newTarget)
inlinenoexcept

Definition at line 410 of file Smoothers.h.

◆ skip()

void dspark::Smoothers::ExponentialSmoother::skip ( )
inlinenoexcept

Definition at line 455 of file Smoothers.h.

Member Data Documentation

◆ epsilon

constexpr float dspark::Smoothers::ExponentialSmoother::epsilon = 1e-10f
staticconstexpr

Definition at line 103 of file Smoothers.h.


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