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

A time-varying parallel gains processor. More...

#include <parallel_gains.h>

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

Public Member Functions

 TimeVaryingParallelGains (const ParallelGainsOptions &options)
 Constructs a TimeVaryingParallelGains processor.
 
void SetMode (ParallelGainsMode mode)
 Sets the processing mode.
 
void SetCenterGains (std::span< const float > gains)
 Sets the center gains for each channel.
 
void GetCenterGains (std::span< float > gains) const
 Gets the center gains for each channel.
 
void SetModulation (std::span< const ModulationOptions > modulation_configs)
 Sets the modulation options for each channel.
 
void SetLfoFrequency (std::span< const float > frequencies)
 Sets the LFO frequency for each channel.
 
void SetLfoAmplitude (std::span< const float > amplitudes)
 Sets the LFO amplitude for each channel.
 
void SetLfoPhaseOffset (std::span< const float > phase_offsets)
 Sets the LFO phase offset for each channel.
 
void Process (const AudioBuffer &input, AudioBuffer &output) noexcept override
 Processes the audio buffer.
 
uint32_t InputChannelCount () const override
 Gets the number of input channels.
 
uint32_t OutputChannelCount () const override
 Gets the number of output channels.
 
void Clear () override
 Clears the internal state of the processor.
 
std::unique_ptr< AudioProcessorClone () const override
 Creates a copy of the TimeVaryingParallelGains processor.
 
- Public Member Functions inherited from sfFDN::AudioProcessor

Detailed Description

A time-varying parallel gains processor.

Similar to ParallelGains but with time-varying gains modulated by LFOs.

Constructor & Destructor Documentation

◆ TimeVaryingParallelGains()

sfFDN::TimeVaryingParallelGains::TimeVaryingParallelGains ( const ParallelGainsOptions & options)

Constructs a TimeVaryingParallelGains processor.

Parameters
optionsThe options for the processor.

Member Function Documentation

◆ Clear()

void sfFDN::TimeVaryingParallelGains::Clear ( )
overridevirtual

Clears the internal state of the processor.

This function resets the phase of all LFOs to zero.

Implements sfFDN::AudioProcessor.

◆ Clone()

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

Creates a copy of the TimeVaryingParallelGains processor.

Returns
A unique pointer to the cloned TimeVaryingParallelGains processor.

Implements sfFDN::AudioProcessor.

◆ GetCenterGains()

void sfFDN::TimeVaryingParallelGains::GetCenterGains ( std::span< float > gains) const

Gets the center gains for each channel.

Parameters
gainsA span to store the gains. The size of the span must be equal to the number of gains set in SetGains().

◆ InputChannelCount()

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

Gets the number of input channels.

Implements sfFDN::AudioProcessor.

◆ OutputChannelCount()

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

Gets the number of output channels.

Implements sfFDN::AudioProcessor.

◆ Process()

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

Processes the audio buffer.

Parameters
inputThe input audio buffer.
outputThe output audio buffer. The input and output buffers must have the same number of samples. For ParallelGainsMode::Split, the input buffer must have 1 channels and the output buffer must have OutputChannelCount() channels. For ParallelGainsMode::Merge, the input buffer must have InputChannelCount() channels and the output buffer must have 1 channels. For ParallelGainsMode::Parallel, the input and output buffers must have the same number of channels equal to InputChannelCount() and OutputChannelCount().

Implements sfFDN::AudioProcessor.

◆ SetCenterGains()

void sfFDN::TimeVaryingParallelGains::SetCenterGains ( std::span< const float > gains)

Sets the center gains for each channel.

Parameters
gainsA span of center gains to apply to each channel. The size of the span must be equal to InputChannelCount() for ParallelGainsMode::Merge. The size of the span must be equal to OutputChannelCount() for ParallelGainsMode::Split. The size of the span must be equal to InputChannelCount() and OutputChannelCount() for ParallelGainsMode::Parallel.

◆ SetLfoAmplitude()

void sfFDN::TimeVaryingParallelGains::SetLfoAmplitude ( std::span< const float > amplitudes)

Sets the LFO amplitude for each channel.

Parameters
amplitudesA span of LFO amplitudes to apply to each channel. The size of the span must be equal to InputChannelCount() for ParallelGainsMode::Merge. The size of the span must be equal to OutputChannelCount() for ParallelGainsMode::Split. The size of the span must be equal to InputChannelCount() and OutputChannelCount() for ParallelGainsMode::Parallel.

The amplitude is the peak deviation from the center gain.

◆ SetLfoFrequency()

void sfFDN::TimeVaryingParallelGains::SetLfoFrequency ( std::span< const float > frequencies)

Sets the LFO frequency for each channel.

Parameters
frequenciesA span of LFO frequencies to apply to each channel. Frequencies are in cycles per sample. The size of the span must be equal to InputChannelCount() for ParallelGainsMode::Merge. The size of the span must be equal to OutputChannelCount() for ParallelGainsMode::Split. The size of the span must be equal to InputChannelCount() and OutputChannelCount() for ParallelGainsMode::Parallel.

◆ SetLfoPhaseOffset()

void sfFDN::TimeVaryingParallelGains::SetLfoPhaseOffset ( std::span< const float > phase_offsets)

Sets the LFO phase offset for each channel.

Parameters
phase_offsetsA span of LFO phase offsets to apply to each channel. Phase offsets are normalized [0, 1]. The size of the span must be equal to InputChannelCount() for ParallelGainsMode::Merge. The size of the span must be equal to OutputChannelCount() for ParallelGainsMode::Split. The size of the span must be equal to InputChannelCount() and OutputChannelCount() for ParallelGainsMode::Parallel.

◆ SetMode()

void sfFDN::TimeVaryingParallelGains::SetMode ( ParallelGainsMode mode)

Sets the processing mode.

Parameters
modeThe processing mode to use.

◆ SetModulation()

void sfFDN::TimeVaryingParallelGains::SetModulation ( std::span< const ModulationOptions > modulation_configs)

Sets the modulation options for each channel.

Parameters
modulation_configsA span of modulation options to apply to each channel.

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