diff --git a/NEWS b/NEWS index 28fd511..3be85f8 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ User-visible changes between 2.5 and 2.6 include: - Bugfix: A key volume of zero means key off. + - Bugfix: Make pianola/OMNI mode the default. - Feature: Don't start jackd when starting jack-keyboard. User-visible changes between 2.4 and 2.5 include: diff --git a/src/jack-keyboard.c b/src/jack-keyboard.c index 85a85ba..6b8f151 100644 --- a/src/jack-keyboard.c +++ b/src/jack-keyboard.c @@ -199,26 +199,33 @@ process_received_message_async(gpointer evp) { int i; struct MidiMessage *ev = (struct MidiMessage *)evp; + int b0 = ev->data[0]; + int b1 = ev->data[1]; - if (ev->data[0] == MIDI_RESET || (ev->data[0] == MIDI_CONTROLLER && - (ev->data[1] == MIDI_ALL_NOTES_OFF || ev->data[1] == MIDI_ALL_SOUND_OFF))) { + /* Strip channel from channel messages */ + if (b0 >= 0x80 && b0 <= 0xEF) + b0 = b0 & 0xF0; + + if (b0 == MIDI_RESET || (b0 == MIDI_CONTROLLER && + (b1 == MIDI_ALL_NOTES_OFF || b1 == MIDI_ALL_SOUND_OFF))) { for (i = 0; i < NNOTES; i++) { piano_keyboard_set_note_off(keyboard, i); } } - if (ev->data[0] == MIDI_NOTE_ON) { + if (b0 == MIDI_NOTE_ON) { if (ev->data[2] == 0) piano_keyboard_set_note_off(keyboard, ev->data[1]); else piano_keyboard_set_note_on(keyboard, ev->data[1]); } - if (ev->data[0] == MIDI_NOTE_OFF) { + if (b0 == MIDI_NOTE_OFF) { piano_keyboard_set_note_off(keyboard, ev->data[1]); } + ev->data [0] = b0 | channel; queue_message(ev); return (FALSE);