commit d1e35e0e8b23ed31e27de8a995692477ff51e885
parent 5a5c179f0de65d4a6cbb47503eed02e55186e87e
Author: Hans Petter Selasky <[email protected]>
Date: Sat, 28 Sep 2019 10:45:57 +0200
Add support for SysEx to ALSA sequencer backend.
Signed-off-by: Hans Petter Selasky <[email protected]>
Diffstat:
1 file changed, 13 insertions(+), 0 deletions(-)
diff --git a/src/Nio/AlsaEngine.cpp b/src/Nio/AlsaEngine.cpp
@@ -193,6 +193,19 @@ void *AlsaEngine::MidiThread(void)
break;
case SND_SEQ_EVENT_SYSEX: // system exclusive
+ for (int x = 0; x < event->data.ext.len; x += 3) {
+ uint8_t buf[3];
+ int y = event->data.ext.len - x;
+ if (y >= 3) {
+ memcpy(buf, (uint8_t *)event->data.ext.ptr + x, 3);
+ } else {
+ memset(buf, 0, sizeof(buf));
+ memcpy(buf, (uint8_t *)event->data.ext.ptr + x, y);
+ }
+ midiProcess(buf[0], buf[1], buf[2]);
+ }
+ break;
+
case SND_SEQ_EVENT_SENSING: // midi device still there
break;