Audio-IN, MIDI-OUT

Hello.
I’d like to make a VST3 Plugin which has “Audio-IN” and “MIDI-OUT”.
I’m trying ;
(1) Base on “ADelay” example (in VST3-SDK 3.6.9) for “Audio-IN”.
(2) Changing IDs in “adelayids.h”.
(3) Adding APIs for “MIDI-OUT”.
(3-1) addEventOutput() on “Processor::initialize”.
(3-2) …(?)

I couldn’t find any APIs for writing “MIDI-OUT” in process().

for example “NOTE-ON (0x90 0x40 0x7F)”

Hi,
in your process function you get ProcessData which has the optional member outputEvents which is a IEventList. This can be used to add events like note on and off.

Cheers,
Arne

Thanks!
I’ll try. :wink:

I wrote a code with “IEventList”.
And, it works. Thanks.

It isn’t perfect but I wrote is;

//-----------------------
//   processor.cpp
//-----------------------

//.....

//(added)
#include "pluginterfaces/vst/ivstevents.h"

//.....

tresult PLUGIN_API Utnspl41Processor::process (ProcessData& data)

//.....

	//note-on (added)
	if (true) {
		// --- get the event list for output
		IEventList*  mylist = data.outputEvents;
		if (mylist)
		{
			Event midiEvent = { 0 };
			midiEvent.busIndex = 0;
			midiEvent.sampleOffset = 0; // location
			midiEvent.type = Event::kNoteOnEvent;

			// --- set the channel/note/vel
			midiEvent.noteOn.channel = 0;

			midiEvent.noteOn.pitch = 60; // MIDI note nume
			midiEvent.noteOn.velocity = 0.40; // VEL=50; in velocity [0,1]
			midiEvent.noteOn.noteId = 60;

			mylist->addEvent(midiEvent);
		}
	}

//.....

Did you manage to catch the MIDI-out events somewhere?

I’ve received on MIDI Track of Cubase.:slight_smile:

Wow. That’s exactly what I want to do too. So you just had to add the IEventList in the ProcessData?

By the way: I use the ASPiK SDK. It’s much easier to compile for Audio Units and AAX after with the same code. But the base is still the VSTSDK / VSTGUI.

Yes.
I think so.
Otherwise, (as I wrote above)

(3-1) addEventOutput() on “Processor::initialize”.

and

#include “pluginterfaces/vst/ivstevents.h”

I’m interested in such usage and SDKs.
I didn’t know ASPiK.
Please feel free to discuss. :slight_smile:

MIDI out in VST now works here. Thank you.

ASPiK is cool. As soon as you are set up, you write your code only once for five systems:

  • Windows VST3
  • Windows AAX
  • Mac VST3
  • Mac AAX
  • Mac Audio Units

There are few files to edit.
Everything relies on VSTSDK and VSTGUI.
The only thing that I am missing is iOS.

Now I will try if my VST-MIDI-OUT will work with Audio Units.

Meanwhile I am trying to compile the interApp and iOS/AUv3 examples from the VSTSDK (3.6 and 3.7) with no success. I always get errors for missing libraries.

The only thing I did get to work is AUv3 for macOS, which is nice too because it’s then a kind of standalone. I will try if MIDI comes out of that soon.

1 Like

I am trying to sent MIDI with a FX plugin. I was wondering how this could work at all. For example, if I have an instrument on MIDI channel 0 and play the keys, my FX plugin will receive the MIDI events. But is it possible to sent MIDI notes back to the instrument, for example to let it play different notes?

Try this code in the process() function:

    if (data.outputEvents) {
        Vst::Event event;
        event.type = Vst::Event::kNoteOnEvent;
        event.noteOn.channel = 0;
        event.noteOn.pitch = 60;
        event.noteOn.velocity = 1;
        data.outputEvents->addEvent(event);
    }

It appears that data.outputEvents is always null. Is there a configuration needed in the host to make that work? I am trying with Ableton Live …

Each VST3 host decide if they support event as output o, it will f a plugin. You could try it with Cubase it will work, you could send a request to Ableton Live for supporting this VST3 feature.

1 Like

ASPiK was a very nice SDK, but it’s developement seems to be abandonned.
Now I am looking for a way to wrap VST3 to AUV2, which does not works as easy as in the description.
Today I have eveerything new, XCode 14.3, macos 13.4 Arm-Processor M2, only the VST3-plugins seem to work.

Thanks, I managed to do it. Cubase worked immediately, Reaper also, Live crashed with MIDI-out last year but is better now.