Linear smoothing for control-rate parameters. More...
#include <smoothed_value.hpp>
Public Member Functions | |
| SmoothedValue ()=default | |
| SmoothedValue (T initial) | |
| void | set_ramp_time (T seconds, T sample_rate) |
| RT contract: this helper stores only scalar state and allocates no memory. | |
| void | set_target (T value) |
| void | set_immediate (T value) |
| T | next () |
| void | skip (int n) |
| bool | is_smoothing () const |
| T | current () const |
| T | target () const |
Linear smoothing for control-rate parameters.
Real-time safe; no allocations. Use for parameter smoothing where the linear ramp is perceptually correct (gain in linear units, mix, pan position, etc.).
For parameters where the linear ramp is perceptually wrong — pitch, frequency, gain in dB — use LogRampedValue (in core/signal/include/pulp/signal/log_ramped_value.hpp) which applies a multiplicative (geometric) per-sample step so equal time produces equal perceptual change across the range.
The two utilities together cover Pulp's smoothing surface; consumers pick the curve that matches the parameter's semantics.
|
default |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
RT contract: this helper stores only scalar state and allocates no memory.
set_ramp_time(), set_target(), set_immediate(), next(), skip(), and accessors are audio-thread safe when externally synchronized like any other mutable control object.
|
inline |
|
inline |
|
inline |