VST Hosting: how to mux instruments?

I would not suggest clamping. The sum is the sum. I agree with you it seems that it is going to be reaching > 1 very quickly but remember that if you sum a bunch of instruments, what matters is the sum of ALL of them. For example, if you have a plugin that generates a sine wave varying between +2 and -2 and another plugin that generates a sine wave in opposite phase (varying between -2 and +2), each plugin is obviously going beyond +1, but the sum of those 2 plugins will be total silence!

If that becomes an issue, I would suggest adding gain knobs for your instruments so that the USER (not the software) can lower/raise each instrument according to what sounds “right” and not a hard mathematical formula (clamp).

The VST3 SDK (which can download from https://www.steinberg.net/en/company/developers.html) comes with bunch of example and as you can see here https://github.com/steinbergmedia/vst3_public_sdk/blob/master/samples/vst/again/source/againsimple.cpp#L203 the method you implement is

 tresult PLUGIN_API AGainSimple::process (ProcessData& data)

I would suggest reading the documentation that comes with the SDK (index.html at the root).

Also, and this is personal promotion :wink:, I would suggest looking at Jamba (GitHub - pongasoft/jamba: A lightweight VST2/3 framework) a framework I am developing to help in writing VST3 (as well as VST2 wrapper and Audio Unit wrapper) plugins. Especially when you start, you can create a fully working plugin with a simple command line (vs copy/paste/scratch your head to figure out what to change with the plain VST SDK).

Yan