diff --git a/src/detail/vst3/categories.cpp b/src/detail/vst3/categories.cpp index 9b929f01..4d0d6291 100644 --- a/src/detail/vst3/categories.cpp +++ b/src/detail/vst3/categories.cpp @@ -57,6 +57,7 @@ static const struct _translate // CLAP main categories { CLAP_PLUGIN_FEATURE_INSTRUMENT , PlugType::kInstrument }, { CLAP_PLUGIN_FEATURE_AUDIO_EFFECT , PlugType::kFx}, + { CLAP_PLUGIN_FEATURE_NOTE_EFFECT , PlugType::kInstrumentSynth}, // it seems there is no type for a sequencer etc { CLAP_PLUGIN_FEATURE_DRUM , PlugType::kInstrumentDrum}, { CLAP_PLUGIN_FEATURE_ANALYZER , PlugType::kAnalyzer}, diff --git a/src/detail/vst3/process.cpp b/src/detail/vst3/process.cpp index a73471ea..959119a3 100644 --- a/src/detail/vst3/process.cpp +++ b/src/detail/vst3/process.cpp @@ -617,7 +617,43 @@ namespace Clap switch (event->type) { case CLAP_EVENT_NOTE_ON: + { + auto nevt = reinterpret_cast(event); + + Steinberg::Vst::Event oe{}; + oe.type = Steinberg::Vst::Event::kNoteOnEvent; + oe.noteOn.channel = nevt->channel; + oe.noteOn.pitch = nevt->key; + oe.noteOn.velocity = nevt->velocity; + oe.noteOn.length = 0; + oe.noteOn.tuning = 0.0f; + oe.noteOn.noteId = nevt->note_id; + oe.busIndex = 0; // FIXME - multi-out midi still needs work + oe.sampleOffset = nevt->header.time; + + if (_vstdata && _vstdata->outputEvents) + _vstdata->outputEvents->addEvent(oe); + } + return true; case CLAP_EVENT_NOTE_OFF: + { + auto nevt = reinterpret_cast(event); + + Steinberg::Vst::Event oe{}; + oe.type = Steinberg::Vst::Event::kNoteOffEvent; + oe.noteOff.channel = nevt->channel; + oe.noteOff.pitch = nevt->key; + oe.noteOff.velocity = nevt->velocity; + oe.noteOn.length = 0; + oe.noteOff.tuning = 0.0f; + oe.noteOff.noteId = nevt->note_id; + oe.busIndex = 0; // FIXME - multi-out midi still needs work + oe.sampleOffset = nevt->header.time; + + + if (_vstdata && _vstdata->outputEvents) + _vstdata->outputEvents->addEvent(oe); + } return true; case CLAP_EVENT_NOTE_END: case CLAP_EVENT_NOTE_CHOKE: diff --git a/src/wrapasvst3.cpp b/src/wrapasvst3.cpp index 4fe28cbe..b9a4b3af 100644 --- a/src/wrapasvst3.cpp +++ b/src/wrapasvst3.cpp @@ -389,6 +389,10 @@ void ClapAsVst3::addMIDIBusFrom(const clap_note_port_info_t* info, uint32_t inde { addEventInput(name16, numchannels, Vst::BusTypes::kMain, Vst::BusInfo::kDefaultActive); } + else + { + addEventOutput(name16, numchannels, Vst::BusTypes::kMain, Vst::BusInfo::kDefaultActive); + } } }