AudioProcessorPlayer and suspendProcessing


Hi jules,

Could you make the AudioProcessorPlayer behave like the AU, VST, … wrappers when the AudioProcessor is marked as suspended? Unless I missed something, the processing is not bypassed when the audio processor is suspended. It would be handy!

Thank you!

edit: It doesn’t seem to use the callback lock of the audio processor either. Could you add it as well?


Ok, no problem. I guess it should be as simple as this, at the end of AudioProcessorPlayer::audioDeviceIOCallback?

[code] const ScopedLock sl (lock);

if (processor != 0)
    const ScopedLock sl (processor->getCallbackLock());

    if (! processor->isSuspended())
        processor->processBlock (buffer, incomingMidi);



Shouldn’t the buffer be cleared when the audio processor is suspended?


That should already be handled by the code above this.


I didn’t pay attention to that. Allright then, thank you!


Hm - I actually trusted you on that - the clearing stuff - but I think there might be a hitch: when the audio processor is suspended, you might want to clear all the channels, including the channels used to pass the input, right?


…yes, having another think about it, you’re right, it’s probably better to clear the buffer in this case. I’ll add some code to do that.



I’m using an AudioProcessorGraph, and trying to bypass the individual plugins.
First I thought that this nice function was designed for this :

suspendProcessing (bool shouldBeSuspended) Enables and disables the processing callback.
But it seems it’s only for a flag that’s doing nothing in itself ?!
If so, this means that while I can implement the described workaround inside my own filters, it won’t work on third party plugins…

Would that be possible to modify either AudioProcessorGraph (to add a bypass for each node) or AudioProcessor (so it react to suspendProcessing()) ?




Well it’d be possible of course to change the processor graph class to force a bypass on each node, but it’s not something that would make it into my “top 100 important things to do” list. If you need to just temporarily suspend a plugin, couldn’t you just disconnect it, and re-connect it afterwards?



Thanks for the suggestion. I’ve just implemented this.
Though one question : when not connected, does a node still use any CPU load ?



A processor will still be called regardless of whether it’s connected or not. In other words, if you don’t want it to process then you have to remove it from the graph.