Processing independent of block size

Hi to all,

I am new to JUCE library but I am trying to implement a processor that needs to have an input that will always be bigger than the block size. Let’s say 60/75 ms for example. I’ve implemented a circular buffer to fill the buffer in each process block, but was wondering if it is possible to only write the output buffer each n calls to the processBlock. I found this topic:

where @benvining provides and example of this with an increasing latency counter and a privateProcessBlock.

I am a little bit lost in this regard and would love to know if this is possible and if anyone has an example of how to increase the latency in the process block and only write to the output buffer when the buffer is filled.

Hope the question makes sense.

Thank you in advance for your time!

Hello there! :wave:

Here’s the base class I ended up writing for my own use:

The way it works is that you create a subclass of this engine class, declare a constant blocksize/latency, then from your top-level plugin processBlock(), simply call engine.process() with however many samples the host set you that callback.

In your subclass, override the renderBlock() method. That fuction will always be called with a consistent # of samples - the blocksize you declared.

The engine will output 0’s until it has enough samples to process (that’s the latency part), and it can also take care of anti-click fades when bypassing and un-bypassing.

1 Like

Thank you so much for the help! That makes a lot of sense. If it is possible it’s going to solve me a lot of problems. I will definitely take a look at the code and try to understand and adapt from it.

Thank you for your time!

PS: Love the imogen concept :slight_smile:

You’re welcome! You’re more than welcome to either model your own class on this code, or just directly use my class.

And thank you – I’m about 85% of the way there, currently pulling my hair out over PSOLA details :crazy_face:


Thank you benvining. I’ll definetly base it on your implementation as I am new to the JUCE world.

It does not seem to be easy implement for sure. Good luck :smiley:

1 Like