6#include "audio_buffer.h"
24 Delay(uint32_t delay = 0, uint32_t max_delay = 4095);
47 void SetDelay(uint32_t delay) noexcept SFFDN_NONBLOCKING;
50 uint32_t
GetDelay() const noexcept SFFDN_NONBLOCKING
59 float LastOut() const noexcept SFFDN_NONBLOCKING;
65 float NextOut() const noexcept SFFDN_NONBLOCKING;
72 float Tick(
float input) noexcept SFFDN_NONBLOCKING;
79 float TapOut(uint32_t tap) const noexcept SFFDN_NONBLOCKING;
98 bool AddNextInputs(std::span<const
float> input) noexcept SFFDN_NONBLOCKING;
118 std::span<
float> coeffs) noexcept SFFDN_NONBLOCKING;
147 uint32_t size) noexcept SFFDN_NONBLOCKING;
161 void AdvanceRead(uint32_t sample_count) noexcept SFFDN_NONBLOCKING;
164 size_t GetAvailableReadCount() const noexcept SFFDN_NONBLOCKING;
165 size_t GetAvailableWriteCount() const noexcept SFFDN_NONBLOCKING;
170 std::vector<
float> buffer_;
A class representing an audio buffer with multiple channels of non-interleaved audio data.
Definition audio_buffer.h:20
A simple non-interpolating delay line implementation.
Definition delay.h:17
float Tick(float input) noexcept SFFDN_NONBLOCKING
Processes the next input sample.
uint32_t GetMaximumDelay() const noexcept SFFDN_NONBLOCKING
Gets the maximum delay-line length.
void AdvanceWrite(uint32_t sample_count) noexcept SFFDN_NONBLOCKING
Advances the write pointer of the delay line by a specified number of samples.
uint32_t GetDelay() const noexcept SFFDN_NONBLOCKING
Returns the current delay in samples.
Definition delay.h:50
std::span< float > GetNextOutputBuffers(uint32_t size) noexcept SFFDN_NONBLOCKING
Get a span pointing to the next writable region of the buffer.
std::span< float > GetNextInputBuffers(uint32_t size) noexcept SFFDN_NONBLOCKING
Get a span pointing to the next writable region of the buffer.
void GetNextOutputsAt(std::span< uint32_t > taps, std::span< float > output, std::span< float > coeffs) noexcept SFFDN_NONBLOCKING
Gets the next output samples from the delay line at specific tap points.
bool AddNextInputs(std::span< const float > input) noexcept SFFDN_NONBLOCKING
Adds the next input samples to the delay line.
float NextOut() const noexcept SFFDN_NONBLOCKING
Returns the next output sample.
void AdvanceRead(uint32_t sample_count) noexcept SFFDN_NONBLOCKING
Advances the read pointer of the delay line by a specified number of samples.
void SetDelay(uint32_t delay) noexcept SFFDN_NONBLOCKING
Sets the delay for the delay line.
bool CanAddNextInputs(size_t sample_count) const noexcept SFFDN_NONBLOCKING
Returns whether the complete input block can be added without overwriting unread samples.
void GetNextReadAndWriteBuffers(std::span< float > &read_buffer, std::span< float > &write_buffer, uint32_t size) noexcept SFFDN_NONBLOCKING
Gets the next read and write buffers for the delay line.
float TapOut(uint32_t tap) const noexcept SFFDN_NONBLOCKING
Taps the output of the delay line at a specific point.
Delay(uint32_t delay=0, uint32_t max_delay=4095)
Constructs a delay line with a specified delay and maximum delay.
void GetNextOutputs(std::span< float > output) noexcept SFFDN_NONBLOCKING
Gets the next output samples from the delay line.
void Process(AudioBuffer input, AudioBuffer &output) noexcept SFFDN_NONBLOCKING
Processes a block of input samples.
void Clear()
Clears the delay line, resetting the internal buffer.
float LastOut() const noexcept SFFDN_NONBLOCKING
Returns the last output sample from the delay line.
void SetMaximumDelay(uint32_t delay)
Sets the maximum delay for the delay line.