Midi input

SDK for VST 3 audio plug-in and host development.
Post Reply
jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Midi input

Post by jared » Fri Mar 22, 2019 3:18 am

Hello.

I'm trying to get Midi input into the helloworld plugin example. Just note on / off messages, not CC for automation. I have searched far and wide in the documentation and examples and am somehow unable to find any explanation of how to do this. I must just be missing it somehow.

Does all midi input have to go through my controller class? I tried inheriting IMidiMapping like in the AGain example, but am unable to compile due to a very obscure error. Is there some setting somewhere I have to change (that isn't in my plugcontroller.cpp or plugcontroller.h)?

Is there no example of a basic VSTi?

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

Re: Midi input

Post by Arne Scheffler » Fri Mar 22, 2019 7:56 am

Hi,
you don't have to add anything to AGain to let it receive note events. It already has an event input bus declared.
See AGain::initialize:

Code: Select all

	//---create Event In/Out buses (1 bus with only 1 channel)------
	addEventInput (STR16 ("Event In"), 1);
To actually use the events you have to change the AGain::process method. The notes are in the ProcessData structure in the inputEvents member.

And the simplest Instrument example is the note_expression_synth in the SDK.

I hope this helps,
Arne

jared
Posts: 6
Joined: Tue Mar 19, 2019 9:42 pm

Re: Midi input

Post by jared » Fri Mar 22, 2019 11:35 pm

Great, thanks!

I was trying to just set up the helloword project like Again, but I was missed that part in Again::initialize!

I should be able to work it out from here, I just wanted to check I was moving in the right direction before spending too much time on it.

Cheers,

Jared

Post Reply