From 10f0c0b60dee4b8bb4fb1685bc478ecdc5b526aa Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Wed, 28 Jun 2023 18:44:05 +0200 Subject: Add channel selection for bypassed keyboard --- src/app.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/app.c') diff --git a/src/app.c b/src/app.c index de3d796..8f70a6e 100644 --- a/src/app.c +++ b/src/app.c @@ -536,7 +536,16 @@ app_surface_event(u8 type, u8 index, u8 value) { } return; } + // Find the minimum channel the keyboard can use for sending + // notes. u8 channel = 0; + for (int i = 0; i < 16; i++) { + if (state.ch_listen[i] != 0) { + channel = i; + break; + } + } + // TODO: Aftertouch? // TODO: Per KBD channel selection. int note = kbd_find_note(index); -- cgit v1.2.1