Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Classes | Functions
sbl::signal Namespace Reference

Classes

struct  Frame
 

Functions

float exp_mod (float base, float mod, float depth, float lo=20.0f, float hi=20000.0f)
 
void exp_mod_block (const float *mod, float *freq_out, uint16_t n, float base, float depth, float lo=20.0f, float hi=20000.0f)
 

Function Documentation

◆ exp_mod()

float sbl::signal::exp_mod ( float  base,
float  mod,
float  depth,
float  lo = 20.0f,
float  hi = 20000.0f 
)
inline

Apply exponential modulation to a base frequency (scalar).

Converts a normalized modulation signal to a frequency via: freq = base * 2^(mod * depth)

At depth = 2.0 and mod = 1.0, output is base * 4 (2 octaves up). At depth = 2.0 and mod = -1.0, output is base / 4 (2 octaves down). The relationship is perceptually uniform — equal mod deltas produce equal musical intervals regardless of the base frequency.

Parameters
baseCenter frequency in Hz (e.g., filter cutoff)
modNormalized modulation value, typically [-1.0, 1.0]
depthModulation depth in octaves (e.g., 2.0 = ±2 octaves)
loMinimum output frequency in Hz (default 20)
hiMaximum output frequency in Hz (default 20000)
Returns
Modulated frequency in Hz, clamped to [lo, hi]

Definition at line 49 of file exp_mod.hpp.

References sbl::dsp::fast_exp2f().

Referenced by exp_mod_block(), and sbl::widgets::proc::Svf::process_modulated().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exp_mod_block()

void sbl::signal::exp_mod_block ( const float *  mod,
float *  freq_out,
uint16_t  n,
float  base,
float  depth,
float  lo = 20.0f,
float  hi = 20000.0f 
)
inline

Apply exponential modulation to an entire block (buffer version).

Writes modulated frequencies to freq_out[] for each sample. Use this when you need the frequency buffer for direct coefficient computation (e.g., feeding into a filter's set_cutoff per-sample).

Parameters
modNormalized modulation signal buffer [-1.0, 1.0]
freq_outOutput frequency buffer (Hz)
nFrame count
baseCenter frequency in Hz
depthModulation depth in octaves
loMinimum output frequency in Hz (default 20)
hiMaximum output frequency in Hz (default 20000)

Definition at line 70 of file exp_mod.hpp.

References exp_mod().

Here is the call graph for this function: