Mess in `isBusesLayoutSupported()`

Hello,
sorry if I ask for something which probably was already answered. I found planty of threads on that forum which concern toisBusesLayoutSupported() method. But I don’t even know where should I start. But to the point.

how to provide in Logic Pro X three busses configurations:

  1. mono->mono
  2. stereo->stereo
  3. mono->stereo

Plus I need to have side chain input mono or stereo.
So my processor constructor looks as follows:

MyProcessor:: MyProcessor()
    : AudioProcessor (BusesProperties().withInput  ("Input",     AudioChannelSet::stereo(), true)
                                       .withOutput ("Output",    AudioChannelSet::stereo(), true)
                                       .withInput  ("Sidechain", AudioChannelSet::stereo(), false))
{
}

But I encounter serious problems with configuration inside AudioProcessor::isBusesLayoutSupported().

I tried various implementation of isBusesLayoutSupported().

One of them is:

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

    if (layouts.getMainOutputChannelSet() < layouts.getMainInputChannelSet())
        return false;

    return true;
}

And for such configuration I encounter issues as follows:

  • In Logic Pro X there are still only two options to choose: mono->mono or stereo->stereo. But there is not option mono->stereo
  • second issue is much more strange. Juce AudioPluginHost allows me to choose stereo input and mono output. But not mono input and stereo output which I expect.

So I tried to change second if statement to:

if (layouts.getMainInputChannelSet() < layouts.getMainOutputChannelSet())
    return false;

Now the issues are:

  • Juce AudioPluginHost works as I expect. So I can chose mono/mono, stereo/stereo and mono->stereo. That’s great but if statement looks stupid in my opinion.
  • In Logic Pro X such configuration doesn’t even pass validation.

I also tried another configuration:

bool MyProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    const int numInput = layouts.getMainInputChannelSet().size();
    const int numOutput = layouts.getMainOutputChannelSet().size();
    
    if(numOutput < numInput)
        return false;
    
    if((numInput != 1 && numInput != 2) || (numOutput != 1 && numOutput != 2))
        return false;

    return true;
}

In such configuration Juce AudioPluginHost works as I expect. And it can also be validated in Logic Pro X. But in Logic Pro there is still no option to choose mono->stereo version of plugin.

What I do wrong? Where is problem in my code?
For any help great thanks in advance.

Best Regards

Now I’ve just tried new configuration:

bool MyProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
{
    const int numInput = layouts.getMainInputChannels();
    const int numOutput = layouts.getMainOutputChannels();

    if((numInput == 1 && numOutput == 1) ||
       (numInput == 2 && numOutput == 2) ||
       (numInput == 1 && numOutput == 2))
        return true;

    return false;
}

But still in Logic Pro there is no option to choose mono->stereo.

OK,
sorry for that thread. Suddenly everything works fine. I suppose Logic Pro X needed some updating to see new busses configuration. Now I see all options which I expect.

Logic seems to cache some setup information. Changing the acceptable layouts doesn’t seem to get recognized right away. Not sure what, but something needs to be cleared/reset when changing layout information under Logic. :man_shrugging: