|
| | inertia (const Ramp &_ramp, float init_value=0.f) |
| void | set_now (float _value) |
| | Set value immediately (no inertia).
|
| void | set_inertia (float source) |
| | Set with inertia.
|
| float | get (float source) |
| | Get smoothed value of given source value.
|
| float | get () |
| | Get smoothed value assuming no new input.
|
| void | step () |
| | Do one inertia step, without returning the new value and without changing destination value.
|
| void | step_many (unsigned int steps) |
| | Do many inertia steps, without returning the new value and without changing destination value.
|
| float | get_last () const |
| | Get last smoothed value, without affecting anything.
|
| bool | active () const |
| | Is it still ramping?
|
template<class Ramp>
class dsp::inertia< Ramp >
Generic inertia using ramping algorithm specified as template argument. The basic idea is producing smooth(ish) output for discrete input, using specified algorithm to go from last output value to input value. It is not the same as classic running average lowpass filter, because ramping time is finite and pre-determined (it calls ramp algorithm's length() function to obtain the expected ramp length)