5#include "sffdn/audio_buffer.h"
6#include "sffdn/audio_processor.h"
7#include "sffdn/delay.h"
8#include "sffdn/filterbank.h"
9#include "sffdn/oscillator.h"
10#include "sffdn/types.h"
75 float Tick(
float input)
noexcept SFFDN_NONBLOCKING;
82 void ProcessBlock(std::span<const float> in, std::span<float> out)
noexcept SFFDN_NONBLOCKING;
100 void Tick8(std::span<const float, 8> in, std::span<float, 8> out)
noexcept SFFDN_NONBLOCKING;
130 uint32_t
GetDelay() const noexcept SFFDN_NONBLOCKING
136 float GetG() const noexcept SFFDN_NONBLOCKING
142 float Tick(
float input)
noexcept SFFDN_NONBLOCKING;
149 float Tick(
float input,
float gain)
noexcept SFFDN_NONBLOCKING;
152 void ProcessBlock(std::span<const float> in, std::span<float> out)
noexcept SFFDN_NONBLOCKING;
259 bool parallel_ = false;
262std::unique_ptr<
FilterBank> MakeMultichannelSchroederAllpassSection(
288 bool parallel_{
false};
292std::unique_ptr<FilterBank> MakeMultichannelTimeVaryingSchroederAllpassSection(
293 const MultichannelTimeVaryingSchroederAllpassSectionOptions& options);
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:20
Base class for audio processors.
Definition audio_processor.h:24
A simple non-interpolating delay line implementation.
Definition delay.h:17
uint32_t GetDelay() const noexcept SFFDN_NONBLOCKING
Returns the current delay in samples.
Definition delay.h:50
Implements a bank of filters.
Definition filterbank.h:19
A section of Schroeder allpass filters in series.
Definition schroeder_allpass.h:168
void SetDelays(std::span< const uint32_t > delays)
Sets the delays for each allpass filter in the section.
SchroederAllpassSection(const SchroederAllpassSectionOptions &config)
Constructs a SchroederAllpassSection with a given configuration.
uint32_t InputChannelCount() const noexcept SFFDN_NONBLOCKING override
Gets the number of input channels supported.
void SetGains(std::span< const float > gains)
Sets the feedback gains for each allpass filter in the section.
std::unique_ptr< AudioProcessor > Clone() const override
Creates a copy of the SchroederAllpassSection.
void SetGain(float gain)
Sets the feedback gain for all allpass filters in the section.
std::vector< uint32_t > GetDelays() const
Gets the current delays for each allpass filter in the section.
void SetFilterCount(uint32_t filter_count)
Sets the number of allpass filters in the section.
SchroederAllpassSection & operator=(SchroederAllpassSection &&other) noexcept
Move assignment operator for the SchroederAllpassSection.
uint32_t OutputChannelCount() const noexcept SFFDN_NONBLOCKING override
Gets the number of output channels supported.
void SetParallel(bool parallel)
Sets whether the allpass filters in the section are processed in parallel.
void Clear() override
Clears the internal state of the processor.
SchroederAllpassSection()=default
Constructs an empty SchroederAllpassSection.
SchroederAllpassSection(SchroederAllpassSection &&other) noexcept
Move constructor for the SchroederAllpassSection.
void Process(const AudioBuffer &input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING override
Processes a block of audio through the section.
SchroederAllpassSection(uint32_t filter_count)
Constructs a SchroederAllpassSection with a given number of filters.
std::vector< float > GetGains() const
Gets the current feedback gains for each allpass filter in the section.
A single Schroeder allpass filter.
Definition schroeder_allpass.h:24
void SetDelay(uint32_t delay)
Sets the delay in samples.
SchroederAllpass(uint32_t delay, float g)
Constructs a SchroederAllpass filter.
float Tick(float input) noexcept SFFDN_NONBLOCKING
Processes a single sample through the filter.
SchroederAllpass(SchroederAllpass &&)=default
Move constructor for the SchroederAllpass filter.
void Clear()
Clears the filter state.
float GetG() const
Gets the filter gain.
Definition schroeder_allpass.h:66
void ProcessBlock(std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
Processes a block of samples through the filter.
SchroederAllpass()=default
Constructs a SchroederAllpass filter.
uint32_t GetDelay() const
Gets the current delay in samples.
Definition schroeder_allpass.h:60
void ProcessBlockAccumulate(std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
Processes a block of samples through the filter and accumulates the output.
SchroederAllpass & operator=(SchroederAllpass &&)=default
Move assignment operator for the SchroederAllpass filter.
void SetG(float g)
Sets the feedback gain.
A sine wave oscillator.
Definition oscillator.h:33
A single-channel section of energy-preserving time-varying Schroeder allpasses.
Definition schroeder_allpass.h:267
TimeVaryingSchroederAllpassSection(const TimeVaryingSchroederAllpassSectionOptions &config)
Constructs a section from its stage configurations.
An energy-preserving Schroeder allpass with a fixed delay and optionally modulated gain.
Definition schroeder_allpass.h:115
float GetG() const noexcept SFFDN_NONBLOCKING
Returns the base gain.
Definition schroeder_allpass.h:136
TimeVaryingSchroederAllpass(uint32_t delay, float gain, const ModulationOptions &modulation)
Constructs an allpass with sinusoidal gain modulation.
void ProcessBlockAccumulate(std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
Processes a block and accumulates the result in out.
void Clear()
Clears the delay state and restores the configured modulation phase.
float Tick(float input) noexcept SFFDN_NONBLOCKING
Processes one sample using the configured sinusoidally modulated gain.
uint32_t GetDelay() const noexcept SFFDN_NONBLOCKING
Returns the delay in samples.
Definition schroeder_allpass.h:130
float Tick(float input, float gain) noexcept SFFDN_NONBLOCKING
Processes one sample with an explicit valid gain in the open interval (-1, 1).
void ProcessBlock(std::span< const float > in, std::span< float > out) noexcept SFFDN_NONBLOCKING
Processes a block using the configured sinusoidally modulated gain.
void SetDelay(uint32_t delay)
Sets the fixed integer delay in samples.
Options for configuring signal modulation.
Definition types.h:180
Options for configuring a multichannel bank of Schroeder allpass sections.
Definition types.h:327
Options for configuring a Schroeder allpass section consisting of N Schroeder allpass in series or in...
Definition types.h:316
Options for configuring an energy-preserving time-varying Schroeder allpass section.
Definition types.h:337