Small fixes.

pull/4/head
Holger Wirtz 6 years ago
parent adf748a2b4
commit 6bd7905dbc
  1. 22
      MicroDexed.ino
  2. 2
      config.h

@ -182,14 +182,14 @@ void handle_midi_input(void)
while (midi_usb.read()) while (midi_usb.read())
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("MIDI-USB")); Serial.println(F("[MIDI-USB]"));
#endif #endif
if (midi_usb.getType() >= 0xf0) // SysEX if (midi_usb.getType() >= 0xf0) // SysEX
{ {
handle_sysex_parameter(midi_usb.getSysExArray(), midi_usb.getSysExArrayLength()); handle_sysex_parameter(midi_usb.getSysExArray(), midi_usb.getSysExArrayLength());
} }
else else if (queue_midi_event(midi_usb.getType(), midi_usb.getData1(), midi_usb.getData2()))
queue_midi_event(midi_usb.getType(), midi_usb.getData1(), midi_usb.getData2()); return;
} }
#endif #endif
@ -202,8 +202,8 @@ void handle_midi_input(void)
{ {
handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength()); handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength());
} }
else else if (queue_midi_event(MIDI.getType(), MIDI.getData1(), MIDI.getData2()))
queue_midi_event(MIDI.getType(), MIDI.getData1(), MIDI.getData2()); return;
} }
} }
@ -331,9 +331,6 @@ 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
#ifdef SHOW_MIDI_EVENT
print_midi_event(type, data1, data2);
#endif
type = type & 0xf0; type = type & 0xf0;
#ifdef MASTER_KEY_MIDI #ifdef MASTER_KEY_MIDI
@ -357,6 +354,7 @@ bool queue_midi_event(uint8_t type, uint8_t data1, uint8_t data2)
else else
#endif #endif
ret = dexed->processMidiMessage(type, data1, data2); ret = dexed->processMidiMessage(type, data1, data2);
#ifdef MASTER_KEY_MIDI #ifdef MASTER_KEY_MIDI
} }
#endif #endif
@ -426,14 +424,16 @@ void store_voice_number(uint8_t bank, uint8_t voice)
void handle_sysex_parameter(const uint8_t* sysex, uint8_t len) void handle_sysex_parameter(const uint8_t* sysex, uint8_t len)
{ {
// parse parameter change
if (len == 7)
{
if (sysex[1] != 0x43) // check for Yamaha sysex if (sysex[1] != 0x43) // check for Yamaha sysex
{ {
Serial.println(F("E: SysEx vendor not Yamaha.")); Serial.println(F("E: SysEx vendor not Yamaha."));
return; return;
} }
// parse parameter change
if (len == 7)
{
if ((sysex[3] & 0x7c) != 0 || (sysex[3] & 0x7c) != 2) if ((sysex[3] & 0x7c) != 0 || (sysex[3] & 0x7c) != 2)
{ {
Serial.println(F("E: Not a SysEx parameter or function parameter change.")); Serial.println(F("E: Not a SysEx parameter or function parameter change."));

@ -29,7 +29,7 @@
#define VOLUME 0.5 #define VOLUME 0.5
#define SAMPLE_RATE 44100 #define SAMPLE_RATE 44100
//#define DEXED_ENGINE DEXED_ENGINE_MODERN //#define DEXED_ENGINE DEXED_ENGINE_MODERN
//#define USE_ONBOARD_USB_HOST 1 #define USE_ONBOARD_USB_HOST 1
#if !defined(__MK66FX1M0__) // check for Teensy-3.6 #if !defined(__MK66FX1M0__) // check for Teensy-3.6
#define MAX_NOTES 11 // No? #define MAX_NOTES 11 // No?
#else #else

Loading…
Cancel
Save