Audio-IN, MIDI-OUT

SDK for VST 3 audio plug-in and host development.
Post Reply
User avatar
iriyama
Posts: 3
Joined: Tue May 01, 2018 7:22 am

Audio-IN, MIDI-OUT

Post by iriyama » Mon May 07, 2018 4:42 am

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

Arne Scheffler
Posts: 282
Joined: Mon Jun 20, 2016 7:53 am

Re: Audio-IN, MIDI-OUT

Post by Arne Scheffler » Mon May 07, 2018 9:34 am

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

User avatar
iriyama
Posts: 3
Joined: Tue May 01, 2018 7:22 am

Re: Audio-IN, MIDI-OUT

Post by iriyama » Tue May 08, 2018 9:19 am

Thanks!
I'll try. ;)

User avatar
iriyama
Posts: 3
Joined: Tue May 01, 2018 7:22 am

Re: Audio-IN, MIDI-OUT

Post by iriyama » Wed May 30, 2018 7:51 am

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

It isn't perfect but I wrote is;

Code: Select all

//-----------------------
//   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);
		}
	}

//.....

Post Reply