sfFDN
Loading...
Searching...
No Matches
sfFDN::DelayBank Class Reference

A bank of parallel delay lines, each with its own delay setting. More...

#include <delaybank.h>

Inheritance diagram for sfFDN::DelayBank:
[legend]
Collaboration diagram for sfFDN::DelayBank:
[legend]

Public Member Functions

 DelayBank (const DelayBankOptions &config={})
 Constructs a delay bank with a specified set of delays and block size.
 
void SetDelays (const std::span< const float > delays, uint32_t block_size=512)
 Sets the delay values for each channel in the delay bank.
 
std::vector< float > GetDelays () const
 Returns the current delays for each delay line in the bank.
 
uint32_t InputChannelCount () const override
 Returns the number of input channels this processor expects.
 
uint32_t OutputChannelCount () const override
 Returns the number of output channels this processor produces.
 
void Clear () override
 Clears the internal delay buffers.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes a block of multi-channel audio.
 
void AddNextInputs (const AudioBuffer &input)
 Adds the next input samples to each delay line in the bank.
 
void GetNextOutputs (AudioBuffer &output)
 Retrieves the next output samples from each delay line in the bank.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the delay bank.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

A bank of parallel delay lines, each with its own delay setting.

Used for processing multiple channels of audio with different delays.

Note
The delay lines are instances of the Delay class, which is a non-interpolating delay line.

Constructor & Destructor Documentation

◆ DelayBank()

sfFDN::DelayBank::DelayBank ( const DelayBankOptions & config = {})

Constructs a delay bank with a specified set of delays and block size.

Parameters
configThe configuration for the delay bank.
Note
block_size is used to determine the optimal size of the internal buffers for each delay line.

Member Function Documentation

◆ AddNextInputs()

void sfFDN::DelayBank::AddNextInputs ( const AudioBuffer & input)

Adds the next input samples to each delay line in the bank.

Parameters
inputThe input audio buffer containing samples for each channel.
Note
The input buffer must have a channel count equal to the number of delay lines in the bank.

◆ Clear()

void sfFDN::DelayBank::Clear ( )
overridevirtual

Clears the internal delay buffers.

This sets all delay buffers to zero.

Implements sfFDN::AudioProcessor.

◆ Clone()

std::unique_ptr< AudioProcessor > sfFDN::DelayBank::Clone ( ) const
overridevirtual

Creates a copy of the delay bank.

Returns
A unique pointer to the cloned delay bank.

Implements sfFDN::AudioProcessor.

◆ GetDelays()

std::vector< float > sfFDN::DelayBank::GetDelays ( ) const

Returns the current delays for each delay line in the bank.

Returns
A vector of delay values for each channel.

◆ GetNextOutputs()

void sfFDN::DelayBank::GetNextOutputs ( AudioBuffer & output)

Retrieves the next output samples from each delay line in the bank.

Parameters
outputThe output audio buffer to fill with the next samples.
Note
The output buffer must have a channel count equal to the number of delay lines in the bank.

◆ InputChannelCount()

uint32_t sfFDN::DelayBank::InputChannelCount ( ) const
overridevirtual

Returns the number of input channels this processor expects.

Returns
The number of input channels.
Note
This is equal to the number of delay lines in the bank.

Implements sfFDN::AudioProcessor.

◆ OutputChannelCount()

uint32_t sfFDN::DelayBank::OutputChannelCount ( ) const
overridevirtual

Returns the number of output channels this processor produces.

Returns
The number of output channels.
Note
This is equal to the number of delay lines in the bank.

Implements sfFDN::AudioProcessor.

◆ Process()

void sfFDN::DelayBank::Process ( const AudioBuffer & input,
AudioBuffer & output )
overridevirtualnoexcept

Processes a block of multi-channel audio.

Parameters
inputThe input audio buffer.
outputThe output audio buffer.
Note
The input and output buffers must have the same sample count and a channel count equal to the number of delay lines in the bank.

Implements sfFDN::AudioProcessor.

◆ SetDelays()

void sfFDN::DelayBank::SetDelays ( const std::span< const float > delays,
uint32_t block_size = 512 )

Sets the delay values for each channel in the delay bank.

Parameters
delaysA span of delay values in samples for each channel. The size of the span determines the number of channels in the delay bank.
block_sizeThe block size for processing audio. This is used to determine the optimal size of the internal buffers for each delay line and can affect performance.
Note
block_size is used to determine the optimal size of the internal buffers for each delay line.

The documentation for this class was generated from the following file: