Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::comp::Fader Class Reference

Detailed Description

Definition at line 40 of file fader.hpp.

#include <fader.hpp>

Public Member Functions

void set_level_su (float su)
 
void set_taper (Taper t)
 
void process (float *buf, uint16_t n)
 
void process (float *buf_l, float *buf_r, uint16_t n)
 
float tick (uint16_t n)
 
float gain () const
 Current smoothed gain value (after taper mapping + smoothing).
 
float level () const
 Raw su level (before taper mapping).
 
void reset ()
 Reset smoother state and level to defaults.
 

Static Public Attributes

static constexpr float kSettlingMs = 15.0f
 

Member Function Documentation

◆ set_level_su()

void sbl::dsp::comp::Fader::set_level_su ( float  su)
inline

◆ set_taper()

void sbl::dsp::comp::Fader::set_taper ( Taper  t)
inline

◆ process() [1/2]

void sbl::dsp::comp::Fader::process ( float *  buf,
uint16_t  n 
)
inline

Apply gain to a mono buffer in-place. Per-sample smoothing toward target gain — click-free.

Definition at line 62 of file fader.hpp.

References sbl::dsp::primitives::ParameterSmoother::process().

◆ process() [2/2]

void sbl::dsp::comp::Fader::process ( float *  buf_l,
float *  buf_r,
uint16_t  n 
)
inline

Apply gain to stereo buffers in-place. Same smoothed gain applied to both channels per sample.

Definition at line 72 of file fader.hpp.

References sbl::dsp::primitives::ParameterSmoother::process().

◆ tick()

float sbl::dsp::comp::Fader::tick ( uint16_t  n)
inline

Advance the smoother by n samples' worth without processing audio. Call once per block with the block size for control-rate gain updates (e.g., send levels) — settling time matches per-sample process() regardless of call rate. Returns the current smoothed gain.

Definition at line 86 of file fader.hpp.

References sbl::dsp::primitives::ParameterSmoother::process_steps().

Referenced by sbl::dsp::widgets::Channel< MaxFrames, MaxSends >::process().

◆ gain()

float sbl::dsp::comp::Fader::gain ( ) const
inline

Current smoothed gain value (after taper mapping + smoothing).

Definition at line 92 of file fader.hpp.

References sbl::dsp::primitives::ParameterSmoother::value().

Referenced by sbl::dsp::widgets::Channel< MaxFrames, MaxSends >::fader_gain().

◆ level()

float sbl::dsp::comp::Fader::level ( ) const
inline

Raw su level (before taper mapping).

Definition at line 95 of file fader.hpp.

◆ reset()

void sbl::dsp::comp::Fader::reset ( )
inline

Reset smoother state and level to defaults.

Definition at line 98 of file fader.hpp.

References sbl::dsp::comp::Audio, and sbl::dsp::primitives::ParameterSmoother::reset().

Member Data Documentation

◆ kSettlingMs

constexpr float sbl::dsp::comp::Fader::kSettlingMs = 15.0f
staticconstexpr

Definition at line 42 of file fader.hpp.


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