|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
#include <bow.hpp>
Public Member Functions | |
| Bow () | |
| Law & | law () |
| The law, for its own parameters (a table, a rosin). | |
| const Law & | law () const |
| void | set_velocity_su (float su) |
| How fast the bow travels across the string. Smoothed. | |
| void | set_pressure_su (float su) |
| How hard it presses: which force slice the law reads. Zero is no contact. Smoothed. | |
| void | advance (uint16_t n) |
| A block's worth of port movement. | |
| float | excite (const JunctionState &j) |
| One sample: the force on the string for the junction's state. | |
| float | energy () const |
| A bow stores nothing: it only does work on the string. | |
| void | reset () |
| bool | sticking () const |
| True while the bow holds the string (with weight on it). | |
| float | limit () const |
| The static limit the bow holds the string with right now, in wave units. | |
| float | force () const |
| The force injected on the last sample, in wave units. | |
| diagram::Ports | describe (diagram::Graph &g, uint8_t group, const char *name="bow") const |
| The velocity source into the friction junction. Never called from audio code. | |
Static Public Attributes | |
| static constexpr float | DEFAULT_VELOCITY_SU = 0.5f |
| static constexpr float | DEFAULT_PRESSURE_SU = 0.5f |
| static constexpr float | MAX_VELOCITY = 0.5f |
| wave units at full speed | |
| static constexpr float | SMOOTH_MS = 20.0f |
| static constexpr float | MIN_PRESSURE_SU = 0.001f |
|
inline |
Definition at line 48 of file bow.hpp.
References sbl::dsp::pm::Bow< Law >::DEFAULT_PRESSURE_SU, sbl::dsp::pm::Bow< Law >::DEFAULT_VELOCITY_SU, sbl::dsp::pm::Bow< Law >::reset(), and sbl::dsp::primitives::SmoothedPort::set().
|
inline |
|
inline |
|
inline |
How fast the bow travels across the string. Smoothed.
Definition at line 61 of file bow.hpp.
References sbl::dsp::math::clamp01(), and sbl::dsp::primitives::SmoothedPort::set().
|
inline |
How hard it presses: which force slice the law reads. Zero is no contact. Smoothed.
Definition at line 64 of file bow.hpp.
References sbl::dsp::math::clamp01(), and sbl::dsp::primitives::SmoothedPort::set().
|
inline |
A block's worth of port movement.
Definition at line 69 of file bow.hpp.
References sbl::dsp::primitives::SmoothedPort::advance(), sbl::dsp::pm::Bow< Law >::MAX_VELOCITY, and sbl::dsp::pm::Bow< Law >::MIN_PRESSURE_SU.
Referenced by sbl::dsp::pm::BowSet::advance().
|
inline |
One sample: the force on the string for the junction's state.
Definition at line 77 of file bow.hpp.
References sbl::dsp::pm::JunctionState::impedance, sbl::dsp::primitives::SoftLimiter::limit(), and sbl::dsp::pm::JunctionState::velocity.
|
inline |
|
inline |
Definition at line 87 of file bow.hpp.
References sbl::dsp::pm::Bow< Law >::MAX_VELOCITY, sbl::dsp::pm::Bow< Law >::MIN_PRESSURE_SU, sbl::dsp::types::SAMPLE_RATE_F, sbl::dsp::pm::Bow< Law >::SMOOTH_MS, and sbl::dsp::primitives::SmoothedPort::value().
Referenced by sbl::dsp::pm::Bow< Law >::Bow(), and sbl::dsp::pm::BowSet::reset().
|
inline |
|
inline |
|
inline |
|
inline |
The velocity source into the friction junction. Never called from audio code.
Definition at line 109 of file bow.hpp.
References sbl::dsp::diagram::Graph::add_edge(), sbl::dsp::diagram::Graph::add_node(), sbl::dsp::diagram::Ports::in, sbl::dsp::diagram::Source, and sbl::dsp::diagram::Velocity.
|
staticconstexpr |
Definition at line 40 of file bow.hpp.
Referenced by sbl::dsp::pm::Bow< Law >::Bow().
|
staticconstexpr |
Definition at line 41 of file bow.hpp.
Referenced by sbl::dsp::pm::Bow< Law >::Bow().
|
staticconstexpr |
wave units at full speed
Definition at line 42 of file bow.hpp.
Referenced by sbl::dsp::pm::Bow< Law >::advance(), and sbl::dsp::pm::Bow< Law >::reset().
|
staticconstexpr |
Definition at line 43 of file bow.hpp.
Referenced by sbl::dsp::pm::Bow< Law >::reset().
|
staticconstexpr |
Below this the bow is off the string. A smoothed port only approaches zero, so "no pressure" has to be a threshold; the lightest bow is this.
Definition at line 46 of file bow.hpp.
Referenced by sbl::dsp::pm::Bow< Law >::advance(), and sbl::dsp::pm::Bow< Law >::reset().