|
sfFDN
|
FDN (Feedback Delay Network) class. More...
#include <fdn.h>
Public Member Functions | |
| FDN (uint32_t order, uint32_t block_size=0, bool transpose=false) | |
| Constructs an FDN with a specified order (number of channels). | |
| FDN (const FDN &)=delete | |
| FDN & | operator= (const FDN &)=delete |
| FDN (FDN &&) noexcept | |
| Move constructor for the FDN. | |
| FDN & | operator= (FDN &&) noexcept |
| Move assignment operator for the FDN. | |
| void | SetOrder (uint32_t order) |
| Set the number of channels of the FDN. | |
| uint32_t | GetOrder () const |
| Get the FDN's order (number of channels). | |
| void | SetTranspose (bool transpose) |
| Set whether to use transposed configuration. | |
| bool | GetTranspose () const |
| Get whether the FDN is using transposed configuration. | |
| bool | SetInputGains (std::unique_ptr< AudioProcessor > gains) |
| Set the Input Gains AudioProcessor. | |
| bool | SetOutputGains (std::unique_ptr< AudioProcessor > gains) |
| Set the Output Gains AudioProcessor. | |
| bool | SetInputGains (std::span< const float > gains) |
| Set the Input Gains from a span of floats. | |
| bool | SetOutputGains (std::span< const float > gains) |
| Set the Output Gains from a span of floats. | |
| AudioProcessor * | GetInputGains () const |
| Get the Input Gains AudioProcessor. | |
| AudioProcessor * | GetOutputGains () const |
| Get the Output Gains AudioProcessor. | |
| void | SetDirectGain (float gain) |
| Set the direct gain applied to the input signal when mixed to the output. | |
| bool | SetLoopFilter (std::unique_ptr< AudioProcessor > filter_bank) |
| Set the Filter Bank AudioProcessor. | |
| AudioProcessor * | GetLoopFilter () const |
| Get the Filter Bank AudioProcessor. | |
| bool | SetDelayBank (const DelayBankOptions &config) |
| Set the delay bank. | |
| bool | SetDelays (const std::span< const float > delays, DelayInterpolationType interpolation_type=DelayInterpolationType::None) |
| Set the delays. | |
| const DelayBank & | GetDelayBank () const |
| Get the Delay Bank. | |
| bool | SetFeedbackMatrix (std::unique_ptr< AudioProcessor > mixing_matrix) |
| Set the Feedback Matrix AudioProcessor. | |
| AudioProcessor * | GetFeedbackMatrix () const |
| Get the Feedback Matrix AudioProcessor. | |
| bool | SetTCFilter (std::unique_ptr< AudioProcessor > filter) |
| Set the Tone Correction Filter AudioProcessor. | |
| AudioProcessor * | GetTCFilter () const |
| Get the Tone Correction Filter AudioProcessor. | |
| void | Process (const AudioBuffer &input, AudioBuffer &output) noexcept override |
| Process audio buffers. | |
| 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 state of the FDN. | |
| std::unique_ptr< AudioProcessor > | Clone () const override |
| Creates a copy of the FDN. | |
| std::unique_ptr< FDN > | CloneFDN () const |
| Creates a copy of the FDN. | |
Public Member Functions inherited from sfFDN::AudioProcessor | |
| sfFDN::FDN::FDN | ( | uint32_t | order, |
| uint32_t | block_size = 0, | ||
| bool | transpose = false ) |
Constructs an FDN with a specified order (number of channels).
| order | The number of channels. Must be at least 4. |
| block_size | The size of the audio blocks to be processed in the main loop. |
| transpose | Whether to use transposed configuration. |
block_size is used to allocate internal buffers for processing.
|
overridevirtual |
Clears the internal state of the FDN.
This function clears the internal state of all delay banks, filter banks, and feedback matrices.
Implements sfFDN::AudioProcessor.
|
overridevirtual |
Creates a copy of the FDN.
Implements sfFDN::AudioProcessor.
| std::unique_ptr< FDN > sfFDN::FDN::CloneFDN | ( | ) | const |
| const DelayBank & sfFDN::FDN::GetDelayBank | ( | ) | const |
| AudioProcessor * sfFDN::FDN::GetFeedbackMatrix | ( | ) | const |
Get the Feedback Matrix AudioProcessor.
| AudioProcessor * sfFDN::FDN::GetInputGains | ( | ) | const |
Get the Input Gains AudioProcessor.
| AudioProcessor * sfFDN::FDN::GetLoopFilter | ( | ) | const |
Get the Filter Bank AudioProcessor.
| uint32_t sfFDN::FDN::GetOrder | ( | ) | const |
Get the FDN's order (number of channels).
| AudioProcessor * sfFDN::FDN::GetOutputGains | ( | ) | const |
Get the Output Gains AudioProcessor.
| AudioProcessor * sfFDN::FDN::GetTCFilter | ( | ) | const |
Get the Tone Correction Filter AudioProcessor.
| bool sfFDN::FDN::GetTranspose | ( | ) | const |
|
inlineoverridevirtual |
Returns the number of input channels this processor expects.
Implements sfFDN::AudioProcessor.
|
inlineoverridevirtual |
Returns the number of output channels this processor produces.
Implements sfFDN::AudioProcessor.
|
overridevirtualnoexcept |
Process audio buffers.
| input | The input audio buffer. Must be mono (1 channel). |
| output | The output audio buffer. Must be mono (1 channel). |
The input and output buffers must have the same sample count. input.SampleCount() does not have to be equal to block_size but it is recommended for optimal performance.
Implements sfFDN::AudioProcessor.
| bool sfFDN::FDN::SetDelayBank | ( | const DelayBankOptions & | config | ) |
Set the delay bank.
| config | The configuration for the delay bank. |
| bool sfFDN::FDN::SetDelays | ( | const std::span< const float > | delays, |
| DelayInterpolationType | interpolation_type = DelayInterpolationType::None ) |
Set the delays.
| delays | A span of delay lengths in samples. The size of the span must be equal to GetOrder(). |
| interpolation_type | The type of interpolation to use for the delays. |
| bool sfFDN::FDN::SetFeedbackMatrix | ( | std::unique_ptr< AudioProcessor > | mixing_matrix | ) |
Set the Feedback Matrix AudioProcessor.
| mixing_matrix | The AudioProcessor to use as the feedback matrix. The FDN takes ownership of the pointer. Can be nullptr to disable mixing. |
| bool sfFDN::FDN::SetInputGains | ( | std::span< const float > | gains | ) |
Set the Input Gains from a span of floats.
| gains | A span of floats representing the gains for each channel. The size of the span must be equal to GetOrder(). |
Returns false if the size of the span does not match GetOrder(). This is a convenience method that creates a ParallelGains processor in Split mode with the specified gains.
| bool sfFDN::FDN::SetInputGains | ( | std::unique_ptr< AudioProcessor > | gains | ) |
Set the Input Gains AudioProcessor.
| gains | The AudioProcessor to use for input gains. Must have 1 input channel and number of output channels equal to GetOrder(). The FDN takes ownership of the pointer. |
False is returned if the input and output channel counts do not match the requirements.
| bool sfFDN::FDN::SetLoopFilter | ( | std::unique_ptr< AudioProcessor > | filter_bank | ) |
Set the Filter Bank AudioProcessor.
The filter bank is applied inside the feedback loop, after the delay lines. Also known as attenuation or absorption filters.
| filter_bank | The AudioProcessor to use as the filter bank. The FDN takes ownership of the pointer. Can be nullptr to disable filtering. |
| void sfFDN::FDN::SetOrder | ( | uint32_t | order | ) |
| bool sfFDN::FDN::SetOutputGains | ( | std::span< const float > | gains | ) |
Set the Output Gains from a span of floats.
| gains | A span of floats representing the gains for each channel. The size of the span must be equal to GetOrder(). |
Returns false if the size of the span does not match GetOrder().
This is a convenience method that creates a ParallelGains processor in Merge mode with the specified gains.
| bool sfFDN::FDN::SetOutputGains | ( | std::unique_ptr< AudioProcessor > | gains | ) |
Set the Output Gains AudioProcessor.
| gains | The AudioProcessor to use for output gains. Must have number of input channels equal to GetOrder() and 1 output channel. The FDN takes ownership of the pointer. |
False is returned if the input and output channel counts do not match the requirements.
| bool sfFDN::FDN::SetTCFilter | ( | std::unique_ptr< AudioProcessor > | filter | ) |
Set the Tone Correction Filter AudioProcessor.
The Tone correction filter is applied to the output of the FDN, after the output gains.
| filter | The AudioProcessor to use as the tone correction filter. The FDN takes ownership of the pointer. Can be nullptr to disable filtering. |
| void sfFDN::FDN::SetTranspose | ( | bool | transpose | ) |
Set whether to use transposed configuration.
| transpose | true to use transposed configuration, false otherwise. |
In transposed configuration, the input signal is fed to the feedback matrix first and the output of the feedback matrix is fed to the output of the FDN.