diff --git a/beatrix b/beatrix deleted file mode 100755 index 1d37d0d..0000000 Binary files a/beatrix and /dev/null differ diff --git a/midi.c b/midi.c index a9393cb..d414064 100644 --- a/midi.c +++ b/midi.c @@ -1142,12 +1142,18 @@ void process_seq_event(const snd_seq_event_t *ev) { // see "snd_seq_event_type" file:///usr/share/doc/libasound2-doc/html/group___seq_events.html switch(ev->type) { case SND_SEQ_EVENT_NOTEON: - //printf("DEBUG KEY on %i %i\n",ev->data.note.channel, ev->data.note.note); - keyTable = (unsigned char *) statusTable[MIDI_NOTEON|ev->data.note.channel].handback; - oscKeyOn (keyTable[ev->data.note.note]); + printf("DEBUG KEY on %i %i %i\n",ev->data.note.channel, ev->data.note.note, ev->data.note.velocity); + if (ev->data.note.velocity < 1) { + keyTable = (unsigned char *) statusTable[MIDI_NOTEOFF|ev->data.note.channel].handback; + oscKeyOff (keyTable[ev->data.note.note]); + } + else if (ev->data.note.velocity > 0){ + keyTable = (unsigned char *) statusTable[MIDI_NOTEON|ev->data.note.channel].handback; + oscKeyOn (keyTable[ev->data.note.note]); + } break; case SND_SEQ_EVENT_NOTEOFF: - //printf("DEBUG KEY off %i %i\n",ev->data.note.channel, ev->data.note.note); + printf("DEBUG KEY off %i %i\n",ev->data.note.channel, ev->data.note.note); keyTable = (unsigned char *) statusTable[MIDI_NOTEOFF|ev->data.note.channel].handback; oscKeyOff (keyTable[ev->data.note.note]); break;