Logic Pro X way of handling buffer processing / processBlock calls

Hi!

I have a question. Pretty much all the other DAW’s just work so that they process buffers even when not playbacking so you could for example count seconds from the buffersizes and use it “as a timer” to do something. This would be useful for number of reasons, like calculating tempo’s or doing stuff while NOT playbacking that’s needed to be done.

But Logic X doesn’t think this way. It seems to halt processing completely and no callbacks are made during stopped playback to processor class? I’ve used a Timer, but this becomes troublesome when offline-rendering, since the timer does not work in the same timespan than the rendering of the plugin processing since it’s not realtime anymore, but as fast as possible, usually. So how to solve this? Any ideas?

Is there a check to perform to check if DAW is in offline rendering-mode vs realtime or how to use processblock method with the timer to get around this?

Thanks,
Toni

Hi Toni, reporting an infinite tail length to Logic helps a bit. For bpm/sync, you should probably use https://docs.juce.com/master/classAudioPlayHead.html. Hope that helps!

Not a solution, but Logic isn’t the only one. Even Cubase can behave that way if the user checks the preference box “Suspend VST 3 plug-in processing when no audio signals are received” (which I do in order to allow for easier debugging without the processBlock function being called while checking out other things).

While rendering, you can call isNonRealtime(), but that may or may not be supported by a given host. If not supported, it will return false (making the assumption that it is real-time if it can’t tell).

Hope it’s OK to post this rather than start a new topic…

I use a SmoothedValue, which is being advanced in the processBlock using value.skip(blockSize). But as described above:

So since processBlock is skipped, SmoothedValue never advances. Any suggestions to making this work?

Thanks! Got the pbm info from the AudioPlayHead! :slight_smile:

If the SmoothedValue is used in the audio signal processing and you don’t need to use it when the blocks are not running (no signal processed / audio playbacked) it doesn’t matter if it doesn’t run during pauses?

But if you need it to run even when no audio is playing (Like I had to in my instance) the only way I see it, is to use a double approach. Have a Timer class on your processor and processblock can call StartTimer every time it’s run which resets the Timer to start counting again, and if the interval is long enough, it never reaches the callback during playback basicly. And then use processblock for the calculation And when playback is stopped, Timer will reach it’s interval since no StartTimer is being called. And do the calculation code in the callback then.

I find this pretty hacky and possible unreliable since it will behave a bit differently in different situations (heavy load during playback might delay the block and hit the timer callback, and also rendering is faster than realtime often) but I guess there’s no better way and you’ll just have to take those possibilities into account… :woman_shrugging:

Thanks for the info! :slight_smile: