VST2 Layout broken with Sidechain


#1

@fabian from the commits it looks like you’re the best person to know what’s wrong. hope you’ll be able to check it.

The problem:
VST2 reports wrong input due to limitations of it and

Code to test it:

  • Create a new Juce Plug-In (Projucer Wizard no need to change anything)
  • Add to busesProperties a “side-chain”:
    .withInput ("Sidechain", AudioChannelSet::stereo(), true)
  • Modify the paint() call in the editor:
    g.drawFittedText (String::formatted("Num of Ch#: %d",processor.getBus(true, 0)->getNumberOfChannels()), getLocalBounds(), Justification::centred, 1);

Now here’s the magic (with VST2).

  • In Cubase, create Mono track.

  • Insert the plug-in.

  • if you don’t report additional .withInput , the mono/stereo would be as expected.

  • adding another bus makes VST2 always use the stereo layout (even though it is mono!)

I’m now going thru
void findMaxTotalChannels (int& maxTotalIns, int& maxTotalOuts)
That I suspect might be the cause.


#2

So it was broken here:

if (pluginHasSidechainsOrAuxs() || filter->isMidiEffect())
    return 0;

In pointer_sized_int handleSetSpeakerConfiguration (VstOpCodeArguments args)

Basically makes the plug-in ignore the layout reported so it will always use the default layout instead of the expected one by the host.


#3

Until someone at JUCE gonna fix this:

Side-chain SHOULD respect layout from host.
VST2 don’t have buses.
I’ve tested this logic with Ableton Live, Bitwig, REAPER and SONAR.

  • I’ve also tested it in Cubase but Cubase isn’t supporting VST2 side-chaining out of the box*.

#4

I’ll do a bit more testing on this, but I think the patch you mention is a reasonable fix.


#5

OK this is now on develop