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::pm::ThermalFriction Class Reference

Detailed Description

Definition at line 90 of file thermal_friction.hpp.

#include <thermal_friction.hpp>

Public Member Functions

void set_limits (const float *limits, uint8_t slices)
 The cold static limit per force slice — the friction-curve bow's limits
 
void set_force_su (float su)
 Bow force across the slices [0, 1]; the cold limit interpolates between them.
 
void set_rosin (float heat, float tau_ms, float convect, float mu_ratio, float cold_gain=DEFAULT_COLD_GAIN)
 The rosin: how it heats, cools and softens (configuration, not signals)
 
void set_fast_cooling (float fast_ms, float fast_share)
 The fast cooling component: its time constant and the share of the heat it takes.
 
float mu_rel () const
 Friction relative to cold, from the temperature: 1 cold down to mu_ratio hot.
 
void advance (float force, float v_slip)
 Advance the contact one sample from a force and sliding speed found elsewhere.
 
float process (float dv_free)
 One sample: relative velocity in, injection force out.
 
bool sticking () const
 True while the string travels with the bow.
 
float limit () const
 The static limit right now, warmed: where the string would release.
 
float temperature () const
 Contact temperature as a fraction of the range over which the rosin softens.
 
void reset ()
 Cold and stuck.
 
diagram::Ports describe (diagram::Graph &g, uint8_t group, const char *name="bow (thermal)") const
 One Junction node: the friction nonlinearity. Never called from audio code (AP-037).
 

Static Public Attributes

static constexpr float DEFAULT_MU_RATIO = 0.35f / 1.2f
 Rosin, as Woodhouse measured it: friction at full heat is this fraction of cold.
 
static constexpr float DEFAULT_HEAT = 2000.0f
 
static constexpr float DEFAULT_TAU_MS = 10.0f
 Conduction into the string and the bow: the slow component's time to cool by 1/e.
 
static constexpr float DEFAULT_CONVECT = 0.0f
 Convection: cold rosin flowing into the contact, per unit sliding speed per second.
 
static constexpr float DEFAULT_COLD_GAIN = 1.0f
 
static constexpr float DEFAULT_FAST_MS = 0.5f
 The fast cooling component: time constant and the share of heat it takes.
 
static constexpr float DEFAULT_FAST_SHARE = 0.6f
 

Member Function Documentation

◆ set_limits()

void sbl::dsp::pm::ThermalFriction::set_limits ( const float *  limits,
uint8_t  slices 
)
inline

The cold static limit per force slice — the friction-curve bow's limits

Parameters
limitsone static-friction limit per slice, light bow first
slicesnumber of slices

Definition at line 118 of file thermal_friction.hpp.

References set_force_su().

Referenced by sbl::dsp::pm::HybridFriction::set_bow().

◆ set_force_su()

void sbl::dsp::pm::ThermalFriction::set_force_su ( float  su)
inline

Bow force across the slices [0, 1]; the cold limit interpolates between them.

Definition at line 125 of file thermal_friction.hpp.

Referenced by sbl::dsp::pm::HybridFriction::set_force_su(), set_limits(), and set_rosin().

◆ set_rosin()

void sbl::dsp::pm::ThermalFriction::set_rosin ( float  heat,
float  tau_ms,
float  convect,
float  mu_ratio,
float  cold_gain = DEFAULT_COLD_GAIN 
)
inline

The rosin: how it heats, cools and softens (configuration, not signals)

Parameters
heattemperature fraction per unit of force·speed per second
tau_msconduction time constant
convectconvection coefficient per unit sliding speed per second
mu_ratiofriction at full heat relative to cold, in (0, 1]
cold_gainthe cold limit as a multiple of the table's limit

Definition at line 147 of file thermal_friction.hpp.

References DEFAULT_COLD_GAIN, DEFAULT_MU_RATIO, and set_force_su().

◆ set_fast_cooling()

void sbl::dsp::pm::ThermalFriction::set_fast_cooling ( float  fast_ms,
float  fast_share 
)
inline

The fast cooling component: its time constant and the share of the heat it takes.

Definition at line 158 of file thermal_friction.hpp.

◆ mu_rel()

float sbl::dsp::pm::ThermalFriction::mu_rel ( ) const
inline

Friction relative to cold, from the temperature: 1 cold down to mu_ratio hot.

Definition at line 164 of file thermal_friction.hpp.

References temperature().

