Added checking for MIDI channel (and ignoring everything that is not our MIDI channel).

When using MASTER_KEY every notes are turned off.
Moved MASTER_KEY one octave up.
pull/4/head
Holger Wirtz 6 years ago
parent 43e8a197f5
commit 5aa25df360
  1. 12
      MicroDexed.ino
  2. 4
      config.h

@ -399,7 +399,16 @@ bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2)
print_midi_event(type, data1, data2); print_midi_event(type, data1, data2);
#endif #endif
type = type & 0xf0; // check for MIDI channel
if (midi_channel != MIDI_CHANNEL_OMNI)
{
uint8_t c = type & 0x0f;
if (c != midi_channel)
return (true);
}
// now throw away the MIDI channel information
type &= 0xf0;
#ifdef MASTER_KEY_MIDI #ifdef MASTER_KEY_MIDI
if (type == 0x80 && data1 == MASTER_KEY_MIDI) // Master key released if (type == 0x80 && data1 == MASTER_KEY_MIDI) // Master key released
@ -411,6 +420,7 @@ bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2)
} }
else if (type == 0x90 && data1 == MASTER_KEY_MIDI) // Master key pressed else if (type == 0x90 && data1 == MASTER_KEY_MIDI) // Master key pressed
{ {
dexed->notesOff();
master_key_enabled = true; master_key_enabled = true;
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Master key enabled")); Serial.println(F("Master key enabled"));

@ -42,8 +42,8 @@
#endif #endif
// Master key handling (comment for disabling) // Master key handling (comment for disabling)
#define MASTER_KEY_MIDI MIDI_C6 #define MASTER_KEY_MIDI MIDI_C7
#define MASTER_NUM1 MIDI_C1 #define MASTER_NUM1 MIDI_C2
// Debug output // Debug output
#define SERIAL_SPEED 38400 #define SERIAL_SPEED 38400

Loading…
Cancel
Save