Browse Source

Respond to MIDI "all notes off" message in MIDI-CV and MIDI-Gate.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
39a21966e2
2 changed files with 13 additions and 2 deletions
  1. +6
    -1
      src/core/MIDI_CV.cpp
  2. +7
    -1
      src/core/MIDI_Gate.cpp

+ 6
- 1
src/core/MIDI_CV.cpp View File

@@ -102,7 +102,6 @@ struct MIDI_CV : Module {


/** Resets performance state */ /** Resets performance state */
void panic() { void panic() {
pedal = false;
for (int c = 0; c < 16; c++) { for (int c = 0; c < 16; c++) {
notes[c] = 60; notes[c] = 60;
gates[c] = false; gates[c] = false;
@@ -237,6 +236,12 @@ struct MIDI_CV : Module {
else else
releasePedal(); releasePedal();
} break; } break;
// all notes off (panic)
case 0x7b: {
if (msg.getValue() == 0) {
panic();
}
} break;
default: break; default: break;
} }
} }


+ 7
- 1
src/core/MIDI_Gate.cpp View File

@@ -93,10 +93,16 @@ struct MIDI_Gate : Module {
pressNote(msg.getNote(), msg.getValue()); pressNote(msg.getNote(), msg.getValue());
} }
else { 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()); releaseNote(msg.getNote());
} }
} break; } break;
// all notes off (panic)
case 0x7b: {
if (msg.getValue() == 0) {
panic();
}
} break;
default: break; default: break;
} }
} }


Loading…
Cancel
Save