From 39a21966e246f3f96b99eb9c933f92c617ae241e Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 18 Jan 2020 05:03:36 -0500 Subject: [PATCH] Respond to MIDI "all notes off" message in MIDI-CV and MIDI-Gate. --- src/core/MIDI_CV.cpp | 7 ++++++- src/core/MIDI_Gate.cpp | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/core/MIDI_CV.cpp b/src/core/MIDI_CV.cpp index 23da619b..fe88bcfd 100644 --- a/src/core/MIDI_CV.cpp +++ b/src/core/MIDI_CV.cpp @@ -102,7 +102,6 @@ struct MIDI_CV : Module { /** Resets performance state */ void panic() { - pedal = false; for (int c = 0; c < 16; c++) { notes[c] = 60; gates[c] = false; @@ -237,6 +236,12 @@ struct MIDI_CV : Module { else releasePedal(); } break; + // all notes off (panic) + case 0x7b: { + if (msg.getValue() == 0) { + panic(); + } + } break; default: break; } } diff --git a/src/core/MIDI_Gate.cpp b/src/core/MIDI_Gate.cpp index 799f2c29..b3c861a5 100644 --- a/src/core/MIDI_Gate.cpp +++ b/src/core/MIDI_Gate.cpp @@ -93,10 +93,16 @@ struct MIDI_Gate : Module { pressNote(msg.getNote(), msg.getValue()); } else { - // Many stupid keyboards send a "note on" command with 0 velocity to mean "note release" + // I don't know why, but many keyboards send a "note on" command with 0 velocity to mean "note release" releaseNote(msg.getNote()); } } break; + // all notes off (panic) + case 0x7b: { + if (msg.getValue() == 0) { + panic(); + } + } break; default: break; } }