I want to create a VST instrument that has 16 MIDI inputs and at least 16 audio outputs. Similar to how kontakt or halion do this.
Any ideas?
Logic Pro supports the multiple outputs of all instruments that provide a multi-output configuration (including Drum Kit Designer, Sampler, Studio Horns, Studio Strings, Ultrabeat, and all Audio Unit instruments).
VST instruments receive notes as digital information via MIDI, and output digital audio. Effect plugins receive digital audio and process it through to their outputs. (Some effect plugins also accept MIDI input—for example, MIDI sync to modulate the effect in sync with the tempo).
As @leftaroundabout noted, it's unlikely that you need 16 inputs and outputs, especially for an instrument. However, having 16 MIDI inputs and 16 audio outputs is very common for drum machines and other multitracked instruments where the user might want to process each voice individually. Audio inputs in general are not particularly useful for instruments as a whole.
That said, you simply instantiate your plugin like so:
MyPlugin::MyPlugin(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, 0, kNumParameters) {
if(audioMaster) {
setNumInputs(0);
setNumOutputs(16);
}
// other constructor stuff ...
}
That's your starting point. However, since the vast majority of plugins are stereo only, there is a bunch of other work you will need to do to get the host to deliver you 16 output channels (assuming it supports it). You will likely need to call getSpeakerArrangement()
and setSpeakerArrangement()
at some point, and also override getOutputProperties()
.
As for the MIDI channels, the host should not treat them any differently than normal. You will be delivered regular MIDI events, in the form of VstMidiEvent
s which will contain regular MIDI data (ie, for all 16 channels if the user so chooses). This is the easy part -- it's getting the outputs set up that's the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With