iPlug2 Forum

Some inaccuracies in the work of IPlug2 plugins in DAW Kushview Element

When loading absolutely any plug-in assembled with the IPlug2 framework or the old IPlug in DAW Kushview Element, the plug-in is initialized in mono mode, but other plugins assembled by third-party frameworks are initialized normally, that is, in stereo mode.
Therefore, I cannot figure out why this is happening?
Is this a bug of the DAW Kushview Element or an IPlug2 framework?
I would like to work together to sort out this problem, and if it becomes necessary to contact the developers of Kushview Element, to correct this inaccuracy in the work.

The problem concerns everyone who writes plugins on the IPlug2 framework, because sooner or later one of the users will inform you about this bug.
By the way, the same VST3 plugins are loaded normally.

How about you have a go at fixing it? Start by looking at the juce demo host and see if the behaviour is the same, since elements is based on Juce

Thanks!
I found some inconsistency in the code in the IPlugVST2.cpp file, which causes incorrect initialization of plugins in hosts using the Juce framework.
This is exactly what this piece of code is:

 case effGetSpeakerArrangement:
    {
      VstSpeakerArrangement ** ppInputArr = (VstSpeakerArrangement **) value;
      VstSpeakerArrangement ** ppOutputArr = (VstSpeakerArrangement **) ptr;
      if (ppInputArr)
      {
        * ppInputArr = & (_ this-> mInputSpkrArr);
      }
      if (ppOutputArr)
      {
        * ppOutputArr = & (_ this-> mOutputSpkrArr);
      }
      return 1;
    }

I looked at how this is done in third-party plugins, using audioeffectx.cpp as an example:

case effGetSpeakerArrangement:
v = getSpeakerArrangement (FromVstPtr <VstSpeakerArrangement *> (value), (VstSpeakerArrangement **) ptr)? ten;
break;

where in audioeffectx.h there is a virtual method declaration getSpeakerArrangement (), which is implemented by default like this:

virtual bool getSpeakerArrangement (VstSpeakerArrangement ** pluginInput, VstSpeakerArrangement ** pluginOutput) {* pluginInput = 0; * pluginOutput = 0; return false; } /// <Return the plug-in's speaker arrangements

as a result I made a fix in IPlugVST2.cpp:

case effGetSpeakerArrangement:
    {
      VstSpeakerArrangement ** ppInputArr = (VstSpeakerArrangement **) value;
      VstSpeakerArrangement ** ppOutputArr = (VstSpeakerArrangement **) ptr;
      if (ppInputArr) * ppInputArr = nullptr;
      if (ppOutputArr) * ppOutputArr = nullptr;
      return 0;
    }

With this change, the problem went away.

It would be very nice if a virtual method similar to getSpeakerArrangement() was called in IPlugVST2.cpp so that the developer can override it at his own discretion. However, at the moment, there is no such possibility.