From 542b3052f20d9a078b077f56e8711080989f2cc6 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 4 Nov 2022 21:19:32 +0100 Subject: [PATCH] Support running status MIDI events --- src/midi.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/midi.rs b/src/midi.rs index 412d30ed..4b9f1a41 100644 --- a/src/midi.rs +++ b/src/midi.rs @@ -353,6 +353,16 @@ impl NoteEvent { let event_type = midi_data[0] & midi::EVENT_TYPE_MASK; let channel = midi_data[0] & midi::MIDI_CHANNEL_MASK; match event_type { + // You thought this was a note on? Think again! This is a cleverly disguised note off + // event straight from the 80s when Baud rate was still a limiting factor! + midi::NOTE_ON if midi_data[2] == 0 => Ok(NoteEvent::NoteOff { + timing, + voice_id: None, + channel, + note: midi_data[1], + // Few things use release velocity. Just having this be zero here is fine, right? + velocity: 0.0, + }), midi::NOTE_ON => Ok(NoteEvent::NoteOn { timing, voice_id: None,