15#ifndef SBL_DSP_PRIMITIVES_PARAMETER_SMOOTHER_HPP_
16#define SBL_DSP_PRIMITIVES_PARAMETER_SMOOTHER_HPP_
45 if (ms <= 0.0f || rate_hz <= 0.0f) {
61 state_ += coeff_ * (target - state_);
78 for (uint32_t i = 0; i < n; ++i) {
79 state_ += coeff_ * (target - state_);
85 float value()
const {
return state_; }
94 void reset(
float initial) { state_ = initial; }
void reset()
Reset to zero.
void set_time_ms(float ms, float rate_hz)
Compute coefficient from settling time in milliseconds.
float coefficient() const
Current coefficient.
float process_steps(float target, uint32_t n)
Advance n steps toward target in one call.
float process(float target)
Process one sample toward target.
void reset(float initial)
Reset to a specific value.
void set_coefficient(float a)
Set coefficient directly.
float value() const
Current smoothed value.
Fast analytical approximations (Audio Stack — Atoms)
constexpr float one_minus_exp_neg(float x)
Stateful, single-concern building blocks.