6#ifndef SBL_DSP_PRIMITIVES_CROSSFADE_RAMP_HPP_
7#define SBL_DSP_PRIMITIVES_CROSSFADE_RAMP_HPP_
18 void begin(
float target, uint16_t n) {
19 step_ = (target - value_) /
static_cast<float>(n);
24 float next() {
return value_ += step_; }
27 void end() { value_ = end_; }
29 float value()
const {
return value_; }
void end()
Close the block exactly on its target, so rounding never drifts.
void begin(float target, uint16_t n)
Start a block that ends at target after n steps.
float next()
The value for the next sample.
Stateful, single-concern building blocks.