Thanks for the input.
It’s true that hardly no parameter changes need to be sample accurate considering user interaction, but in my current experiment with biquad filter coefficients, updating per block causes noticable zipping. Even with smoothing.
Although I havent looked into software synthesizers myself I guess a quick resonant filter envelope sweep can not be per process block either.
Anyway, I actually had a go with a biquad peak filter based on Johannes Menzels code in an implementation derived from the processing loop in the Juce StateVariableTPTFilter and reversed it’s iteration order to add per sample updating of coefficients for smoothing. The difference is huge, it sounds much better, I don’t think I can detect any zipping at all with my ears. But as you say the processing is probably less efficient.
Now the loop looks like this:
for (size_t i = 0; i < numSamples; ++i)
{
for (size_t channel = 0; channel < numChannels; ++channel){
auto* inputSamples = inputBlock .getChannelPointer (channel); //how heavy is this?
auto* outputSamples = outputBlock.getChannelPointer (channel);
outputSamples[i] = processSample ((int) channel, inputSamples[i]);
}
}
One thing I’m unsure about is the two .getChannelPointer assignments. Is that a heavy operation so I would benefit from putting that outside the innerloop and access already assigned channelpointers (one per channel obiously) instead?
Another strategy that I’m not sure how to implement but that should work:
Pre generate the coefficient updates so the same “curve” can be applied identical on both channels per processBlock. But question is if that would be more effective. I would need separate coefficients per channel and those would require update calls times the number of channels. Maybe less effective in the end?
Also if updating per process block I guess a simple crossfade between one block with previous coefficients and the one block with updated coefficients would work. I haven’t figured out how to crossfade AudioBlocks. Seems I can’t use any predefined classes for that.
Interesting topic anyway.
