From 16077101b232d384741d295d88b78d3122227ca9 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 6 Jul 2022 17:11:49 +0200 Subject: [PATCH] Gate NoteEvent::VoiceTerminated behind MIDI_INPUT --- src/wrapper/clap/wrapper.rs | 4 +++- src/wrapper/vst3/wrapper.rs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wrapper/clap/wrapper.rs b/src/wrapper/clap/wrapper.rs index 10b5c86c..8b44fd6e 100644 --- a/src/wrapper/clap/wrapper.rs +++ b/src/wrapper/clap/wrapper.rs @@ -1011,12 +1011,14 @@ impl Wrapper

{ clap_call! { out=>try_push(out, &event.header) } } + // NOTE: This is gated behind `P::MIDI_INPUT`, because this is a merely a hint event + // for the host. It is not output to any other plugin or device. NoteEvent::VoiceTerminated { timing: _, voice_id, channel, note, - } if P::MIDI_OUTPUT >= MidiConfig::Basic => { + } if P::MIDI_INPUT >= MidiConfig::Basic => { let event = clap_event_note { header: clap_event_header { size: mem::size_of::() as u32, diff --git a/src/wrapper/vst3/wrapper.rs b/src/wrapper/vst3/wrapper.rs index dc598af2..f713db6d 100644 --- a/src/wrapper/vst3/wrapper.rs +++ b/src/wrapper/vst3/wrapper.rs @@ -1591,9 +1591,10 @@ impl IAudioProcessor for Wrapper

{ }; } // VST3 does not support or need these events, but they should also not - // trigger a debug assertion failure in NIH-plug + // trigger a debug assertion failure in NIH-plug. Also notes how this is + // gated by `P::MIDI_INPUT`. NoteEvent::VoiceTerminated { .. } - if P::MIDI_OUTPUT >= MidiConfig::Basic => + if P::MIDI_INPUT >= MidiConfig::Basic => { continue; }