|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
A linear ramp to a target over a fixed number of frames. More...
A linear ramp to a target over a fixed number of frames.
The de-zipper for a scalar port: a new target starts a straight line from the current value and arrives after the ramp's length in frames, whatever the block size. Setting the same target again does not restart a ramp in progress. head() is set() for a port: the first value a ramp is given is arrived at at once, so a component does not sweep from its constructor's value to its first setting. Below the signal transport; the length is frames, set by the component that owns it.
#include <ramp.hpp>
Public Member Functions | |
| Ramp (float value=0.0f) | |
| A ramp at rest at a value, with a length of 1 frame. | |
| void | set_length (uint16_t frames) |
| Set how many frames a ramp takes. | |
| void | set (float target) |
| Head for a target from the current value. | |
| void | head (float target) |
| set(), except that the first value given since construction, by head() or jump(), is arrived at at once. | |
| void | jump (float value) |
| Arrive at a value at once. | |
| float | step () |
| One frame. | |
| float | value () const |
| The current value. | |
| float | target () const |
| The value the ramp heads for. | |
| bool | ramping () const |
| True while a ramp is in progress. | |
|
inlineexplicit |
|
inline |
Set how many frames a ramp takes.
| frames | Ramp length in frames; 0 counts as 1 |
Definition at line 39 of file ramp.hpp.
Referenced by sbl::dsp::DryWet::DryWet(), sbl::dsp::Svf::Svf(), sbl::dsp::Vca::Vca(), and sbl::dsp::Vco::Vco().
|
inline |
Head for a target from the current value.
The same target again leaves a ramp in progress alone.
| target | The value to arrive at after the ramp's length |
Definition at line 48 of file ramp.hpp.
References target().
Referenced by head(), sbl::dsp::BlepOsc< Kernel >::process(), sbl::dsp::BlepOsc< Kernel >::set_blend(), sbl::dsp::BlepOsc< Kernel >::set_saw_knee(), and sbl::dsp::BlepOsc< Kernel >::set_triangle_peak().
|
inline |
set(), except that the first value given since construction, by head() or jump(), is arrived at at once.
For a scalar port: the first call jumps, later calls ramp.
| target | The value to head for |
Definition at line 64 of file ramp.hpp.
References jump(), set(), and target().
Referenced by sbl::dsp::Vca::process(), sbl::dsp::Svf::process(), and sbl::dsp::DryWet::process().
|
inline |
Arrive at a value at once.
| value | The new value and target |
Definition at line 77 of file ramp.hpp.
References value().
Referenced by head(), sbl::dsp::Vca::process(), sbl::dsp::Svf::process(), sbl::dsp::DryWet::process(), sbl::dsp::DryWet::reset(), sbl::dsp::Vca::reset(), sbl::dsp::Svf::reset(), sbl::dsp::BlepOsc< Kernel >::reset(), and sbl::dsp::Vco::reset().
|
inline |
One frame.
Definition at line 90 of file ramp.hpp.
Referenced by sbl::dsp::BlepOsc< Kernel >::process(), sbl::dsp::Vca::process(), sbl::dsp::Svf::process(), and sbl::dsp::DryWet::process().
|
inline |
The current value.
Definition at line 101 of file ramp.hpp.
Referenced by sbl::dsp::Vca::gain(), jump(), sbl::dsp::Vca::level_gain(), sbl::dsp::Vca::mod_amount(), sbl::dsp::Vco::pitch(), sbl::dsp::PmPulse::process(), and sbl::dsp::BlepOsc< Kernel >::reset().
|
inline |
The value the ramp heads for.
Definition at line 103 of file ramp.hpp.
Referenced by head(), sbl::dsp::DryWet::reset(), sbl::dsp::Vca::reset(), sbl::dsp::Svf::reset(), sbl::dsp::BlepOsc< Kernel >::reset(), sbl::dsp::Vco::reset(), and set().
|
inline |
True while a ramp is in progress.
Definition at line 105 of file ramp.hpp.
Referenced by sbl::dsp::PmPulse::process().