Ok! So, my AudioProcessor’s processBlock checks each time if the buffersize has changed and sends a call to synthesizervoice’s LP-filters to prepare and reset. So it’s quite obvious it’s going to produce glitches if the buffer size varies during playback, since the reset happens. This is because PrepareToPlay-method doesn’t get called on Logic X before each playback start, so I had to include the check on the processBlock, otherwise there’ll be glitches on Logic too hah.
I can share some code but I’m not sure it’s going to help.
I’m not 100% sure even how the LP-filter works in JUCE dsp-module, since I’m afraid I’m not a pro in signal processing. I had a “feeling” that it needs to store the last known sample in the last buffer in order to calculate the next buffer’s first sample’s filtering, am I right? So If I reset or prepare the filter, it will lose that information, OR, it never registers the correct sample in the first place if the buffer ends up being smaller than anticipated (never reaches the last sample of the real buffer size that it then stores) ?? How do I overcome this? Write the buffer with the last known sample to the end everytime buffer gets written? That’ll be propably a bit too tough on the CPU since there’s quite many synthesiser voice objects in the sampler I’m developing, and those would be doing that thing a lot, even multiple times during a single buffer because how the juce synthesizer works in conjunction with midibuffers (each midimessage splits the buffer and each time I’ll have to process the part of the buffer and not knowing when it’ll end in reality, so I’d have to write the buffer end each time or something…) :S