Standalone App support for doublePrecision

Hello,

I’m new to these forums so please bare with my basic question.

My standalone application is requesting singlePrecision (in prepareToPlay method) from my plugin processor which supports doublePrecision as well.

The AudioProcessorPlayer::setProcessor() is calling my prepareToPlay() method with singlePrecision because isDoublePrecision is false by default, and this is because StandalonePluginHolder is initializing the AudioProcessorPlayer player member with the default constructor parameter:
AudioProcessorPlayer ( bool doDoublePrecisionProcessing = false );

What is the proper way for me to tell the standalone app to always use doublePrecision?

Thanks,
Antoan

So what’s your goal in running a standalone app with double callback? In contrast to a DAW scenario you can be quite certain that there is a 24 bit integer input signal from your audio interface and a 24 bit integer output stream to the interface on the other side, so technically you’ll never receive or send double samples to your hardware anyway.

I think the only real advantage of double buffers is better summing of a lot of sources in a mix or chaining a lot of dynamic stages, which both is not really the case in your scenario anyway.

Now if your particular algorithm performs a lot better when using double, you could simply call your double processing callback from within the float callback as default, so no matter if you get doubles or not you always use doubles for processing. Of course you need to transform the float buffer to double before that and the double buffer back to float after that.

My plugin is a synth and yes, its internal calculations are all with double precision.

I would like to avoid transforming of buffers from double to float.

When I modify the StandalonePluginHolder class to initialize its member player( true ), then everything works as expected and the standalone app is calling my double processing method.

But, I wanted to avoid any modifications to the JUCE code, if possible.

You don’t need to modify the JUCE code to write your own StandalonePluginHolder. JUCE has a flag JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1
that allows you to inject your own standalone code. So you could start with copy/pasting whatever you need from the default wrapper and then modify it to your needs.

Here’s a pretty basic example:

1 Like

This sounds like the flag that I need :slight_smile:

Thanks!