Referenced by limit(), process(), and sbl::dsp::pm::HybridFriction::set_force_su().

◆ advance()

void sbl::dsp::pm::ThermalFriction::advance ( float  force,
float  v_slip 
)
inline

Advance the contact one sample from a force and sliding speed found elsewhere.

For the hybrid bow: the friction curve finds the force; this keeps the temperature. Sliding speed 0 while stuck.

Definition at line 172 of file thermal_friction.hpp.

References sbl::dsp::math::clamp01().

Referenced by sbl::dsp::pm::HybridFriction::process(), and process().

◆ process()

float sbl::dsp::pm::ThermalFriction::process ( float  dv_free)
inline

One sample: relative velocity in, injection force out.

Parameters
dv_freev_bow - v_incoming, in wave variables

Definition at line 187 of file thermal_friction.hpp.

References advance(), limit(), and mu_rel().

◆ sticking()

bool sbl::dsp::pm::ThermalFriction::sticking ( ) const
inline

True while the string travels with the bow.

Definition at line 212 of file thermal_friction.hpp.

◆ limit()

float sbl::dsp::pm::ThermalFriction::limit ( ) const
inline

The static limit right now, warmed: where the string would release.

Definition at line 215 of file thermal_friction.hpp.

References mu_rel().

Referenced by process().

◆ temperature()

float sbl::dsp::pm::ThermalFriction::temperature ( ) const
inline

Contact temperature as a fraction of the range over which the rosin softens.

Definition at line 218 of file thermal_friction.hpp.

Referenced by mu_rel(), and sbl::dsp::pm::HybridFriction::temperature().

◆ reset()

void sbl::dsp::pm::ThermalFriction::reset ( )
inline

Cold and stuck.

Definition at line 224 of file thermal_friction.hpp.

References sbl::dsp::types::SAMPLE_RATE_F.

Referenced by sbl::dsp::pm::HybridFriction::reset().

◆ describe()

diagram::Ports sbl::dsp::pm::ThermalFriction::describe ( diagram::Graph &  g,
uint8_t  group,
const char *  name = "bow (thermal)" 
) const
inline

One Junction node: the friction nonlinearity. Never called from audio code (AP-037).

Definition at line 232 of file thermal_friction.hpp.

References sbl::dsp::diagram::Graph::add_node(), sbl::dsp::diagram::Ports::group, sbl::dsp::diagram::Ports::in, sbl::dsp::diagram::Junction, and sbl::dsp::diagram::Ports::out.

Member Data Documentation

◆ DEFAULT_MU_RATIO

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_MU_RATIO = 0.35f / 1.2f
staticconstexpr

Rosin, as Woodhouse measured it: friction at full heat is this fraction of cold.

Note
All public methods are ISR-safe — bounded computation, no I/O.

Definition at line 95 of file thermal_friction.hpp.

Referenced by set_rosin().

◆ DEFAULT_HEAT

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_HEAT = 2000.0f
staticconstexpr

Fraction of the range per unit of (force · sliding speed) per second. Calibrated 2026-09-15 on the Davis Jr. string: Helmholtz at C3 with the body, C3–C5 bare (AP-040 Phase 4 addenda).

Definition at line 99 of file thermal_friction.hpp.

◆ DEFAULT_TAU_MS

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_TAU_MS = 10.0f
staticconstexpr

Conduction into the string and the bow: the slow component's time to cool by 1/e.

Definition at line 101 of file thermal_friction.hpp.

◆ DEFAULT_CONVECT

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_CONVECT = 0.0f
staticconstexpr

Convection: cold rosin flowing into the contact, per unit sliding speed per second.

Definition at line 103 of file thermal_friction.hpp.

◆ DEFAULT_COLD_GAIN

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_COLD_GAIN = 1.0f
staticconstexpr

The cold limit over the table's. 1: cold equals the table's limit. (Any more and this waveguide's stuck force, capped by loop loss at a few bow speeds, never reaches it.)

Definition at line 107 of file thermal_friction.hpp.

Referenced by set_rosin().

◆ DEFAULT_FAST_MS

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_FAST_MS = 0.5f
staticconstexpr

The fast cooling component: time constant and the share of heat it takes.

Definition at line 109 of file thermal_friction.hpp.

◆ DEFAULT_FAST_SHARE

constexpr float sbl::dsp::pm::ThermalFriction::DEFAULT_FAST_SHARE = 0.6f
staticconstexpr

Definition at line 110 of file thermal_friction.hpp.


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