|
DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
|
Cubic glide that lands exactly on the target after a fixed time, with a continuous slope. More...
#include <Smoothers.h>
Public Member Functions | |
| void | reset (double sampleRate, float rampTimeMilliseconds, float initialValue=0.0f) noexcept |
| void | setTargetValue (float newTarget) noexcept |
| float | getNextValue () noexcept |
| float | getCurrentValue () const noexcept |
| float | getTargetValue () const noexcept |
| bool | isSmoothing () const noexcept |
| void | skip () noexcept |
Cubic glide that lands exactly on the target after a fixed time, with a continuous slope.
Each new target starts a cubic Hermite segment from the current value and velocity to the target, arriving with zero velocity after exactly the ramp time: like LinearSmoother it settles in a known number of samples (and isSmoothing() then turns off exactly), but the value never has a corner, at the start, at the end, or when retargeted mid-glide. From rest the path is the smoothstep 3u^2 - 2u^3: monotonic, with its 10-90% rise at 0.61 of the ramp time. A retarget mid-glide keeps the current velocity, clipped to the monotone limit (three times the remaining distance per ramp) so the glide never passes the new target.
Use for: filter cutoffs (in log frequency), any parameter whose glide should end at a known time without the long exponential tail.
Internal state is double precision; the public API stays float.
Definition at line 353 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 360 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 887 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 361 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 362 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 840 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 851 of file Smoothers.h.
|
inlinenoexcept |
Definition at line 903 of file Smoothers.h.