Question on VST3 Bus Layout

Hi. A question on VST3 bus layout

Surge is a synth which has a side chain input - not a main input but a side chain input.

When I hand coded our VST3 that meant I used the following layout:

    addAudioInput(STR16("SideChain In"), SpeakerArr::kStereo, kAux);
    addAudioOutput(STR16("Stereo Out"), SpeakerArr::kStereo);
    addAudioOutput(STR16("Scene A Out"), SpeakerArr::kStereo);
    addAudioOutput(STR16("Scene B Out"), SpeakerArr::kStereo);

the kAux really matters. For one thing, it tells Reaper to not route audio through the synth.

If I look at juce_VST3_Wrapper.cpp I see this

 info.busType = (dir == Vst::kInput && index > 0 ? Vst::kAux : Vst::kMain);

which basically says "input 0 is main and input 1 and above is aux’. But I want my input 0 to be aux.

So how do I accomplish this in juce? I tried making my bus layout

BusesProperties()
                         .withOutput("Output", AudioChannelSet::stereo(), true)
                         .withInput( "Ignored Input", AudioChannelSet::disabled(), false)
                         .withInput("Sidechain", AudioChannelSet::stereo(), true)
                         .withOutput("Scene A", AudioChannelSet::stereo(), false)
                         .withOutput("Scene B", AudioChannelSet::stereo(), false))

but when I scan with the validator then I get (correctly)

Info:  => Audio Buses: [2 In(s) => 3 Out(s)]
Info:       In [0]: "Ignored Input" (Main-Default Active) 
Info:       In [1]: "Sidechain" (Aux-Default Active) 
Info:       Out[0]: "Output" (Main-Default Active) 
Info:       Out[1]: "Scene A" (Main-Default Active) 
Info:       Out[2]: "Scene B" (Main-Default Active) 

but the working pattern I need is

Info:  => Audio Buses: [1 In(s) => 3 Out(s)]
Info:       In [0]: "SideChain In" (Aux-Default Active) 
Info:       Out[0]: "Stereo Out" (Main-Default Active) 
Info:       Out[1]: "Scene A Out" (Main-Default Active) 
Info:       Out[2]: "Scene B Out" (Main-Default Active) 

to work properly in the various tools.

(Of course I could just patch the vst3 wrapper I guess but am trying as hard as possible to ship surge xt without patching juce and I’m sure there’s an answer to this).

Thanks

I don’t know all the implications, formats, etc.

If someone is sending audio to Surge I guess it’s intentional and more intuitive for them to not need to route a sidechain/mess with channel routings. Less user setup.

Conceptually a sidechain input/auxiliary input is an extra input, but Surge only has one.

Maybe you do this because you want to avoid writing your output to the same buffer that contains the audio input, but if I remember correctly Surge processes at fixed block sizes, so it’s just a matter of doing a local copy.

But as said, as a user I’d prefer things to just work without setup.

Nah it’s obviously wrong in reaper as a main. As an aux it routes the the internal bus to the synth just like in 1.9 and as a main it copies to out with phasing errors

It is a sidechain not an input

Oh also (and I forgot tbis) some Cubase versions don’t support synth with a main Input and only allow sidechaining to be activated if the bus is labeled aux. that’s how we got to the pre juce topology above which we need to replicate

Yes. The reason juce doesn’t support it is the line above which always assumes input 0 is kmain. If it is set to kaux it works perfectly. Just download surge 1.9 (which is prejuce) and you will see the vst3 doing the right thing.

I can always patch juce in my build pipeline. Something gross like take the above code and strcmp the name with sidechain for bus 0 and aux it. Then it will behave correctly. But was hoping to avoid maintaining a surge specific juce patch!

Ideally there would be some flag on a bus like “bus type” which triggered this, defaults to unset so current behavior is in play, and let’s you control it

I’ve added a function to the VST3ClientExtensions which can be overridden to switch the first input bus between kMain and kAux:

3 Likes

Have I mentioned lately how happy I am to have ported Surge to JUCE. You guys are so responsive and helpful. And it is just great software.

Thank you very much!

[Scan Buses]
Info:  ===Scan Buses ====================================
Info:  => Audio Buses: [1 In(s) => 3 Out(s)]
Info:       In [0]: "Sidechain" (Aux-Default Active) 
Info:       Out[0]: "Output" (Main-Default Active) 
Info:       Out[1]: "Scene A" (Main-Default Active) 
Info:       Out[2]: "Scene B" (Main-Default Active) 
Info:  => Event Buses: [1 In(s) => 0 Out(s)]
Info:       In [0]: "MIDI Input" (Main-Default Active) 

Thanks so much!