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

A collection of real-time safe smoothing filters for parameter interpolation in audio. More...

Detailed Description

A collection of real-time safe smoothing filters for parameter interpolation in audio.

Standalone: no external dependencies beyond the C++ standard library.

These classes provide various smoothing techniques to prevent artifacts like zipper noise or clicks during parameter changes. All smoothers are designed for use in the audio thread: lock-free, no dynamic allocations, and noexcept methods. The state structs are kept compact (no over-alignment) so banks of smoothers pack tightly into cache lines.

Threading: a smoother is single-threaded by design. It lives inside a processor and every method is meant to be called from that processor's processing thread (publish control-thread changes through your own atomics, as the effects do).

Common API:

  • reset(double sampleRate, float timeConstantMilliseconds, float initialValue): Configure.
  • setTargetValue(float newTarget): Set the new target value to smooth towards.
  • getNextValue(): Get the next smoothed value (call per sample).
  • getCurrentValue(): Get the current smoothed value without advancing.
  • getTargetValue(): Get the current target value.
  • isSmoothing(): Check if still smoothing (abs(current - target) > epsilon).
  • skip(): Instantly set current to target (bypass smoothing).