I’m encountering a gotcha in JUCE’s dsp::Convolution
This assert-fails (numInputChannels != numOutputChannels) within the JUCE code:
juce::dsp::ProcessContextNonReplacing<float> ctx(mono_in, stereo_out);
convolver.process(ctx);
As a workaround I’ve done this:
void feed(const dsp::AudioBlock<float> in_mono)
{
const float* pointers[] = {
in_mono.getChannelPointer(0),
in_mono.getChannelPointer(0)
};
AudioBlock<float>tmpBlk((float * const *)&pointers, 2, (int)in_mono.getNumSamples());
auto outBlock = getOutBlock();
juce::dsp::ProcessContextNonReplacing<float> ctx(tmpBlk, outBlock);
convolver.process(ctx);
}
(consts are not required, it seems)
It avoids allocation or even copying. But it’s clumsy.
Please can we have a fix for this teamJUCE? This is a beautiful component.
There’s another lesser issue: I can’t supply rValues. ctx(getSrcBlock(), getDstBlock()) fails. I think that should be fixable with &&.
NOTE: Maybe clearer to write add_pointer_t<const add_pointer_t<float>> instead of float * const *
