Garageband and isBusesLayoutSupported()

If I have the following in isBusesLayoutSupported()

bool MyPluginAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    if (layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
    {
        return false;
    }
    return true;
}

Then Logic Pro X does what I’d expect and only offers a Stereo version of the plugin. However, Garageband still offers a Mono version, and displays an error message if I select that version.

Is there any other way to tell a host that a plugin is Stereo-only (or n-channels only for that matter) ?

Thanks

1 Like

What do you want the input configuration to be? For stereo-in, stereo-out, the following should be sufficient:

YourAudioProcessor::YourAudioProcessor()
    : AudioProcessor (BusesProperties().withInput  ("Input",  AudioChannelSet::stereo(), true)
                                       .withOutput ("Output", AudioChannelSet::stereo(), true))
{
    // Set up parameters etc...
}

bool YourAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    const AudioChannelSet& mainInput  = layouts.getMainInputChannelSet();
    const AudioChannelSet& mainOutput = layouts.getMainOutputChannelSet();

    return mainInput.size() == 2 && mainOutput.size() == 2;
}

I want it to be zero in stereo out, and actually my original code achieves what I want.

It seems the problem was that GB was somehow not updating when I re-compiled my plugin. Whether it was caching the bus configuration I’m not sure, but in order to force it to update I had to change my plugin ID and do a full clean and rebuild.

It works now.

1 Like

You can clear your AU cache:
https://www.arturia.com/faq/utilization/how-do-i-clear-my-audio-unit-cache

Do you need to return false if the number of input channels is > 0?

Yeah, I’ve got at script that clears the AU cache as a matter of course and I’m pretty sure I did that. It seemed like GB had some other way of caching bus layouts irrespective of the AU cache, but I’m probably just imagining things!

The plugin is in the “aumu” category, and so far I’ve had no problems with not returning false for layouts.getMainInputChannelSet() != AudioChannelSet::disabled() but I’ve added it now just in case.

Maybe GarageBand’s AU cache is in its sandbox?