Plugin Host. 'Summing' VST3/VST2 plugin outputs to AudioDevice Buffer

I have submitted a request to have my original post to be deleted.

I am writing a Superior Drummer 3 ‘Grid Editor’ type thing that I will utilize
with Steven Slate Drums SSD5, but it would not hurt it it also worked with
other drum VST’s like MT Power Drumkit.

In the end I will utilize it as a plug in in my DAW for editing purposes but decided to start it as a ‘standalone’ application (bad idea!).

My questions are from the view point of a VST host, not a VST plugin.

My issue seems to be a difference between the way a VST3 VST are acting.

My real question here is toward the bottom in:

void _rMidiAudioDeviceCallBack::ProcessorCallBack(juce::AudioBuffer *AudioDeviceBuffer)
‘// Questions / Confusion’

I have 4 plugins that have more than one output buses:
– IkMultiMedia Philharmonik 2 (VST3), 16 stereo buses, 32 channels.
I am using this because it is the only mutli channel VST3 I Own.
– Steven Slate SSD4 (VST), 8 Stereo Buses, 8 Mono Buses, 24 channels.
– Steven Slate SSD5 (VST), 24 Stereo buses, 48 channels.
– MT Power Drumkit (VST) 2 8 Stereo Buses, 16 Channels.

The Philharmonik works (empirically) as expected, sound on all buses / channels.
It is a VST3. I understand that this is ‘working’ due to the fact that the
VST3 is ‘summing’ the channels.

(I understand this is an incorrect statement. It is empirically based):
The VST’s (SSD4, SSD5, MT Power Drumkit) will only produce sound on bus[0], Stereo 1, Channels 0,1.

Please forgive the this->, I like to type!

I start by loading plugins as follows:

int _rMidiStandAlone::LoadVst3PlugIn(
std::unique_ptr *PlugInPtr,juce::String PlugInPath,
juce::OwnedArrayjuce::PluginDescription *ThePlugInDescriptionPtr)
{juce::VST3PluginFormat *Format=(juce::VST3PluginFormat *)nullptr;

if((Format=new juce::VST3PluginFormat()))

delete Format;
Format=(juce::VST3PluginFormat *)nullptr;
} // End if((Format=new juce::VST3PluginFormat()))



int _rMidiStandAlone::LoadVstPlugIn(
std::unique_ptr *PlugInPtr,
juce::String *PlugInPath,
juce::OwnedArrayjuce::PluginDescription *ThePlugInDescriptionPtr)
{juce::VSTPluginFormat *Format=(juce::VSTPluginFormat *)nullptr;

if((Format=new juce::VSTPluginFormat()))
delete Format;
Format=(juce::VSTPluginFormat *)nullptr;
} // if((Format=new juce::VSTPluginFormat()))


Both of the above methods call:

int _rMidiStandAlone::LoadPlugInGeneric(
juce::AudioPluginFormat *Format,std::unique_ptr *PlugInPtr,
juce::String *TargetPlugInPath,
juce::OwnedArrayjuce::PluginDescription *ThePlugInDescriptionPtr)

if(((*PlugInPtr)->enableAllBuses)()) // Even Though They Are Already All Enabled.
} // End if((this->NewPlugInDescription->size)())


I have had this code running and commented out.
It has not effect (changes nothing) whether it runs or not:


(DebugLogFile->LogMessage)(_T(“BusLayout Is In Fact Supported”));
(DebugLogFile->LogMessage)(_T("(PlugInPtr->setBusesLayout)() Success"));

When I ‘Set’ my processor within my AudioDeviceCallBack:

void _rMidiAudioDeviceCallBack::SetProcessor(juce::AudioProcessor *const TheProcessor)
{bool SupportsDouble;

// _rMidiAudioDeviceCallBack::PlugInOutPutChannels. PlugInOutPutChannels;
// (TheProcessor->getTotalNumOutputChannels)() is returning the correct number of channels.





Finally, when my audioDeviceIOCallback() fires and I have a Processor:

void _rMidiAudioDeviceCallBack::ProcessorCallBack(juce::AudioBuffer *AudioDeviceBuffer)
{juce::AudioBuffer *MyPlugInOutputs=(juce::AudioBuffer *)nullptr;
int TheNumberOfChannels=jmax((this->Processor->getTotalNumInputChannels)(),(this->Processor->getTotalNumOutputChannels)());

// TheNumberOfChannels Is Always Correct, VST3:32, VST2: SSD4:24, SSD5:48, MT PowerKit:16
// _rMidiAudioDeviceCallBack::PlugInOutputData Is A juce::AudioBuffer

for(int i=0;i<TheNumberOfChannels;i++)
//_rMidiAudioDeviceCallBack::PlugInOutPutChannels Is A juce::HeapBlock<float *>

if((MyPlugInOutputs=new juce::AudioBuffer(this->PlugInOutPutChannels,(jmax((this-Processor->getNumInputChannels)(),(this->Processor->getNumOutputChannels)())),1024)))

// Questions / Confusion
// VST3:
// It seems to have ‘summed’ all 32 channels of Audio and has put the summed
// audio into MyPlugInOutputs[0] and MyPlugInOutputs[1].
// I currently do not understand why this is so.
// I would have expected 32 channels of data, without channels 0,1 being overwritten wit the summed audio.
// VST:
// It has not ‘summed’ all 16 (MT Power Kit as example) channels of audio.
// I assume that the audio output is still in each channel.
// So:
// - VST: How do I ‘sum’ the outputs of the 16 channels into the AudioDeviceBuffer channels?
// - VST/VST3: What do I do about the difference between a VST and VST3?
// Perhaps I am better off understanding how to tell the VST3 to not sum the channels
// and treat a VST and VST3 the same?
for (int i=0;i<(AudioDeviceBuffer->getNumChannels)();++i)

delete MyPlugInOutputs;


Any insight would be greatly appreciated.