DSP::ProcessContextReplacing

Hey, this is a simplified version of a problem I have in another project! So I get some weird artifacts added to the filtered signal in my output. This only happens when the process is on the tempBuffer and not the main buffer. how come and do you have any solution/tips for me?

I’m not sure what causes the problem, but you might need to add some checks, to make sure that the size of temp and main buffer are equal, because a host can send process blocks with buffers of any size, although probably not bigger than the block size passed in prepare. If they are not equal, then you have to deal with that.

Just taking a quick glance: you are getting tempBufferLength from tempBuffer but how did you declare it? Did you set its size or do anything with it before you start processing it in processBlock? Because otherwise your tempBufferLength may be the problem. It depends on what you specifically do, but in most cases your tempBuffer should should be the same size as the incomming buffer so an option would be to use bufferLength for both and forget about tempBufferLength

I may be wrong tho as I don’t use DSP::ProcessContextReplacing or you may be doing some DSP that involves different number of samples (delays, etc)

Yeah, the tempBuffer is set to the same size so yeah you’re correct I can just change that to bufferLength for simplicity/safety.

Hmm, what do you do if you are not using ProcessContextReplacing? It might be a problem with that one since ProcessContextReplacing works when I just filter my main buffer but not my tempBuffer.