Smaller fixes and additions.

pull/4/head
Holger Wirtz 7 years ago
parent beae42e8ff
commit f1f406fdb9
  1. 16
      MicroDexed.ino
  2. 15
      config.h

@ -43,7 +43,7 @@ AudioConnection patchCord3(queue1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=507,403 AudioControlSGTL5000 sgtl5000_1; //xy=507,403
// GUItool: end automatically generated code // GUItool: end automatically generated code
MIDI_CREATE_INSTANCE(HardwareSerial, Serial1, MIDI); MIDI_CREATE_INSTANCE(HardwareSerial, MIDI_DEVICE, MIDI);
Dexed* dexed = new Dexed(SAMPLE_RATE); Dexed* dexed = new Dexed(SAMPLE_RATE);
bool sd_card_available = false; bool sd_card_available = false;
uint8_t bank = EEPROM.read(EEPROM_BANK_ADDR); uint8_t bank = EEPROM.read(EEPROM_BANK_ADDR);
@ -76,7 +76,7 @@ void setup()
delay(200); delay(200);
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed")); Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed"));
Serial.println(F("(c)2018 H. Wirtz <wirtz@parasitstudio.de>")); Serial.println(F("(c)2018 H. Wirtz <wirtz@parasitstudio.de>"));
Serial.println(F("setup start")); Serial.println(F("<setup start>"));
// start up USB host // start up USB host
#ifdef USE_ONBOARD_USB_HOST #ifdef USE_ONBOARD_USB_HOST
@ -127,7 +127,7 @@ void setup()
sched_note_off.begin(note_off, 6333333); sched_note_off.begin(note_off, 6333333);
#endif #endif
Serial.println(F("setup end")); Serial.println(F("<setup end>"));
show_cpu_and_mem_usage(); show_cpu_and_mem_usage();
#ifdef TEST_NOTE #ifdef TEST_NOTE
@ -180,6 +180,9 @@ void handle_midi_input(void)
usb_host.Task(); usb_host.Task();
while (midi_usb.read()) while (midi_usb.read())
{ {
#ifdef DEBUG
Serial.println(F("MIDI-USB"));
#endif
if (MIDI.getType() == 0xF0) // SysEX if (MIDI.getType() == 0xF0) // SysEX
{ {
handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength()); handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength());
@ -191,6 +194,9 @@ void handle_midi_input(void)
while (MIDI.read()) while (MIDI.read())
{ {
#ifdef DEBUG
Serial.println(F("MIDI-Serial"));
#endif
if (MIDI.getType() == 0xF0) // SYSEX if (MIDI.getType() == 0xF0) // SYSEX
{ {
handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength()); handle_sysex_parameter(MIDI.getSysExArray(), MIDI.getSysExArrayLength());
@ -288,8 +294,8 @@ bool handle_master_key(uint8_t data)
{ {
Serial.print(F("Loading voice number ")); Serial.print(F("Loading voice number "));
Serial.println(num, DEC); Serial.println(num, DEC);
EEPROM.write(EEPROM_VOICE_ADDR,num); EEPROM.write(EEPROM_VOICE_ADDR, num);
EEPROM.write(EEPROM_BANK_ADDR,bank); EEPROM.write(EEPROM_BANK_ADDR, bank);
} }
} }
return (true); return (true);

@ -25,22 +25,27 @@
#include "midinotes.h" #include "midinotes.h"
// Initial values // Initial values
#define MIDI_DEVICE Serial1
#define VOLUME 0.1 #define VOLUME 0.1
#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
#define MAX_NOTES 16 #if !defined(__MK66FX1M0__) // check for Teensy-3.6
#define MAX_NOTES 11 // No?
#else
#define MAX_NOTES 16 // Yes
#endif
#define AUDIO_MEM 2 #define AUDIO_MEM 2
#define DEFAULT_SYSEXBANK 0 #define DEFAULT_SYSEXBANK 0
#define DEFAULT_SYSEXSOUND 0 #define DEFAULT_SYSEXSOUND 0
// Master key handling (comment out for disabling) // Master key handling (comment for disabling)
#define MASTER_KEY_MIDI MIDI_C6 #define MASTER_KEY_MIDI MIDI_C6
#define MASTER_NUM1 MIDI_C1 #define MASTER_NUM1 MIDI_C1
// Debug output // Debug output
#define SERIAL_SPEED 38400 #define SERIAL_SPEED 38400
//#define SHOW_DEXED_TIMING 1 #define SHOW_DEXED_TIMING 1
#define DEBUG 1 #define DEBUG 1
#define SHOW_MIDI_EVENT 1 #define SHOW_MIDI_EVENT 1
#define SHOW_XRUN 1 #define SHOW_XRUN 1
@ -52,7 +57,7 @@
#define REDUCE_LOUDNESS 2 #define REDUCE_LOUDNESS 2
// Enable TEST_NOTE for adding code to drop some midi notes for testing without keyboard // Enable TEST_NOTE for adding code to drop some midi notes for testing without keyboard
//#define TEST_NOTE MIDI_E2 #define TEST_NOTE MIDI_E2
#define TEST_VEL_MIN 60 #define TEST_VEL_MIN 60
#define TEST_VEL_MAX 110 #define TEST_VEL_MAX 110

Loading…
Cancel
Save