DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::Smoothers::HermiteSmoother Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ getCurrentValue()

float dspark::Smoothers::HermiteSmoother::getCurrentValue ( ) const
inlinenoexcept

Definition at line 360 of file Smoothers.h.

◆ getNextValue()

float dspark::Smoothers::HermiteSmoother::getNextValue ( )
inlinenoexcept

Definition at line 887 of file Smoothers.h.

◆ getTargetValue()

float dspark::Smoothers::HermiteSmoother::getTargetValue ( ) const
inlinenoexcept

Definition at line 361 of file Smoothers.h.

◆ isSmoothing()

bool dspark::Smoothers::HermiteSmoother::isSmoothing ( ) const
inlinenoexcept

Definition at line 362 of file Smoothers.h.

◆ reset()

void dspark::Smoothers::HermiteSmoother::reset ( double  sampleRate,
float  rampTimeMilliseconds,
float  initialValue = 0.0f 
)
inlinenoexcept

Definition at line 840 of file Smoothers.h.

◆ setTargetValue()

void dspark::Smoothers::HermiteSmoother::setTargetValue ( float  newTarget)
inlinenoexcept

Definition at line 851 of file Smoothers.h.

◆ skip()

void dspark::Smoothers::HermiteSmoother::skip ( )
inlinenoexcept

Definition at line 903 of file Smoothers.h.


The documentation for this class was generated from the following file: