Hi there,
I had to make some fixes to some plug-ins, which used more or less the SIMD filtering approach in the SIMDRegisterDemo. The problem was quite simple: when the host called processBlock
regularly with a smaller buffersize than reported in prepareToPlay
, the SIMD IIR filtering just exploded with very loud output (reaching over 500dB), as it was basically filtering garbage.
The culprit basically was line 94 of the SIMDRegisterDemo:
Maybe it should be replaced by something like the following, to prevent users like me from a mistake when using the demo code in an audio plug-in.
const SIMDRegister<float>* chPtr[1] = {interleaved.getChannelPointer (0)};
AudioBlock<SIMDRegister<float>> ab (const_cast<SIMDRegister<float>**> (chPtr), 1, n);
iir->process (ProcessContextReplacing<SIMDRegister<float>> (ab));
I know, it’s not pretty, I am sure it can be written in a more elegant way.
To give some more info about the problematic situation: it happened when using a plug-in host like Bluecat Patchwork in Logic, as it always prepares with 1024 samples but sends buffersize according to Logic’s settings. When they are the same, there’s no problem at all.