Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VST instrument multiple in and out

Tags:

c++

midi

audio

vst

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?

like image 439
Daniel Rodrigues Avatar asked May 26 '11 16:05

Daniel Rodrigues


People also ask

Can you have multiple outputs in Logic?

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).

How do VST instruments work?

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).


1 Answers

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 VstMidiEvents 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.

like image 148
Nik Reiman Avatar answered Oct 05 '22 18:10

Nik Reiman