Hello,
as I know Logic Pro X doesn’t support processBlockBypassed() so we can’t perform any action when Logic Pro bypass is clicked.
But I wonder if is following idea well or not:
I found out that when I click in Logic Pro bypass, it stops my processBlock. So I think there must be some way to check if processBlock is running or not (is there anything like that?).
If it’s true. I could just set the timer in my plugin, and in timerCallback always check if processorBlock() is running. And if it’s not running, just perform some action.
Is it good idea?
Of course it’s not elegant solution, but maybe it’s better than nothing?
But actually I have no idea how to check if processBlock is running. Is there flag or something like that?
You would have to save the flag yourself in your AudioProcessor. We actually do this check in our plugins, to clear out meters and such for hosts that do what Logic is doing (bypassing by not calling processBlock() anymore).
A simple way is to keep an atomic “count” variable in the processor and have a timer that continuously tries to decrement the count. That way we’d know fairly shortly that we’re in a “bypassed” state since our processBlock() method hadn’t been called for some time.
Every time processBlock() is called we bump the count up to the threshold value. For example, if you had a 0.25Hz timer and a count threshold of 4, it would take about 1 second of being bypassed to know. Obviously you would probably want this a bit faster but that’s the basic premise.
Sorry, not sure if I understand. So shoul I just call someAtomicInt++; in the processBlock(), and then check in the timerCallback() if someAtomicInt was changed? Something like that?
Unfortunately in Logic you never get any state changes about being bypassed. We have a bypass parameter implemented in our plugins and it doesn’t get updated when Logic’s bypass is enabled
weird. I wonder if Apple Developer support is aware of this.
Just curious, have you guys created a plain Audio Unit project in Xcode and checked that this boolean flag Apple provides never gets updated by logic? or sticking strictly with JUCE’s callbacks?
is sometimes faster than that loop. I mean that during processBlock() is running, my timerCallback() sometimes reaches bypass() for short moment. How is that possible? Is it because I use atomic? How to avoid that. But I want to reach my bypass() as fast as possible.
Continuing with my previous post, you can’t do fade outs for hosts that do this hard bypass (aka hosts that will stop calling processBlock() and don’t call processBlockBypassed()). You aren’t getting any audio buffers to write into at that point so it’s always going to result in a hard audio cut.
If you need your GUI to update on bypass you can use the timer method, but you’d want it to be slower than 1ms otherwise you’ll run into the problem you described
And it’s not getting hit when I bypass my plugin in Logic. Although if it was, it looks like processBlockBypassed() still wouldn’t get called because of this conditional (I have a dedicated bypass parameter):