On Tue, Oct 04, 2011 at 07:08:00AM +0200, Roy Vegard Ovesen wrote:
On Mon, 2011-10-03 at 17:19 -0400, S. Massy wrote:
Hello,
I got Beatrix patched and running, but it doesn't seem to receive/honour
noteoffs: so notes don't decay.
I had the same problem. Actually Beatrix does honor noteoff, but it does
not treat noteon with velocity=0 as noteoff. Try the attached patch.
Thanks, it
indeed does the trick!
Cheers,
S.M.
--
Roy Vegard
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;
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user(a)lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user
--