6#ifndef SBL_DSP_FILTERS_ONE_POLE_HPP_
7#define SBL_DSP_FILTERS_ONE_POLE_HPP_
47 static float coefficient_for(
float cutoff_cycles_per_frame,
float frames = 1.0f) {
48 const float turns = cutoff_cycles_per_frame * frames;
49 if (!(turns > 0.0f) || !std::isfinite(turns)) {
98 void process(
const float* in,
float* out, uint16_t frames) {
99 for (uint16_t i = 0; i < frames; ++i) {
A one-pole low-pass, exact for an input that holds through the frame.
void set_cutoff(float cycles_per_frame)
Set the cutoff for the one-frame calls.
float value() const
The current output.
static float coefficient_for(float cutoff_cycles_per_frame, float frames=1.0f)
The coefficient for a cutoff over a time: 1 - e^(-2 pi cutoff frames), in [0, 1).
void process(const float *in, float *out, uint16_t frames)
A buffer of frames. In place is fine: out may be in.
static constexpr transport::Parameter< OnePole > PARAMETERS[]
The parameters, for tools.
float process(float x)
One frame.
float coefficient() const
The coefficient the one-frame calls use.
float process(float x, float coefficient)
An advance by the time coefficient was worked for, toward an input that holds through it.
void reset(float value=0.0f)
The output jumps to a value.
The numbers every layer reaches for.
The processing call's shape as a checked contract.