I have been trying to implement Juce convolution from the DSP module in an audio plug-in. I know there are some example code, both at this forum as well as an Juce tutorial, but I can’t make it work in the Juce plug-in template. As a newbie, this may be easy to most of you and I really would appreciate it if anyone could help me.
void JConvAudioProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
auto totalNumInputChannels = getTotalNumInputChannels();
auto totalNumOutputChannels = getTotalNumOutputChannels();
for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
buffer.clear (i, 0, buffer.getNumSamples());
dsp::AudioBlock<float> block (buffer);
dsp::ProcessContextReplacing<float> context (block);
Variables are implemented in the header file. The only thing that happens is that the volume is decreased, but not if I comment away the conv.process(context); line. Then, as expected, the audio just passes through.
Thank you for reaching out but I have already tried that order. I have also tried to load the impulse in the constructor. But it is likely that I am doing something wrong in the loadImpulseResponse function.
Perfect, thank you so much for the help! I have been trying for a while to interpret that part of the convolution class and to figure out which of the load methods I was supposed to use. This made my day
Don’t know if you solved this but I call Convolution’s prepare() method before its loadImpulseResponse() method. You can also load your .wav in as a binary and use that as the sourceData parameter for the implementation of the loadImpulseResponse() method that requires sourceData and sourceDataSize like so: