From 0a3511033a44275bfeebfe74f3c1ceaa927cc314 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Wed, 3 Oct 2018 09:03:37 +0200 Subject: [PATCH] Fixing MIDI input channel. --- MicroDexed.ino | 6 ++++-- config.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index a7fd540..cc0c4b3 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -358,7 +358,7 @@ void handle_input(void) #ifdef SHOW_MIDI_EVENT void print_midi_event(uint8_t type, uint8_t data1, uint8_t data2) { - Serial.print(F("MIDI-Channel: ")); + Serial.print(F("Listen MIDI-Channel: ")); if (midi_channel == MIDI_CHANNEL_OMNI) Serial.print(F("OMNI")); else @@ -367,6 +367,8 @@ void print_midi_event(uint8_t type, uint8_t data1, uint8_t data2) if (type < 16) Serial.print(F("0")); Serial.print(type, HEX); + Serial.print(F(", incoming MIDI channel: ")); + Serial.print((type & 0x0f) + 1, DEC); Serial.print(F(", data1: ")); Serial.print(data1, DEC); Serial.print(F(", data2: ")); @@ -461,7 +463,7 @@ bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2) if (midi_channel != MIDI_CHANNEL_OMNI) { uint8_t c = type & 0x0f; - if (c != midi_channel) + if (c != midi_channel - 1) { #ifdef DEBUG Serial.print(F("Ignoring MIDI data on channel ")); diff --git a/config.h b/config.h index 4f88a7d..52a1598 100644 --- a/config.h +++ b/config.h @@ -65,7 +65,7 @@ // Debug output #define SERIAL_SPEED 38400 -//#define DEBUG 1 +#define DEBUG 1 #define SHOW_MIDI_EVENT 1 #define SHOW_XRUN 1 #define SHOW_CPU_LOAD_MSEC 5000