11 #include "SoundTouch.h" 22 class TimeStretch :
public Task
27 ~TimeStretch() =
default;
30 using Ptr = std::shared_ptr<TimeStretch>;
33 virtual void updateParams(
const juce::AudioProcessorValueTreeState& params,
34 const juce::String& blockID)
override;
39 void prepareIR(juce::AudioSampleBuffer& ir);
44 static constexpr double MAX_IR_LENGTH_S = 5.0f;
46 float irLengthS = 3.0f;
49 juce::AudioSampleBuffer irOrig;
52 std::unique_ptr<soundtouch::SoundTouch> soundtouch;
float getParam(const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockId) const
Internal method used to get (and check) a parameter's value.
void prepareIR(juce::AudioSampleBuffer &ir)
Copies given IR to internal representation and resizes it before processing.
TimeStretch(juce::AudioProcessor *processor)
Constructs a TimeStretch object associated with an AudioProcessor.
int getOutputNumSamples()
Returns expected number of samples after processing.
virtual AudioBlock exec(AudioBlock ir) override
Apply time stretching algorithm to input IR buffer to change sample rate.
virtual void updateParams(const juce::AudioProcessorValueTreeState ¶ms, const juce::String &blockID) override
Updates parameters from processor parameter tree.