quantumVERB  1.0.0
A FOSS convolution reverb plugin
reverb::Filter Class Referenceabstract

#include <Filter.h>

Inheritance diagram for reverb::Filter:
Collaboration diagram for reverb::Filter:

Public Types

using Ptr = std::shared_ptr< Filter >
 
- Public Types inherited from reverb::Task
using Ptr = std::shared_ptr< Task >
 

Public Member Functions

 Filter (juce::AudioProcessor *processor, float freq=1000.0f, float q=0.71f, float gain=1.5f)
 Constructs a Filter object with optional frequency/gain/Q parameters. More...
 
virtual void updateParams (const juce::AudioProcessorValueTreeState &params, const juce::String &blockId) override
 Updates parameters from processor parameter tree. More...
 
virtual AudioBlock exec (AudioBlock ir) override
 Filters the audio in AudioSampleBuffer. More...
 
float getAmplitude (float freq)
 Returns the filter absolute amplitude response at a given frequency. More...
 
float getdBAmplitude (float freq)
 Returns the filter amplitude response in dB at a given frequency. More...
 
- Public Member Functions inherited from reverb::Task
 Task (juce::AudioProcessor *processor)
 
virtual bool needsToRun () const
 Tells caller whether block must be run for current block. More...
 
virtual void updateSampleRate (double sr)
 Update sample rate for task block. More...
 

Static Public Member Functions

static float todB (float m)
 
static float invdB (float dB)
 

Protected Member Functions

void setFrequency (float)
 Sets the filter frequency and updates the IIR filter coefficients (Meant to be used by Equalizer class) More...
 
void setQ (float)
 Sets the filter Q factor and updates the IIR filter coefficients (Meant to be used by Equalizer class) More...
 
void setGain (float)
 Sets the filter band gain and updates the IIR filter coefficients (Meant to be used by Equalizer class) More...
 
virtual void buildFilter ()=0
 
- Protected Member Functions inherited from reverb::Task
float getParam (const juce::AudioProcessorValueTreeState &params, const juce::String &blockId) const
 Internal method used to get (and check) a parameter's value.
 

Protected Attributes

float frequency
 
float Q
 
float gainFactor
 
- Protected Attributes inherited from reverb::Task
juce::AudioProcessor * processor
 
bool mustExec = true
 

Friends

class Equalizer
 
class EqualizerMocked
 

Additional Inherited Members

- Public Attributes inherited from reverb::Task
double sampleRate
 

Detailed Description

The Filter class is the abstract class from which the three filter types of the plugin are derived.

Definition at line 24 of file Filter.h.

Constructor & Destructor Documentation

◆ Filter()

reverb::Filter::Filter ( juce::AudioProcessor *  processor,
float  freq = 1000.0f,
float  q = 0.71f,
float  gain = 1.5f 
)

Constructs a Filter object with optional frequency/gain/Q parameters.

The Filter object is constructed from the processor pointer and from the optional frequency/gain/Q parameters. The frequency is the cut-off frequency of the derived LowShelfFilter/HighShelfFilter and the center frequency of the PeakFilter class.

Parameters
[in]processorPointer to main processor
[in]freqBand frequency
[in]gainBand gain
[in]qQ factor

Definition at line 29 of file Filter.cpp.

Member Function Documentation

◆ exec()

AudioBlock reverb::Filter::exec ( AudioBlock  ir)
overridevirtual

Filters the audio in AudioSampleBuffer.

This function filters an AudioBuffer using the IIR filter's coefficients

Parameters
[in,out]irContains the audio to be filtered, the output is placed in that same buffer

Implements reverb::Task.

Definition at line 81 of file Filter.cpp.

◆ getAmplitude()

float reverb::Filter::getAmplitude ( float  freq)

Returns the filter absolute amplitude response at a given frequency.

Parameters
[in]freqFrequency at which the filter magnitude is evaluated

Definition at line 109 of file Filter.cpp.

◆ getdBAmplitude()

float reverb::Filter::getdBAmplitude ( float  freq)

Returns the filter amplitude response in dB at a given frequency.

Parameters
[in]freqFrequency at which the filter magnitude is evaluated
Returns
Filter amplitude response in dB

Definition at line 142 of file Filter.cpp.

◆ setFrequency()

void reverb::Filter::setFrequency ( float  freq)
protected

Sets the filter frequency and updates the IIR filter coefficients (Meant to be used by Equalizer class)

Parameters
[in]freqFrequency to be set

Definition at line 155 of file Filter.cpp.

◆ setGain()

void reverb::Filter::setGain ( float  gain)
protected

Sets the filter band gain and updates the IIR filter coefficients (Meant to be used by Equalizer class)

Parameters
[in]freqBand gain to be set

Definition at line 184 of file Filter.cpp.

◆ setQ()

void reverb::Filter::setQ ( float  q)
protected

Sets the filter Q factor and updates the IIR filter coefficients (Meant to be used by Equalizer class)

Parameters
[in]freqQ factor to be set

Definition at line 170 of file Filter.cpp.

◆ updateParams()

void reverb::Filter::updateParams ( const juce::AudioProcessorValueTreeState &  params,
const juce::String &  blockId 
)
overridevirtual

Updates parameters from processor parameter tree.

Parameters
[in]paramsProcessor parameter tree
[in]blockIdID of block whose paramters should be checked

Implements reverb::Task.

Definition at line 42 of file Filter.cpp.


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