Class thl::dsp::utils::ParameterInterpolator#
-
class ParameterInterpolator#
RAII wrapper around
LinearRampthat commits the final ramp state on scope exit.This preserves the classic Mutable Instruments
ParameterInterpolatorconvenience pattern while exposing a reusableLinearRampimplementation. The referencedstateis updated in the destructor to the ramp’s current position (typically the next block start value after consuming the block).Public Functions
-
inline ParameterInterpolator(float &state, float new_value, size_t size) noexcept#
Create an interpolator bound to a persistent parameter state.
- Parameters:
state – In/out parameter state carried across audio blocks.
new_value – Target value to approach over the current block.
size – Number of samples in the block.
-
inline ~ParameterInterpolator() noexcept#
Commit the ramp position back to the referenced state.
-
ParameterInterpolator(const ParameterInterpolator&) = delete#
-
ParameterInterpolator &operator=(const ParameterInterpolator&) = delete#
-
ParameterInterpolator(ParameterInterpolator&&) = delete#
-
ParameterInterpolator &operator=(ParameterInterpolator&&) = delete#
-
inline float next() noexcept#
Advance one step and return the interpolated value.
-
inline float at_offset(float t) const noexcept#
Return a value at a fractional offset from the current interpolator position.
-
inline ParameterInterpolator(float &state, float new_value, size_t size) noexcept#