|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 24 of file parameter_smoother.hpp.
#include <parameter_smoother.hpp>
Public Member Functions | |
| void | set_coefficient (float a) |
| Set coefficient directly. | |
| void | set_time_ms (float ms, float rate_hz) |
| Compute coefficient from settling time in milliseconds. | |
| float | process (float target) |
| Process one sample toward target. | |
| float | process_steps (float target, uint32_t n) |
| Advance n steps toward target in one call. | |
| float | value () const |
| Current smoothed value. | |
| float | coefficient () const |
| Current coefficient. | |
| void | reset () |
| Reset to zero. | |
| void | reset (float initial) |
| Reset to a specific value. | |
|
inline |
Set coefficient directly.
a = 0.0 → hold previous output, 1.0 → instant (no smoothing).
Definition at line 33 of file parameter_smoother.hpp.
|
inline |
Compute coefficient from settling time in milliseconds.
Sets coefficient so the smoother reaches ~95% of a step change in the given time at the given update rate.
| ms | Settling time in milliseconds (95% of step) |
| rate_hz | Update rate in Hz (e.g., 1000 for block-rate at 1kHz) |
Definition at line 44 of file parameter_smoother.hpp.
References sbl::dsp::math::one_minus_exp_neg().
Referenced by sbl::dsp::comp::Pan::Pan(), and sbl::dsp::primitives::SmoothedPort::set_time_ms().
|
inline |
Process one sample toward target.
| target | The value to approach |
Definition at line 60 of file parameter_smoother.hpp.
Referenced by sbl::dsp::comp::Pan::process(), sbl::dsp::modules::Ladder::process(), sbl::dsp::widgets::Shaper::process(), sbl::dsp::comp::Fader::process(), sbl::dsp::comp::Fader::process(), sbl::dsp::comp::Pan::process(), sbl::dsp::modules::AlgoReverb< ScalePercent >::process(), and sbl::dsp::modules::TapeDelay::process().
|
inline |
Advance n steps toward target in one call.
Exactly equivalent to n consecutive process() calls. Lets a smoother whose coefficient was computed for a per-sample rate be advanced at block rate without stretching its settling time — pass the block size as n.
| target | The value to approach |
| n | Number of steps to advance |
Definition at line 77 of file parameter_smoother.hpp.
Referenced by sbl::dsp::primitives::SmoothedPort::advance(), and sbl::dsp::comp::Fader::tick().
|
inline |
Current smoothed value.
Definition at line 85 of file parameter_smoother.hpp.
Referenced by sbl::dsp::comp::Fader::gain(), sbl::dsp::comp::Pan::position(), and sbl::dsp::widgets::Shaper::process().
|
inline |
Current coefficient.
Definition at line 88 of file parameter_smoother.hpp.
|
inline |
Reset to zero.
Definition at line 91 of file parameter_smoother.hpp.
Referenced by sbl::dsp::comp::Pan::Pan(), sbl::dsp::modules::TapeDelay::process(), sbl::dsp::comp::Fader::reset(), sbl::dsp::comp::Pan::reset(), sbl::dsp::modules::AlgoReverb< ScalePercent >::reset(), sbl::dsp::primitives::SmoothedPort::reset(), sbl::dsp::comp::Pan::reset(), sbl::dsp::modules::Ladder::set_drive_su(), sbl::dsp::widgets::Shaper::set_drive_su(), sbl::dsp::modules::TapeDelay::set_feedback_su(), and sbl::dsp::widgets::Shaper::set_mix_su().
|
inline |
Reset to a specific value.
Definition at line 94 of file parameter_smoother.hpp.