Help with intput/output layouts (mono->stereo implementation)


#1

Hey guys. I want my plugin to support stereo in stereo out and mono in stereo out (but never mono out), I simply can’t figure out how to do this. I would have thought simply removing this check:

 if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
    return false;

from the template would enable mono in to stereo out, but I can’t get the mono->stereo option to appear in logic. Do I need to add some information the ctor? At the moment it has

 .withInput  ("Input",  AudioChannelSet::stereo(), true)

I don’t know if I’m also supposed to add a mono AudioChannelSet in the ctor (since the plugin already supports mono), and if so how to make that input a “main input channel set”.

Any help would be greatly appreciated, thanks in advance!


#2

Try the following:

  • In the constructor, define stereo->stereo

  • implement the virtual function bool isBusesLayoutSupported (const BusesLayout& layouts) const override; that should return true for mono->stereo and stereo->stereo, somewhat like:

    bool isBusesLayoutSupported (const BusesLayout& layouts) const override
    {
    if (layouts.getMainInputChannels() <= 2
    && layouts.getMainOutputChannels() == 2)
    {
    return true;
    }
    return false;
    }


#3

If you are using Projucer, set the I/O as {1,2},{2,2} and you won’t have to write any code. The auto-generated bootstrap plugin code from that will already handle it correctly.


#4

Does Logic support mono->stereo plug-ins? I know that many other DAWs don’t. It will work in the JUCE demo host, however, so you could try that.