Too many / not enough channels in juce_VST3Common.h

JUCE was recommended to me, rather than just using the Steinberg SDK, as a better way to write a plugin that loads and manipulates other plugins.
This here seems like very, very weird behavior. The same code runs fine for another developer who revised my code (which was giving me other unexplainable errors). But for me, in either JUCE Audio Plugin Host or REAPER 6.35 on Windows 10 (two different computers) gives me a slew of exceptions, one after another. Reaper crashes completely.

My code is here:

Note that I hardcoded:

const String realFileName

as “Surge.vst3” but it should be a VST3 plugin in the same folder as this one (the build folder). Surge, incidentally, is made with JUCE. That’s GPL, like my project will be if it ever works. I know several people have cracked this bizarre trick of hosting a plugin in a plugin, but all with proprietary code, and there is still no guide or tutorial on how this would work.

So here are some screenshots of some of the exceptions I have. Why is it adding the total number of channels to the channel offset, and then jassert-ing that the channel offset is less than the number of channels? Is this a chain of methods that shouldn’t happen? Is it because I’m using VST wrappers both for host and for client?
Is someone going to tell me that my code is the reason this over-channel-numbering is happening?
Because it isn’t my code; it’s code that someone else suggested after revising mine, and it runs without a problem on his computer. With a different vst3…

i just downloaded the project and am getting multiple exceptions. so it is definitely the code, i will debug and see where it goes

problem: the variable


or the plugin youre trying to load.

tried it with the plugin i am working on and it loaded fine. quite laggy though.

the only thing i changed was the file path for the above variable, and it worked as expected. either the plugin youre trying to load is not set up correctly or maybe you dont have permission to access the file

1 Like

Well, this code works on the computer of the guy who wrote it (well, he adapted my code to run on his machine).
The plug-in is found on my machine. Like I suggested, it is expected that you would have to change the path to your own wrapped plug-in.
What I didn’t mention is that it is intended for instrument plug-ins. Could you see if it loads an instrument plug-in normally?

PS I can’t tell exactly what you did, but hard coding the path is not an option. It has to find a plug-in in the same folder as itself. Eventually it will have a name like “WRAPplugin.vst3” and try to load “plugin.vst3” from that.

i hardcoded the path because i dont have “surge.vst3”, but i was getting errors when trying to load Ozone 9 vst3, Fabfilter vst3 and a couple others. it seems to e a hit or miss import system where some files can be added but others cannot.

Incidentally, all of these problems seem to have vanished when I changed the unique_ptr I was using to hold the reference to the wrapped editor to a JUCE SafePointer. I’d tried this previously and it didn’t work, but apparently I took something out that clashed in the meantime.
I will update my GitHub repository to reflect this.