Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::SmoothedValue< T > Class Template Reference

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

Detailed Description

template<typename T = float>
class pulp::signal::SmoothedValue< T >

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.

Constructor & Destructor Documentation

◆ SmoothedValue() [1/2]

template<typename T = float>
pulp::signal::SmoothedValue< T >::SmoothedValue ( )
default

◆ SmoothedValue() [2/2]

template<typename T = float>
pulp::signal::SmoothedValue< T >::SmoothedValue ( T initial)
inlineexplicit

Member Function Documentation

◆ current()

template<typename T = float>
T pulp::signal::SmoothedValue< T >::current ( ) const
inline

◆ is_smoothing()

template<typename T = float>
bool pulp::signal::SmoothedValue< T >::is_smoothing ( ) const
inline

◆ next()

template<typename T = float>
T pulp::signal::SmoothedValue< T >::next ( )
inline

◆ set_immediate()

template<typename T = float>
void pulp::signal::SmoothedValue< T >::set_immediate ( T value)
inline

◆ set_ramp_time()

template<typename T = float>
void pulp::signal::SmoothedValue< T >::set_ramp_time ( T seconds,
T sample_rate )
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.

◆ set_target()

template<typename T = float>
void pulp::signal::SmoothedValue< T >::set_target ( T value)
inline

◆ skip()

template<typename T = float>
void pulp::signal::SmoothedValue< T >::skip ( int n)
inline

◆ target()

template<typename T = float>
T pulp::signal::SmoothedValue< T >::target ( ) const
inline

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