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