![]() |
quantumVERB
1.0.0
A FOSS convolution reverb plugin
|
#include <TimeStretch.h>
Public Types | |
using | Ptr = std::shared_ptr< TimeStretch > |
![]() | |
using | Ptr = std::shared_ptr< Task > |
Public Member Functions | |
TimeStretch (juce::AudioProcessor *processor) | |
Constructs a TimeStretch object associated with an AudioProcessor. More... | |
virtual void | updateParams (const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockID) override |
Updates parameters from processor parameter tree. More... | |
virtual AudioBlock | exec (AudioBlock ir) override |
Apply time stretching algorithm to input IR buffer to change sample rate. More... | |
void | prepareIR (juce::AudioSampleBuffer &ir) |
Copies given IR to internal representation and resizes it before processing. More... | |
int | getOutputNumSamples () |
Returns expected number of samples after processing. More... | |
![]() | |
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... | |
Protected Attributes | |
float | irLengthS = 3.0f |
juce::AudioSampleBuffer | irOrig |
std::unique_ptr< soundtouch::SoundTouch > | soundtouch |
![]() | |
juce::AudioProcessor * | processor |
bool | mustExec = true |
Static Protected Attributes | |
static constexpr double | MAX_IR_LENGTH_S = 5.0f |
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. | |
Implements a time stretching algorithm to manage IR buffer length and sample rate.
Definition at line 22 of file TimeStretch.h.
reverb::TimeStretch::TimeStretch | ( | juce::AudioProcessor * | processor | ) |
Constructs a TimeStretch object associated with an AudioProcessor.
Creates a TimeStretch object with a handle to a SoundTouch instance
[in] | processor | Pointer to main processor |
std::runtime_error |
Definition at line 28 of file TimeStretch.cpp.
|
overridevirtual |
Apply time stretching algorithm to input IR buffer to change sample rate.
Stretch or compress input buffer by a factor proportional to original and desired sample rates.
NOTE: prepareIR() method should be called before to manage buffer size. This will copy the original IR and resize the given buffer to the appropriate size based on sample rate and desired length.
[in,out] | ir | Audio sample buffer to process |
Implements reverb::Task.
Definition at line 70 of file TimeStretch.cpp.
int reverb::TimeStretch::getOutputNumSamples | ( | ) |
Returns expected number of samples after processing.
[in] | inputNumSamples | Number of samples in input buffer |
Definition at line 145 of file TimeStretch.cpp.
void reverb::TimeStretch::prepareIR | ( | juce::AudioSampleBuffer & | ir | ) |
Copies given IR to internal representation and resizes it before processing.
[in,out] | ir | IR to copy and resize |
Definition at line 134 of file TimeStretch.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 45 of file TimeStretch.cpp.