Class thl::dsp::utils::LinearRamp#
-
class LinearRamp#
Lightweight linear ramp generator for block-based DSP interpolation.
LinearRampemitssizeevenly spaced values fromstarttowardstargetwhennext()is called once per sample. It does not mutate external state.Public Functions
-
inline LinearRamp(float start, float target, size_t size) noexcept#
Create a ramp from
starttotargetoversizesteps.When
sizeis 0, the increment is 0 and the ramp remains atstart.
-
inline float next() noexcept#
Advance by one step and return the new value.
The first call returns
start + increment, the n-th call returnstarget. This matches the original stmlib pre-increment convention.
-
inline float at_offset(float t) const noexcept#
Return a value at a fractional offset from the current ramp position.
- Parameters:
t – Fractional sample offset relative to the current position.
-
inline float current_value() const noexcept#
Get the current internal ramp position.
-
inline float final_value() const noexcept#
Get the target value provided at construction time.
-
inline float increment() const noexcept#
Get the per-step increment.
-
inline LinearRamp(float start, float target, size_t size) noexcept#