From c8ab208f2aef9323118ae2a56c12c259fb205e0a Mon Sep 17 00:00:00 2001 From: defiantnerd <97224712+defiantnerd@users.noreply.github.com> Date: Sat, 10 Feb 2024 21:10:37 +0100 Subject: [PATCH] Fix/portindex (#221) * fix port index comparison --- src/wrapasauv2.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wrapasauv2.cpp b/src/wrapasauv2.cpp index 55f948dc..a5f0d961 100644 --- a/src/wrapasauv2.cpp +++ b/src/wrapasauv2.cpp @@ -1348,12 +1348,13 @@ UInt32 WrapAsAUV2::GetAudioChannelLayout(AudioUnitScope scope, AudioUnitElement void WrapAsAUV2::send(const Clap::AUv2::clap_multi_event_t& event) { + // port index maps back to MIDI out auto type = event.header.type; switch (type) { case CLAP_EVENT_NOTE_ON: { - auto portid = 1; // event.note.port_index; + auto portid = event.note.port_index; for (auto& i : _midi_outports) { if (i->_info.id == portid) @@ -1366,7 +1367,7 @@ void WrapAsAUV2::send(const Clap::AUv2::clap_multi_event_t& event) break; case CLAP_EVENT_NOTE_OFF: { - auto portid = 1; // event.note.port_index; + auto portid = event.note.port_index; for (auto& i : _midi_outports) { if (i->_info.id == portid)