Bugfix: Make pianola/OMNI mode the default.

git-svn-id: svn://svn.code.sf.net/p/jack-keyboard/code/trunk@16 1fa2bf75-7d80-4145-9e94-f9b4e25a1cb2
This commit is contained in:
hselasky 2011-05-06 11:05:05 +00:00
parent 8c0caf25fe
commit 75c92ecbd6
2 changed files with 12 additions and 4 deletions

1
NEWS
View File

@ -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:

View File

@ -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);