![]() |
quantumVERB
1.0.0
A FOSS convolution reverb plugin
|
#include <IRPipeline.h>
Public Types | |
using | Ptr = std::shared_ptr< IRPipeline > |
![]() | |
using | Ptr = std::shared_ptr< Task > |
Public Member Functions | |
IRPipeline (juce::AudioProcessor *processor, int channelIdx) | |
Constructs an IRPipeline object associated with an AudioProcessor. More... | |
virtual void | updateParams (const juce::AudioProcessorValueTreeState ¶ms, const juce::String &="") override |
Updates parameters from processor parameter tree. More... | |
virtual AudioBlock | exec (AudioBlock=AudioBlock()) override |
Manipulate the input IR file and place it in the given buffer. More... | |
virtual bool | needsToRun () const override |
Check if this or any subtasks needs to be executed. More... | |
virtual void | updateSampleRate (double sr) override |
Update sample rate for pipeline and child tasks. More... | |
AudioBlock | reloadIR () |
Loads an impulse response from disk or IR bank. More... | |
![]() | |
Task (juce::AudioProcessor *processor) | |
Static Public Attributes | |
static constexpr float | MAX_IR_INTENSITY = 0.5f |
Protected Member Functions | |
void | loadIRFromBank (const std::string &irBuffer) |
Loads an impulse response from provided IR bank. More... | |
void | loadIRFromDisk (const std::string &irFilePath) |
Loads an impulse response from a file (.WAV or .AIFF) to internal representation. More... | |
![]() | |
float | getParam (const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) const |
Internal method used to get (and check) a parameter's value. | |
Protected Attributes | |
Equalizer::Ptr | equalizer |
TimeStretch::Ptr | timeStretch |
Gain::Ptr | gain |
PreDelay::Ptr | preDelay |
double | lastSampleRate = 0 |
int | channelIdx |
std::string | irNameOrFilePath = "" |
juce::AudioSampleBuffer | ir |
![]() | |
juce::AudioProcessor * | processor |
bool | mustExec = true |
Additional Inherited Members | |
![]() | |
double | sampleRate |
A pipeline implementing various transformation steps that are applied to impulse responses. This pipeline is executed only as needed (i.e. when a new IR is requested or when one of its parameters is changed). Therefore, it is not part of the critical path (its speed does not have a huge impact on plugin performance).
Definition at line 33 of file IRPipeline.h.
reverb::IRPipeline::IRPipeline | ( | juce::AudioProcessor * | processor, |
int | channelIdx | ||
) |
Constructs an IRPipeline object associated with an AudioProcessor.
Creates an IRPipeline and each of its steps. Also sets the default IR file path and ensures it can be found.
[in] | processor | Pointer to main processor |
Definition at line 29 of file IRPipeline.cpp.
|
overridevirtual |
Manipulate the input IR file and place it in the given buffer.
Applies filtering (EQ), time stretching (sample rate conversion) and gain to internal IR channel buffers to prepare it for main audio processing, then write channels to given output buffer.
[out] | irChannelOut | Processed impulse response channel |
std::runtime_error |
Implements reverb::Task.
Definition at line 154 of file IRPipeline.cpp.
|
protected |
Loads an impulse response from provided IR bank.
Loads the appropriate impulse response (IR) from binary data.
[in] | irName | Name of banked IR file |
std::invalid_argument |
Definition at line 227 of file IRPipeline.cpp.
|
protected |
Loads an impulse response from a file (.WAV or .AIFF) to internal representation.
Loads the selected impulse response (IR) from disk and splits it into individual buffers for each channel. This operation is potentially very heavy so processing is suspended until completion.
[in] | irFilePath | Path to impulse response file |
std::invalid_argument |
Definition at line 261 of file IRPipeline.cpp.
|
overridevirtual |
Check if this or any subtasks needs to be executed.
Pipeline must be executed if any IR-related parameters were changed since the last run.
Reimplemented from reverb::Task.
Definition at line 112 of file IRPipeline.cpp.
AudioBlock reverb::IRPipeline::reloadIR | ( | ) |
Loads an impulse response from disk or IR bank.
If given string is the name of an IR in IR bank, load that buffer. Otherwise, look for IR on disk.
[in] | irName | Name or path of IR file |
std::invalid_argument |
Definition at line 194 of file IRPipeline.cpp.
|
overridevirtual |
Updates parameters from processor parameter tree.
[in] | params | Processor parameter tree |
[in] | blockId | ID of block whose paramters should be checked |
Implements reverb::Task.
Definition at line 46 of file IRPipeline.cpp.
|
overridevirtual |
Update sample rate for pipeline and child tasks.
Compares new sample rate with previous value. If different, sets mustExec to true in order to re-run pipeline for new sample rate. Store new sample rate value in object.
[in] | sr | Sample rate |
Reimplemented from reverb::Task.
Definition at line 89 of file IRPipeline.cpp.