Mono to stereo for standalone plugins

Many JUCE plugins, as well as (I think?) most of the templates, generate a stereo only and/or a mono only plugin.

However, when using something like a Macbook Pro with the internal sound card, the standalone version creates a mono to stereo component which asserts and doesn’t behave correctly unless dealt with.

It would be convenient if the default standalone app could support that use case by optionally launching the stereo version, only using the one active input that exists to feed both inputs, instead of having the programmer explicitly deal with the mono to stereo option in each processor.

This is now supported in AudioProcessorPlayer:

3 Likes

I just wanted to say that this appears to solve the issue I had on my new imac with a mono mic.
so, @reuk thanks for implementing this fix.

Related: Do you have any idea why the output names for the built-in speakers are showing up like this?

Not sure, I see the same thing for my MacBook’s internal speakers, but not for the speakers in my display. Debugging, it looks like CoreAudio is giving us exactly the channel names shown (channel 1 is “1”, channel 2 is “Channel 2”).

Bumping for a related issue:
If you have an extra input, such as SideChain, and the plugin only allows that SC input to be enabled, JUCE asserts when debugging in the standalone.

Here’s a minimal example:

```

//ProcessorBase just trivially overrides AudioProcessor virtual methods
struct MinimalAudioPlugin : PluginHelpers::ProcessorBase
{
    MinimalAudioPlugin()
        : ProcessorBase(getProperties())
    {
    }

    static BusesProperties getProperties()
    {
        auto stereo = juce::AudioChannelSet::stereo();
        auto mono = juce::AudioChannelSet::mono();

        return BusesProperties()
            .withInput("Input", stereo, true)
            .withInput("SC", stereo, true)
            .withOutput("Output", stereo, true);
    }

    bool isBusesLayoutSupported(const BusesLayout& layouts) const override
    {
        auto stereo = juce::AudioChannelSet::stereo();
        auto mono = juce::AudioChannelSet::mono();
        auto disabled = juce::AudioChannelSet::disabled();

        auto& outputs = layouts.outputBuses;

        if (outputs.size() != 1)
            return false;

        if (outputs[0] != stereo)
            return false;

        auto& inputs = layouts.inputBuses;

        if (inputs.size() != 2)
            return false;

        if (inputs[0] != stereo)
            return false;

        auto sc = inputs[1];

        if (sc != mono && sc != stereo)
            return false;

        return true;
    }
};

```

2 Likes

Yes, This issue prevents us from using the standalone build.
I have seen several suggestions to remove or disable the side-chain for the standalone to stop asserting but I dont think it is a proper solution.
The proper solution would be to support any bus config that the plugin wants.
Thanks Eyal!

2 Likes