From 49c0ac637002a54c805084e59b99ec4bdddb7e7a Mon Sep 17 00:00:00 2001 From: Daniel Gallups Date: Thu, 5 Dec 2024 23:36:52 -0500 Subject: [PATCH] fix: note on message with velocity of 0 is note off --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 16076bd..8dac50d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,7 +31,7 @@ impl MidiMessage { #[must_use] pub fn is_note_off(&self) -> bool { - (self.msg[0] & 0b1111_0000) == NOTE_OFF_STATUS + (self.msg[0] & 0b1111_0000) == NOTE_OFF_STATUS || (self.is_note_on() && self.msg[2] == 0) } /// Get the channel of a message, assuming the message is not a system message.