![]() |
quantumVERB
1.0.0
A FOSS convolution reverb plugin
|
#include <Equalizer.h>
Public Types | |
using | Ptr = std::shared_ptr< Equalizer > |
![]() | |
using | Ptr = std::shared_ptr< Task > |
Public Member Functions | |
Equalizer (juce::AudioProcessor *processor, int numFilters=4) | |
virtual void | updateParams (const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) override |
Read processor parameters and update block parameters as necessary. More... | |
virtual AudioBlock | exec (AudioBlock ir) override |
Processes the AudioBuffer input with the EQ filters. More... | |
virtual void | updateSampleRate (double sr) override |
Update sample rate for task block. More... | |
void | calibrateFilters () |
Calibrates the individual filter gains so that the total gains are equal to the user defined values. More... | |
float | getdBAmplitude (float freq) |
Returns the Equalizer amplitude response in dB at a given frequency. More... | |
int | getNumFilters () |
Returns the number of filters in the equalizer. | |
virtual bool | needsToRun () const override |
Tells caller whether block must be run for current block. More... | |
![]() | |
Task (juce::AudioProcessor *processor) | |
Protected Attributes | |
juce::OwnedArray< Filter > | filterSet |
std::vector< float > | EQGains |
![]() | |
juce::AudioProcessor * | processor |
bool | mustExec = true |
Additional Inherited Members | |
![]() | |
double | sampleRate |
![]() | |
float | getParam (const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) const |
Internal method used to get (and check) a parameter's value. | |
The Equalizer class cimplements by default four Filter class instances -one low-shelf, two peak filters and one high-shelf - and calibrates their individual gains to balance out the stacking effect thus making sure that the EQ band gains are equal to the ones set by the user.
It acts as an interface between the GUI and the IIR filters. The class can support one low-shelf filter and one high-shelf with any number of peak filters in between; the total number is equal to the numFilters constructor argument. The filter instantiations are done in the class constructor.
Definition at line 30 of file Equalizer.h.
void reverb::Equalizer::calibrateFilters | ( | ) |
Calibrates the individual filter gains so that the total gains are equal to the user defined values.
This function solves a linear equation system of N variables where N = number of filters in order to find the individual gains that, when stacked together, are equal to the user specified values at the frequencies of 0, 21000 Hz and at each single one of the peak filter center frequencies.
The use of decibels is necessary for the gain stacks to behave linearly. The algorithm can be used iteratively and is detailed in the Standford University lecture note available at https://ccrma.stanford.edu/courses/424/handouts.2004/424_Handout22_Filters4_LectureNotes.pdf
ConvergenceException |
Definition at line 138 of file Equalizer.cpp.
|
overridevirtual |
Processes the AudioBuffer input with the EQ filters.
[in] | ir | AudioBuffer to be processed |
Implements reverb::Task.
Definition at line 106 of file Equalizer.cpp.
float reverb::Equalizer::getdBAmplitude | ( | float | freq | ) |
Returns the Equalizer amplitude response in dB at a given frequency.
[in] | freq | Frequency at which the filter magnitude is evaluated |
Definition at line 232 of file Equalizer.cpp.
|
overridevirtual |
Tells caller whether block must be run for current block.
May be overriden by IR blocks since these are executed sparingly.
Reimplemented from reverb::Task.
Definition at line 255 of file Equalizer.cpp.
|
overridevirtual |
Read processor parameters and update block parameters as necessary.
[in] | params | the value tree containing the parameters |
[in] | blockId | the Id of the relevant parameter block |
Implements reverb::Task.
Definition at line 66 of file Equalizer.cpp.
|
overridevirtual |
Update sample rate for task block.
Compares new sample rate with previous value. If different, sets mustExec to true in order to re-run task for new sample rate. Store new sample rate value in object.
[in] | sr | Sample rate |
Reimplemented from reverb::Task.
Definition at line 119 of file Equalizer.cpp.