Initial VST "Hello World" project in the tutorials hits runtime error?

projucer
tutorials

#1

I’m trying to teach myself VST programming (total beginner) and have been following https://docs.juce.com/master/tutorial_create_projucer_basic_plugin.html as a guide.

I have followed it nearly exactly - the steinberg SDK is correctly installed, the MIDI Input/output boxes are ticked, I haven’t changed any code yet - only difference is that I changed the windows target platform to 10.0.17134.0 from 10.0.16299.0, because I couldn’t figure out how to retarget my visual studio solution to an older version of the Windows SDK. This could be the problem?

Anyway, I hit a runtime error on line 360 of juce_AudioProcessor.cpp, inside AudioProcessor::setPlayConfigDetails:


success evals to true, newNumOuts == getTotalNumOutputChannels() == 2, that’s all correct. newNumIns however evaluates to 1, and getTotalNumInputChannels() == 2, hence failure. I’m not sure what to make of the comments here and in the definition, anyone know what these variables are for (and perhaps what setting to change in the projucer)?


#2

What host are you running when getting the error? Or is it maybe the stand alone application build that triggers the error?


#3

I’m running the standalone plugin


#4

Some hardwares will refuse to run with fairly normal IO configurations like 1 in and 2 out. Try running the code as a plugin in a DAW app like Cubase, Reaper or Tracktion to see if it runs at least in those.


#5

Can you have a look into your isBusesLayoutSupported() implementation? It should return true for the configuration you selected in your AudioOptions in the standalone wrapper.

Or if you use the old way in Projucer, make sure you add {1,2} to the configurations in “Plugin Channel Configuration” (but the more precise and future proof version is to implement the isBusesLayoutSupported() in your AudioProcessor)

Hope that helps


#6

This fixed it, thanks! Though to be clear on what’s happening here - specifying {1,2} tells my plugin to take mono input from my mic, and output in stereo? I’ll take a look at implementing isBusesLayoutSupported() once I get more familiar with this framework. I did check it’s return value - was indeed false for several calls, though not all.

At any rate, I’m good to get started.


#7

Yes, that’s exactly the case.
When the host tries to use your plugin, it will call isBusesLayoutSupported() to check, if your plugin can process like that. You can then accept or reject that specific combination.

In doubt, you can for testing add a return true; to accept everything, but to use it then later, you have to implement your processBlock in a way, that can indeed cope with every combination.