Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::LatencyAwareControlSmoother Class Reference

#include <latency_aware_control_smoother.hpp>

Classes

struct  Config

Public Types

enum class  Domain { linear , semitone }
 Value domain. More...

Public Member Functions

void prepare (double sample_rate, const Config &config)
 RT contract: fixed-state and allocation-free.
void set_target (float value)
 RT-safe; takes effect from the current stream position.
void set_immediate (float value)
 Jump immediately (e.g. on reset/preset load).
float target () const
float current () const
float value_at (int offset) const
 Value offset samples ahead of (or, if negative, behind) the current position, without advancing state.
float ratio_at (int offset) const
 value_at in the ratio domain: 2^(semitones / 12).
float advance (int samples)
 Advance the stream position by samples and return the new value.
bool is_settled (float tolerance) const

Member Enumeration Documentation

◆ Domain

Value domain.

semitone smooths in semitones and additionally exposes the smoothed value as a frequency ratio via ratio_at().

Enumerator
linear 
semitone 

Member Function Documentation

◆ advance()

float pulp::signal::LatencyAwareControlSmoother::advance ( int samples)
inline

Advance the stream position by samples and return the new value.

◆ current()

float pulp::signal::LatencyAwareControlSmoother::current ( ) const
inline

◆ is_settled()

bool pulp::signal::LatencyAwareControlSmoother::is_settled ( float tolerance) const
inline

◆ prepare()

void pulp::signal::LatencyAwareControlSmoother::prepare ( double sample_rate,
const Config & config )
inline

RT contract: fixed-state and allocation-free.

prepare() does not allocate, but should be called from prepare/control code. set_target(), set_immediate(), value_at(), ratio_at(), advance(), and accessors are audio-thread safe.

◆ ratio_at()

float pulp::signal::LatencyAwareControlSmoother::ratio_at ( int offset) const
inline

value_at in the ratio domain: 2^(semitones / 12).

Only meaningful for Domain::semitone.

◆ set_immediate()

void pulp::signal::LatencyAwareControlSmoother::set_immediate ( float value)
inline

Jump immediately (e.g. on reset/preset load).

◆ set_target()

void pulp::signal::LatencyAwareControlSmoother::set_target ( float value)
inline

RT-safe; takes effect from the current stream position.

◆ target()

float pulp::signal::LatencyAwareControlSmoother::target ( ) const
inline

◆ value_at()

float pulp::signal::LatencyAwareControlSmoother::value_at ( int offset) const
inline

Value offset samples ahead of (or, if negative, behind) the current position, without advancing state.

Negative offsets rewind along the same exponential toward where the value was.


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