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::BowedString< Bow, Body, MaxPeriod > Class Template Reference

Detailed Description

template<typename Bow, typename Body, uint16_t MaxPeriod = 1536>
class sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >

Definition at line 36 of file bowed_string.hpp.

#include <bowed_string.hpp>

Inheritance diagram for sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >:
[legend]

Public Member Functions

 BowedString (Bow &bow, Body &body)
 
void use_body (bool on)
 The body at the bridge, or the bare string with a rigid bridge.
 
bool has_body () const
 
void set_bow_position_su (float su)
 Where the bow sits along the string (StringBase::set_position_su).
 
void set_body_mix_su (float su)
 What is heard: 0 the body, 1 the bare string (StringBase::set_pickup_su).
 
Bow & bow ()
 
Body & body ()
 
- Public Member Functions inherited from sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >
 StringBase (Exciter &exciter, Load &load, const char *name="String")
 
void use_load (bool on)
 End b terminates on the load (true) or on a wall (false). The junction starts at rest.
 
bool loaded () const
 
Exciter & exciter ()
 The parts, for whoever owns them and for tools.
 
Load & load ()
 
const StringLoop & loop () const
 
const LoadJunction< Load > & end_b () const
 
void set_pitch_su (float su)
 Pitch across C1..C9 (math::note_of_su). Smoothed.
 
void set_position_su (float su)
 Where the exciter sits along the string.
 
void set_damping_su (float su)
 Loss filter cutoff: how fast the high partials give up. Smoothed.
 
void set_pickup_su (float su)
 What is heard: 0 the load, 1 the bare string, a crossfade between.
 
void process (float *out, uint16_t n)
 
void reset ()
 The string at rest, its ports already at their targets rather than gliding to them.
 
void describe (diagram::Graph &g) const
 The whole string as wired: exciter, loop, end b, pickup (AP-037)
 
float period_samples () const
 The loop period the string is currently tuned to, in samples.
 
float energy () const
 Energy in the loop, the load and the exciter. Never called from audio code.
 

Additional Inherited Members

- Static Public Attributes inherited from sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >
static constexpr float DEFAULT_PITCH_SU = 0.375f
 
static constexpr float DEFAULT_POSITION_SU = 0.556f
 junction 0.3
 
static constexpr float DEFAULT_DAMPING_SU = 0.6f
 
static constexpr float DEFAULT_PICKUP_SU = 0.0f
 all load
 
- Protected Member Functions inherited from sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >
void update_period (float pitch_su)
 
void apply_position (float position_su)
 
void apply_damping (float damping_su)
 
- Protected Attributes inherited from sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >
const char * name_
 
float buf_a_ [MaxPeriod] = {}
 the loop's segment to end a
 
float buf_b_ [MaxPeriod] = {}
 and to end b
 
StringLoop loop_
 
Exciter & exciter_
 
Load & load_
 
LoadJunction< Load > end_b_
 
bool loaded_ = true
 
primitives::SmoothedPort pitch_
 
primitives::SmoothedPort position_
 
primitives::SmoothedPort damping_
 
primitives::SmoothedPort pickup_
 
primitives::CrossfadeRamp mix_
 
primitives::BlockGuard guard_
 
float last_period_ = -1.0f
 
float last_junction_ = -1.0f
 
float last_damping_ = -1.0f
 
- Static Protected Attributes inherited from sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >
static constexpr float SMOOTH_MS = 20.0f
 
static constexpr float MIN_JUNCTION = 0.05f
 
static constexpr float MAX_JUNCTION = 0.5f
 
static constexpr float LOOP_GAIN = 0.999f
 energy lost at end b each trip
 
static constexpr float PERIOD_MARGIN = 4.0f
 headroom under MaxPeriod for the split
 
static constexpr float RETUNE_THRESHOLD = 1e-4f
 samples of period change worth a retune
 

Constructor & Destructor Documentation

◆ BowedString()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::BowedString ( Bow &  bow,
Body &  body 
)
inline

Definition at line 40 of file bowed_string.hpp.

Member Function Documentation

◆ use_body()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
void sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::use_body ( bool  on)
inline

The body at the bridge, or the bare string with a rigid bridge.

Definition at line 43 of file bowed_string.hpp.

References sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >::use_load().

◆ has_body()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
bool sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::has_body ( ) const
inline

◆ set_bow_position_su()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
void sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::set_bow_position_su ( float  su)
inline

Where the bow sits along the string (StringBase::set_position_su).

Definition at line 47 of file bowed_string.hpp.

References sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >::set_position_su().

◆ set_body_mix_su()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
void sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::set_body_mix_su ( float  su)
inline

What is heard: 0 the body, 1 the bare string (StringBase::set_pickup_su).

Definition at line 50 of file bowed_string.hpp.

References sbl::dsp::pm::StringBase< Exciter, Load, MaxPeriod >::set_pickup_su().

◆ bow()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
Bow & sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::bow ( )
inline

◆ body()

template<typename Bow , typename Body , uint16_t MaxPeriod = 1536>
Body & sbl::dsp::pm::BowedString< Bow, Body, MaxPeriod >::body ( )
inline

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