Trouble with isNonRealtime for offline render


I’ve searched all existing threads on this I can find, but I’m having trouble with this specific method. It doesn’t seem to work, at least in Cubase 8 and the latest Reaper (my primary test platforms.) In Cubase, it doesn’t return true until after a bounce has completed. In Reaper, it always returns false (I’ve even tried putting a debug string inside a timer loop to test this.)

I am trying to provide a high quality offline render mode for my users (as I’ve seen in several other plugins), but it can’t work unless the plugin can accurately detect when a render is happening. I am calling isNonRealtime() from the prepareToPlay method.

Happy JUCE user since 2010. Thanks for any insight you guys can provide!

PS - I should add: this is on Windows and the plugin in question is built to the VST 2.4 spec for maximum compatibility. I will test AU and AAX as well, but ideally this should work for the ~80% of folks out there on Windows VST hosts.


An update: After some investigation, this appears to be host-specific, and not JUCE related. This works properly now that I’ve discovered a setting in Reaper to inform VST plugins of offline state (not normally enabled by default for some reason.) I’m also assuming that if I fiddle with the VST settings a bit in Cubase, I can get this working as well.

So, if any of you are getting questions about offline mode in your plugins not working, make sure that you investigate for host configuration issues.


Wouldn’t it be best to just have a checkbox or something in the plugin itself that puts it into the “high quality rendering” mode and not consider the host state at all?


Absolutely, under normal circumstances, yes. However, when said high quality mode maxes out the CPU completely even at 44.1 kHz sample rate, 1024 samples per buffer on an Intel Core i7-4771 @ 3.50GHz based machine, it’s impossible to run it any other way. It’s a special case, to be sure - most of us aren’t writing stuff that’s quite this CPU intensive.


I can understand the DAWs manufacturers to turn this option off by default. You expect exactly the same result from what you’re hearing to what you’re rendering, if it doesn’t do that, even if it might be better when rendered, that’s not good. As an audio engineer it would make me angry, if plugin manufacturers started to do different things in online and offline processing.

I would do exactly as Xenakios said, make a checkbox in the plugin, calling it HQ offline rendering, or something and explain in a Tooltip, that it’s too expensive for realtime.


Although if you’re using separate threads for some of the processing (e.g., in a sampler or convolution system) then you may need to change the algorithm for offline rendering (e.g., do away with the multiple threads and just use a single thread).


There will be a toggle for high quality offline render mode, and it will be explained in a tooltip as well as the plugin manual. I’d never force such a feature on users, however, it is something my users requested, and it works very well if it’s used correctly.