From a3ea44fd4844171fd990562f935cfb278c29b3a7 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 20 Sep 2006 17:16:58 +0000 Subject: Some updates (mostly guesswork) for the ALSA MIDI driver, mostly prompted by Waxworks (Simon engine). See http://www.borg.com/~jglatt/tech/midispec.htm for reference. * Added case for Aftertouch (Key Pressure). * Changed Channel Pressure to flush the event immediatley. The message could apply to notes while they are playing. * Downgraded the error for unknown MIDI messages to a warning, and clarified it slightly. svn-id: r23949 --- backends/midi/alsa.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp index 5a59a7d063..a5fc13124f 100644 --- a/backends/midi/alsa.cpp +++ b/backends/midi/alsa.cpp @@ -161,6 +161,10 @@ void MidiDriver_ALSA::send(uint32 b) { snd_seq_ev_set_noteon(&ev, chanID, midiCmd[1], midiCmd[2]); send_event(1); break; + case 0xA0: + snd_seq_ev_set_keypress(&ev, chanID, midiCmd[1], midiCmd[2]); + send_event(1); + break; case 0xB0: /* is it this simple ? Wow... */ snd_seq_ev_set_controller(&ev, chanID, midiCmd[1], midiCmd[2]); @@ -172,7 +176,7 @@ void MidiDriver_ALSA::send(uint32 b) { break; case 0xD0: snd_seq_ev_set_chanpress(&ev, chanID, midiCmd[1]); - send_event(0); + send_event(1); break; case 0xE0:{ // long theBend = ((((long)midiCmd[1] + (long)(midiCmd[2] << 7))) - 0x2000) / 4; @@ -184,7 +188,7 @@ void MidiDriver_ALSA::send(uint32 b) { break; default: - error("Unknown Command: %08x\n", (int)b); + warning("Unknown MIDI Command: %08x", (int)b); /* I don't know if this works but, well... */ send_event(1); break; -- cgit v1.2.3