Several adds for handling drums and drum mapping.

Small fixes for performance files.
dev
Holger Wirtz 2 years ago
parent 7d0a2a2922
commit a34ee7d50d
  1. 392
      MicroDexed.ino
  2. 174
      addon/SD/PERFORMANCE/0/drmmap.json
  3. 972
      addon/SD/PERFORMANCE/0/drums.json
  4. 40
      addon/SD/PERFORMANCE/0/epiano.json
  5. 128
      addon/SD/PERFORMANCE/0/fx.json
  6. 52
      addon/SD/PERFORMANCE/0/performance.json
  7. 66
      addon/SD/PERFORMANCE/0/voice1.json
  8. 66
      addon/SD/PERFORMANCE/0/voice2.json
  9. 2
      config.h
  10. 583
      dexed_sd.cpp
  11. 10
      dexed_sd.h

@ -407,6 +407,7 @@ int16_t* ep_delayline_l;
extern drum_config_t drum_config[NUM_DRUMSET_CONFIG]; extern drum_config_t drum_config[NUM_DRUMSET_CONFIG];
uint8_t drum_counter; uint8_t drum_counter;
uint8_t drum_type[NUM_DRUMS]; uint8_t drum_type[NUM_DRUMS];
int8_t drum_map[NUM_DRUMSET_CONFIG];
uint8_t drum_midi_channel = DRUM_MIDI_CHANNEL; uint8_t drum_midi_channel = DRUM_MIDI_CHANNEL;
#endif #endif
@ -416,7 +417,6 @@ extern LCDMenuLib2 LCDML;
extern void getNoteName(char* noteName, uint8_t noteNumber); extern void getNoteName(char* noteName, uint8_t noteNumber);
/*********************************************************************** /***********************************************************************
SETUP SETUP
***********************************************************************/ ***********************************************************************/
@ -568,6 +568,7 @@ void setup() {
configuration.drums.drum_reverb_send[i] = mapfloat(drum_config[i].reverb_send, 0.0, 1.0, DRUMS_REVERB_SEND_MIN, DRUMS_REVERB_SEND_MAX); configuration.drums.drum_reverb_send[i] = mapfloat(drum_config[i].reverb_send, 0.0, 1.0, DRUMS_REVERB_SEND_MIN, DRUMS_REVERB_SEND_MAX);
configuration.drums.drum_pitch[i] = mapfloat(drum_config[i].pitch, -1.0, 1.0, DRUMS_PITCH_MIN, DRUMS_PITCH_MAX); configuration.drums.drum_pitch[i] = mapfloat(drum_config[i].pitch, -1.0, 1.0, DRUMS_PITCH_MIN, DRUMS_PITCH_MAX);
configuration.drums.drum_midi_note[i] = constrain(drum_config[i].midinote, DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); configuration.drums.drum_midi_note[i] = constrain(drum_config[i].midinote, DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX);
drum_map[i] = -1;
} }
#endif #endif
@ -918,7 +919,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
// Play Notes // Play Notes
// //
// Check for MicroDexed // MicroDexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (checkMidiChannel(inChannel, instance_id)) { if (checkMidiChannel(inChannel, instance_id)) {
if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) { if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) {
@ -947,8 +948,27 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
} }
} }
// E-Piano
#if defined(USE_EPIANO)
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) {
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) {
ep.noteOn(inNumber + configuration.epiano.transpose - 24, inVelocity);
#ifdef DEBUG
char note_name[4];
getNoteName(note_name, inNumber);
Serial.print(F("KeyDown "));
Serial.print(note_name);
Serial.print(F(" EPIANO "));
Serial.print(F(" MIDI-channel "));
Serial.print(inChannel, DEC);
Serial.println();
#endif
}
}
#endif
// Drums
#if NUM_DRUMS > 0 #if NUM_DRUMS > 0
// Check for Drum
if (inChannel == drum_midi_channel || drum_midi_channel == MIDI_CHANNEL_OMNI) { if (inChannel == drum_midi_channel || drum_midi_channel == MIDI_CHANNEL_OMNI) {
if (drum_counter >= NUM_DRUMS) if (drum_counter >= NUM_DRUMS)
drum_counter = 0; drum_counter = 0;
@ -956,14 +976,25 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
#ifdef DEBUG #ifdef DEBUG
char note_name[4]; char note_name[4];
getNoteName(note_name, inNumber); getNoteName(note_name, inNumber);
Serial.print(F("=> Drum[")); Serial.print(F("Triggring Drum["));
Serial.print(drum_counter, DEC); Serial.print(drum_counter, DEC);
Serial.print(F("]: ")); Serial.print(F("]: with note "));
Serial.println(note_name); Serial.println(note_name);
#endif #endif
int8_t mapped_note = -1;
for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++) { for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG; d++) {
if (inNumber == drum_config[d].midinote) { if (drum_map[inNumber] != -1) {
mapped_note = drum_map[inNumber];
#ifdef DEBUG
Serial.print("MIDI drum-note mapping [");
Serial.print(inNumber);
Serial.print("] -> [");
Serial.print(mapped_note);
Serial.println("]");
#endif
}
if (mapped_note == drum_config[d].midinote) {
uint8_t slot = drum_get_slot(drum_config[d].drum_class); uint8_t slot = drum_get_slot(drum_config[d].drum_class);
float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0); float pan = mapfloat(drum_config[d].pan, -1.0, 1.0, 0.0, 1.0);
@ -974,8 +1005,6 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(drum_config[d].reverb_send)); drum_reverb_send_mixer_l.gain(slot, pan * volume_transform(drum_config[d].reverb_send));
#endif #endif
if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) { if (drum_config[d].drum_data != NULL && drum_config[d].len > 0) {
//Drum[slot]->play(drum_config[d].drum_data);
if (drum_config[d].pitch != 0.0) { if (drum_config[d].pitch != 0.0) {
Drum[slot]->enableInterpolation(true); Drum[slot]->enableInterpolation(true);
Drum[slot]->setPlaybackRate(drum_config[d].pitch); Drum[slot]->setPlaybackRate(drum_config[d].pitch);
@ -988,15 +1017,13 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
Serial.print(drum_config[d].shortname); Serial.print(drum_config[d].shortname);
Serial.print(F(" [")); Serial.print(F(" ["));
Serial.print(drum_config[d].name); Serial.print(drum_config[d].name);
Serial.print(F("], Slot ")); Serial.print(F("], Slot ["));
Serial.print(slot); Serial.print(slot);
Serial.print(F(": V")); Serial.print(F("]: Velocity="));
Serial.print(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max), 2); Serial.print(mapfloat(inVelocity, 0, 127, drum_config[d].vol_min, drum_config[d].vol_max), 2);
Serial.print(F(" P")); Serial.print(F(" Pan="));
Serial.print(drum_config[d].pan, 2);
Serial.print(F(" PAN"));
Serial.print(pan, 2); Serial.print(pan, 2);
Serial.print(F(" RS")); Serial.print(F(" ReverbSend="));
Serial.println(drum_config[d].reverb_send, 2); Serial.println(drum_config[d].reverb_send, 2);
#endif #endif
break; break;
@ -1004,135 +1031,6 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity) {
} }
} }
#endif #endif
#if defined(USE_EPIANO)
//
// E-Piano
//
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) {
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) {
ep.noteOn(inNumber + configuration.epiano.transpose - 24, inVelocity);
#ifdef DEBUG
char note_name[4];
getNoteName(note_name, inNumber);
Serial.print(F("KeyDown "));
Serial.print(note_name);
Serial.print(F(" EPIANO "));
Serial.print(F(" MIDI-channel "));
Serial.print(inChannel, DEC);
Serial.println();
#endif
}
}
#endif
}
#if NUM_DRUMS > 0
uint8_t drum_get_slot(uint8_t dt) {
for (uint8_t i = 0; i < NUM_DRUMS; i++) {
if (!Drum[i]->isPlaying()) {
drum_type[i] = DRUM_NONE;
Drum[i]->enableInterpolation(false);
Drum[i]->setPlaybackRate(1.0);
}
// else
// {
// if (drum_type[i] == dt)
// {
//#ifdef DEBUG
// Serial.print(F("Stopping Drum "));
// Serial.print(i);
// Serial.print(F(" type "));
// Serial.println(dt);
//#endif
// Drum[i]->stop();
//
// return (i);
// }
// }
}
#ifdef DEBUG
Serial.print(F("Using next free Drum slot "));
Serial.println(drum_counter % NUM_DRUMS);
#endif
drum_type[drum_counter % NUM_DRUMS] = dt;
drum_counter++;
return (drum_counter - 1 % NUM_DRUMS);
}
#endif
int8_t handle_midi_learn(int8_t note) {
int8_t ret_channel = -1;
#ifdef DEBUG
Serial.print("MIDI learning for ");
Serial.println(note);
#endif
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_drum_midi_note)) {
ret_channel = configuration.drums.drum_midi_channel;
//LCDML.OTHER_jumpToFunc(UI_func_drum_midi_note);
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_epiano_lowest_note)) {
if (note > configuration.epiano.highest_note)
configuration.epiano.lowest_note = configuration.epiano.highest_note;
else
configuration.epiano.lowest_note = note;
ret_channel = configuration.epiano.midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned lowest note: ");
Serial.print(note);
Serial.print(" for EPiano, ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_epiano_highest_note)) {
if (note < configuration.epiano.lowest_note)
configuration.epiano.highest_note = configuration.epiano.lowest_note;
else
configuration.epiano.highest_note = note;
ret_channel = configuration.epiano.midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned highest note: ");
Serial.print(note);
Serial.print(" for EPiano, ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
}
// Check for Dexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_lowest_note)) {
if (note > configuration.dexed[selected_instance_id].highest_note)
configuration.dexed[selected_instance_id].lowest_note = configuration.dexed[selected_instance_id].highest_note;
else
configuration.dexed[selected_instance_id].lowest_note = note;
ret_channel = configuration.dexed[selected_instance_id].midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned lowest note: ");
Serial.print(note);
Serial.print(" for instance: ");
Serial.print(selected_instance_id);
Serial.print(", ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_highest_note)) {
if (note < configuration.dexed[selected_instance_id].lowest_note)
configuration.dexed[selected_instance_id].highest_note = configuration.dexed[selected_instance_id].lowest_note;
else
configuration.dexed[selected_instance_id].highest_note = note;
ret_channel = configuration.dexed[selected_instance_id].midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned highest note: ");
Serial.print(note);
Serial.print(" for instance: ");
Serial.print(selected_instance_id);
Serial.print(", ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
}
LCDML.OTHER_updateFunc();
}
return (ret_channel);
} }
void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) { void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) {
@ -1145,6 +1043,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) {
inChannel = tmp_channel; inChannel = tmp_channel;
} }
// Dexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (checkMidiChannel(inChannel, instance_id)) { if (checkMidiChannel(inChannel, instance_id)) {
if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) { if (inNumber >= configuration.dexed[instance_id].lowest_note && inNumber <= configuration.dexed[instance_id].highest_note) {
@ -1167,6 +1066,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity) {
} }
} }
// EPiano
#if defined(USE_EPIANO) #if defined(USE_EPIANO)
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) { if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel) {
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) { if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note) {
@ -1190,6 +1090,13 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) {
inCtrl = constrain(inCtrl, 0, 127); inCtrl = constrain(inCtrl, 0, 127);
inValue = constrain(inValue, 0, 127); inValue = constrain(inValue, 0, 127);
// EPiano
#if defined(USE_EPIANO)
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel)
ep.processMidiController(inCtrl, inValue);
#endif
// Dexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (checkMidiChannel(inChannel, instance_id)) { if (checkMidiChannel(inChannel, instance_id)) {
#ifdef DEBUG #ifdef DEBUG
@ -1389,11 +1296,6 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) {
} }
} }
} }
#if defined(USE_EPIANO)
if (configuration.epiano.midi_channel == MIDI_CHANNEL_OMNI || configuration.epiano.midi_channel == inChannel)
ep.processMidiController(inCtrl, inValue);
#endif
} }
void handleAfterTouch(byte inChannel, byte inPressure) { void handleAfterTouch(byte inChannel, byte inPressure) {
@ -1856,6 +1758,7 @@ void set_drums_volume(float vol) {
master_mixer_r.gain(MASTER_MIX_CH_DRUMS, vol); master_mixer_r.gain(MASTER_MIX_CH_DRUMS, vol);
master_mixer_l.gain(MASTER_MIX_CH_DRUMS, vol); master_mixer_l.gain(MASTER_MIX_CH_DRUMS, vol);
} }
void set_volume(uint8_t v, uint8_t m) { void set_volume(uint8_t v, uint8_t m) {
float tmp_v; float tmp_v;
@ -2073,6 +1976,26 @@ void check_configuration_epiano(void) {
configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel, EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX); configuration.epiano.midi_channel = constrain(configuration.epiano.midi_channel, EP_MIDI_CHANNEL_MIN, EP_MIDI_CHANNEL_MAX);
} }
void check_configuration_drum_config(void) {
configuration.drums.drum_main_vol = constrain(configuration.drums.drum_main_vol, DRUMS_MAIN_VOL_MIN, DRUMS_MAIN_VOL_MAX);
for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) {
drum_config[i].midinote = constrain(drum_config[i].midinote, DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX);
drum_config[i].pitch = constrain(drum_config[i].pitch, DRUMS_PITCH_MIN, DRUMS_PITCH_MAX);
drum_config[i].pan = constrain(drum_config[i].pan, DRUMS_PANORAMA_MIN, DRUMS_PANORAMA_MAX);
drum_config[i].vol_max = constrain(drum_config[i].vol_max, DRUMS_VOL_MIN, DRUMS_VOL_MAX);
drum_config[i].vol_min = constrain(drum_config[i].vol_min, DRUMS_VOL_MIN, DRUMS_VOL_MAX);
drum_config[i].reverb_send = constrain(drum_config[i].reverb_send, DRUMS_REVERB_SEND_MIN, DRUMS_REVERB_SEND_MAX);
}
}
void check_configuration_drum_map(void) {
for (uint8_t i = 0; i < NUM_DRUMSET_CONFIG - 1; i++) {
drum_map[i] = constrain(drum_map[i], -1, DRUMS_MIDI_NOTE_MAX);
if (drum_map[i] >= 0 && drum_map[i] < DRUMS_MIDI_NOTE_MIN)
drum_map[i] = -1;
}
}
void init_configuration(void) { void init_configuration(void) {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("INITIALIZING CONFIGURATION")); Serial.println(F("INITIALIZING CONFIGURATION"));
@ -2183,69 +2106,6 @@ void eeprom_update(void) {
EEPROM.update(EEPROM_START_ADDRESS + 2, configuration.sys.vol); EEPROM.update(EEPROM_START_ADDRESS + 2, configuration.sys.vol);
} }
/******************************************************************************
PARAMETER-HELPERS
******************************************************************************/
void set_sample_note(uint8_t sample, uint8_t note) {
drum_config[sample].midinote = note;
}
void set_sample_pitch(uint8_t sample, float playbackspeed) {
drum_config[sample].pitch = playbackspeed;
}
void set_sample_pan(uint8_t sample, float s_pan) {
drum_config[sample].pan = s_pan;
}
void set_sample_vol_max(uint8_t sample, float s_max) {
drum_config[sample].vol_max = s_max;
}
void set_sample_vol_min(uint8_t sample, float s_min) {
drum_config[sample].vol_min = s_min;
}
void set_sample_reverb_send(uint8_t sample, float s_reverb) {
drum_config[sample].reverb_send = s_reverb;
}
uint8_t get_sample_note(uint8_t sample) {
return (drum_config[sample].midinote);
}
float get_sample_pitch(uint8_t sample) {
return (drum_config[sample].pitch);
}
float get_sample_pan(uint8_t sample) {
return (drum_config[sample].pan);
}
float get_sample_vol_max(uint8_t sample) {
return (drum_config[sample].vol_max);
}
float get_sample_vol_min(uint8_t sample) {
return (drum_config[sample].vol_min);
}
float get_sample_reverb_send(uint8_t sample) {
return (drum_config[sample].reverb_send);
}
uint8_t find_drum_number_from_note(uint8_t note) {
uint8_t number = 0;
for (uint8_t d = 0; d < NUM_DRUMSET_CONFIG - 1; d++) {
if (note == drum_config[d].midinote) {
number = d;
break;
}
}
return number;
}
void set_fx_params(void) { void set_fx_params(void) {
#if defined(USE_FX) #if defined(USE_FX)
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
@ -2442,7 +2302,7 @@ void set_sys_params(void) {
// https://www.reddit.com/r/Teensy/comments/7r19uk/reset_and_reboot_teensy_lc_via_code/ // https://www.reddit.com/r/Teensy/comments/7r19uk/reset_and_reboot_teensy_lc_via_code/
#define SCB_AIRCR (*(volatile uint32_t*)0xE000ED0C) // Application Interrupt and Reset Control location #define SCB_AIRCR (*(volatile uint32_t*)0xE000ED0C) // Application Interrupt and Reset Control location
void _softRestart(void) { void _softRestart(void) {
Serial.end(); //clears the serial monitor if used Serial.end(); //clears the serial monitor if used
SCB_AIRCR = 0x05FA0004; //write value for restart SCB_AIRCR = 0x05FA0004; //write value for restart
} }
@ -2454,6 +2314,114 @@ void _softRestart(void) {
return (pow(value, 2.2)); return (pow(value, 2.2));
}*/ }*/
#if NUM_DRUMS > 0
uint8_t drum_get_slot(uint8_t dt) {
for (uint8_t i = 0; i < NUM_DRUMS; i++) {
if (!Drum[i]->isPlaying()) {
drum_type[i] = DRUM_NONE;
Drum[i]->enableInterpolation(false);
Drum[i]->setPlaybackRate(1.0);
}
// else
// {
// if (drum_type[i] == dt)
// {
//#ifdef DEBUG
// Serial.print(F("Stopping Drum "));
// Serial.print(i);
// Serial.print(F(" type "));
// Serial.println(dt);
//#endif
// Drum[i]->stop();
//
// return (i);
// }
// }
}
#ifdef DEBUG
Serial.print(F("Using next free Drum slot "));
Serial.println(drum_counter % NUM_DRUMS);
#endif
drum_type[drum_counter % NUM_DRUMS] = dt;
drum_counter++;
return (drum_counter - 1 % NUM_DRUMS);
}
#endif
int8_t handle_midi_learn(int8_t note) {
int8_t ret_channel = -1;
#ifdef DEBUG
Serial.print("MIDI learning for ");
Serial.println(note);
#endif
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_drum_midi_note)) {
ret_channel = configuration.drums.drum_midi_channel;
//LCDML.OTHER_jumpToFunc(UI_func_drum_midi_note);
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_epiano_lowest_note)) {
if (note > configuration.epiano.highest_note)
configuration.epiano.lowest_note = configuration.epiano.highest_note;
else
configuration.epiano.lowest_note = note;
ret_channel = configuration.epiano.midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned lowest note: ");
Serial.print(note);
Serial.print(" for EPiano, ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_epiano_highest_note)) {
if (note < configuration.epiano.lowest_note)
configuration.epiano.highest_note = configuration.epiano.lowest_note;
else
configuration.epiano.highest_note = note;
ret_channel = configuration.epiano.midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned highest note: ");
Serial.print(note);
Serial.print(" for EPiano, ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
}
// Check for Dexed
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) {
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_lowest_note)) {
if (note > configuration.dexed[selected_instance_id].highest_note)
configuration.dexed[selected_instance_id].lowest_note = configuration.dexed[selected_instance_id].highest_note;
else
configuration.dexed[selected_instance_id].lowest_note = note;
ret_channel = configuration.dexed[selected_instance_id].midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned lowest note: ");
Serial.print(note);
Serial.print(" for instance: ");
Serial.print(selected_instance_id);
Serial.print(", ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
} else if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_highest_note)) {
if (note < configuration.dexed[selected_instance_id].lowest_note)
configuration.dexed[selected_instance_id].highest_note = configuration.dexed[selected_instance_id].lowest_note;
else
configuration.dexed[selected_instance_id].highest_note = note;
ret_channel = configuration.dexed[selected_instance_id].midi_channel;
#ifdef DEBUG
Serial.print("MIDI learned highest note: ");
Serial.print(note);
Serial.print(" for instance: ");
Serial.print(selected_instance_id);
Serial.print(", ghosting MIDI channel ");
Serial.println(ret_channel);
#endif
}
LCDML.OTHER_updateFunc();
}
return (ret_channel);
}
float midi_volume_transform(uint8_t midi_amp) { float midi_volume_transform(uint8_t midi_amp) {
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("midi_amp=")); Serial.print(F("midi_amp="));

@ -1,106 +1,68 @@
{ {
"type": [ "map": [
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0 -1,
], -1,
"in": [ -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0 -1,
], -1,
"out": [ -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1,
0, -1
0, ]
0, }
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"channel": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}

@ -1,507 +1,465 @@
{ {
"drums_volume": 0.95, "drums_volume": 0.95,
"note": [ "note": [
210, 45,
211, 47,
212, 48,
213, 49,
214, 50,
45, 51,
47, 52,
48, 53,
49, 54,
50, 55,
51, 56,
52, 57,
53, 58,
54, 59,
55, 60,
56, 61,
57, 62,
58, 63,
59, 64,
60, 65,
61, 66,
62, 67,
63, 68,
64, 69,
65, 70,
66, 71,
67, 72,
68, 73,
69, 74,
70, 75,
71, 76,
72, 77,
73, 78,
74, 79,
75, 80,
76, 81,
77, 82,
78, 83,
79, 84,
80, 85,
81, 86,
82, 87,
83, 88,
84, 89,
85, 90,
86, 92,
87, 91,
88, 93,
89, 94,
90, 95,
92, 96,
91, 97,
93, 98,
94, 99,
95, 100,
96, 101,
97, 102,
98, 103,
99, 104,
100, 105,
101, 106,
102, 107,
103, 108,
104, 0
105, ],
106, "pitch": [
107, 0,
108, 1.2,
0, 0,
0 0,
], 0,
"pitch": [ 1.1,
0, 1.3,
0, 0,
0, 1.4,
0, 0,
0, 0,
0, 0,
1.2, 0,
0, 0,
0, 0,
0, 0,
1.1, 0,
1.3, 0,
0, 0,
1.4, 0,
0, 0,
0, 0,
0, 0,
0, 1,
0, 0,
0, 1,
0, 0.9,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
1, 0,
0, 0,
1, 0,
0.9, 0,
0, 1.427136,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
1.427136, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0
0, ],
0, "p_offset": [
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0 0,
], 0,
"p_offset": [ 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0
0, ],
0, "pan": [
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0 0,
], 0,
"pan": [ 0,
0, 0,
0, 0.282828,
0, 0.343434,
0, 0.1,
0, 0,
0, 0,
0, 0.191919,
0, 0,
0, 0,
0, -0.343434,
0, -0.484849,
0, 0,
0, 0,
0, 0,
0, 0.323232,
0, 0,
0, 0,
0, 0,
0, -0.2,
0, 0,
0, 0.272727,
0, 0,
0, 0,
0, 0.080808,
0.282828, 0,
0.343434, 0,
0.1, 0.414141,
0, -0.151515,
0, 0,
0.191919, 0,
0, 0,
0, 0,
-0.343434, 0,
-0.484849, -0.252525,
0, 0,
0, 0,
0, 0,
0.323232, 0,
0, 0,
0, 0,
0, 0,
-0.2, 0,
0, 0,
0.272727, 0,
0, 0,
0, 0
0.080808, ],
0, "vol_max": [
0, 1,
0.414141, 1,
-0.151515, 0.7,
0, 1,
0, 0.7,
0, 1,
0, 1,
0, 1,
-0.252525, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 1,
0, 0.75,
0, 0.56,
0 1,
], 1,
"vol_max": [ 1,
0, 0.79,
1, 0.73,
1, 1,
1, 0.89,
1, 0.74,
1, 0.93,
1, 1,
0.7, 1,
1, 0.86,
0.7, 0.74,
1, 0.9,
1, 0.9,
1, 0.8,
1, 0.8,
1, 0.77,
1, 0.8,
1, 0.8,
1, 0.83,
1, 1,
1, 0.78,
1, 0.88,
1, 0.9,
1, 0.94,
1, 0.9,
0.75, 0.9,
0.56, 0.9,
1, 0.8,
1, 0.9,
1, 0.9,
0.79, 1,
0.73, 1,
1, 0,
0.89, 0,
0.74, 0,
0.93, 0,
1, 0,
1, 0,
0.86, 0,
0.74, 0.8,
0.9, 0
0.9, ],
0.8, "vol_min": [
0.8, 0,
0.77, 0,
0.8, 0,
0.8, 0,
0.83, 0,
1, 0,
0.78, 0,
0.88, 0,
0.9, 0,
0.94, 0,
0.9, 0,
0.9, 0,
0.9, 0,
0.8, 0,
0.9, 0,
0.9, 0,
1, 0,
1, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0.8, 0,
0, 0,
0 0,
], 0,
"vol_min": [ 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0
0, ],
0, "reverb_send": [
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0.52,
0, 0.59,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0.34,
0, 0,
0, 0.65,
0, 0,
0, 0,
0, 0,
0 0,
], 0,
"reverb_send": [ 0,
0, 0.53,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0.2,
0, 0,
0, 0,
0, 0.52,
0, 0.25,
0, 0.66,
0, 0,
0, 0,
0, 0.69,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0.52, 0,
0.59, 0,
0, 0
0, ]
0, }
0,
0,
0.34,
0,
0.65,
0,
0,
0,
0,
0,
0,
0.53,
0,
0,
0,
0,
0.2,
0,
0,
0.52,
0.25,
0.66,
0,
0,
0.69,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}

@ -1,20 +1,20 @@
{ {
"decay": 50, "decay": 50,
"release": 50, "release": 50,
"hardness": 50, "hardness": 50,
"treble": 50, "treble": 50,
"pan_tremolo": 50, "pan_tremolo": 50,
"pan_lfo": 0, "pan_lfo": 0,
"velocity_sense": 0, "velocity_sense": 0,
"stereo": 50, "stereo": 50,
"polyphony": 16, "polyphony": 16,
"tune": 50, "tune": 50,
"detune": 15, "detune": 15,
"overdrive": 0, "overdrive": 0,
"lowest_note": 21, "lowest_note": 21,
"highest_note": 108, "highest_note": 108,
"transpose": 24, "transpose": 24,
"sound_intensity": 100, "sound_intensity": 100,
"pan": 20, "pan": 20,
"midi_channel": 4 "midi_channel": 4
} }

@ -1,65 +1,65 @@
{ {
"filter_cutoff": [ "filter_cutoff": [
0, 0,
0 0
], ],
"filter_resonance": [ "filter_resonance": [
0, 0,
0 0
], ],
"chorus_frequency": [ "chorus_frequency": [
0, 0,
0 0
], ],
"chorus_waveform": [ "chorus_waveform": [
0, 0,
0 0
], ],
"chorus_depth": [ "chorus_depth": [
0, 0,
0 0
], ],
"chorus_level": [ "chorus_level": [
0, 0,
0 0
], ],
"delay_time": [ "delay_time": [
0, 0,
0 0
], ],
"delay_feedback": [ "delay_feedback": [
60, 60,
88 88
], ],
"delay_level": [ "delay_level": [
83, 83,
82 82
], ],
"delay_sync": [ "delay_sync": [
3, 3,
3 3
], ],
"reverb_send": [ "reverb_send": [
81, 81,
99 99
], ],
"reverb_roomsize": 99, "reverb_roomsize": 99,
"reverb_damping": 0, "reverb_damping": 0,
"reverb_lowpass": 81, "reverb_lowpass": 81,
"reverb_lodamp": 59, "reverb_lodamp": 59,
"reverb_hidamp": 0, "reverb_hidamp": 0,
"reverb_diffusion": 100, "reverb_diffusion": 100,
"reverb_level": 78, "reverb_level": 78,
"eq_1": 15, "eq_1": 15,
"eq_2": 0, "eq_2": 0,
"eq_3": 1, "eq_3": 1,
"eq_4": 0, "eq_4": 0,
"eq_5": 0, "eq_5": 0,
"eq_6": -2, "eq_6": -2,
"eq_7": 8, "eq_7": 8,
"ep_chorus_frequency": 0, "ep_chorus_frequency": 0,
"ep_chorus_waveform": 0, "ep_chorus_waveform": 0,
"ep_chorus_depth": 0, "ep_chorus_depth": 0,
"ep_chorus_level": 0, "ep_chorus_level": 0,
"ep_reverb_send": 0 "ep_reverb_send": 0
} }

@ -1,27 +1,27 @@
{ {
"name": [ "name": [
73, 73,
78, 78,
73, 73,
84, 84,
32, 32,
80, 80,
101, 101,
114, 114,
102, 102,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0, 0,
0 0
] ]
} }

@ -1,33 +1,33 @@
{ {
"bank": 18, "bank": 18,
"voice": 11, "voice": 11,
"lowest_note": 21, "lowest_note": 21,
"highest_note": 108, "highest_note": 108,
"transpose": 12, "transpose": 12,
"tune": 100, "tune": 100,
"sound_intensity": 91, "sound_intensity": 91,
"pan": 15, "pan": 15,
"polyphony": 16, "polyphony": 16,
"velocity_level": 100, "velocity_level": 100,
"monopoly": 0, "monopoly": 0,
"note_refresh": 0, "note_refresh": 0,
"pb_range": 1, "pb_range": 1,
"pb_step": 0, "pb_step": 0,
"mw_range": 50, "mw_range": 50,
"mw_assign": 0, "mw_assign": 0,
"mw_mode": 0, "mw_mode": 0,
"fc_range": 50, "fc_range": 50,
"fc_assign": 0, "fc_assign": 0,
"fc_mode": 0, "fc_mode": 0,
"bc_range": 50, "bc_range": 50,
"bc_assign": 0, "bc_assign": 0,
"bc_mode": 0, "bc_mode": 0,
"at_range": 50, "at_range": 50,
"at_assign": 0, "at_assign": 0,
"at_mode": 0, "at_mode": 0,
"portamento_mode": 0, "portamento_mode": 0,
"portamento_glissando": 0, "portamento_glissando": 0,
"portamento_time": 0, "portamento_time": 0,
"op_enabled": 63, "op_enabled": 63,
"midi_channel": 2 "midi_channel": 2
} }

@ -1,33 +1,33 @@
{ {
"bank": 63, "bank": 63,
"voice": 2, "voice": 2,
"lowest_note": 21, "lowest_note": 21,
"highest_note": 108, "highest_note": 108,
"transpose": 24, "transpose": 24,
"tune": 100, "tune": 100,
"sound_intensity": 67, "sound_intensity": 67,
"pan": 23, "pan": 23,
"polyphony": 16, "polyphony": 16,
"velocity_level": 100, "velocity_level": 100,
"monopoly": 0, "monopoly": 0,
"note_refresh": 0, "note_refresh": 0,
"pb_range": 1, "pb_range": 1,
"pb_step": 0, "pb_step": 0,
"mw_range": 50, "mw_range": 50,
"mw_assign": 0, "mw_assign": 0,
"mw_mode": 0, "mw_mode": 0,
"fc_range": 50, "fc_range": 50,
"fc_assign": 0, "fc_assign": 0,
"fc_mode": 0, "fc_mode": 0,
"bc_range": 50, "bc_range": 50,
"bc_assign": 0, "bc_assign": 0,
"bc_mode": 0, "bc_mode": 0,
"at_range": 50, "at_range": 50,
"at_assign": 0, "at_assign": 0,
"at_mode": 0, "at_mode": 0,
"portamento_mode": 0, "portamento_mode": 0,
"portamento_glissando": 0, "portamento_glissando": 0,
"portamento_time": 0, "portamento_time": 0,
"op_enabled": 63, "op_enabled": 63,
"midi_channel": 3 "midi_channel": 3
} }

@ -56,7 +56,7 @@
// //
// Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html // Information about memory layout, etc.: https://www.pjrc.com/store/teensy41.html
#define VERSION "1.2.3" #define VERSION "1.2.4"
//************************************************************************************************* //*************************************************************************************************
//* DEVICE SETTINGS //* DEVICE SETTINGS

File diff suppressed because it is too large Load Diff

@ -30,7 +30,7 @@
#include "synth_dexed.h" #include "synth_dexed.h"
extern uint8_t sd_card; extern uint8_t sd_card;
extern AudioSynthDexed* MicroDexed[NUM_DEXED]; extern AudioSynthDexed* MicroDexed[NUM_DEXED];
extern void show_patch(uint8_t instance_id); extern void show_patch(uint8_t instance_id);
extern void send_sysex_voice(uint8_t midi_channel, uint8_t* data); extern void send_sysex_voice(uint8_t midi_channel, uint8_t* data);
@ -40,7 +40,7 @@ extern uint8_t voice;
extern uint8_t ui_state; extern uint8_t ui_state;
extern uint8_t ui_main_state; extern uint8_t ui_main_state;
extern config_t configuration; extern config_t configuration;
extern uint32_t crc32(byte * calc_start, uint16_t calc_bytes); extern uint32_t crc32(byte* calc_start, uint16_t calc_bytes);
extern void set_fx_params(void); extern void set_fx_params(void);
extern void set_voiceconfig_params(uint8_t instance_id); extern void set_voiceconfig_params(uint8_t instance_id);
extern void set_sys_params(void); extern void set_sys_params(void);
@ -64,8 +64,10 @@ bool save_sd_sys_json(void);
bool load_sd_performance_json(uint8_t p); bool load_sd_performance_json(uint8_t p);
bool save_sd_performance_json(uint8_t p); bool save_sd_performance_json(uint8_t p);
bool load_sd_seq_json(uint8_t p); bool load_sd_drumsettings_json(uint8_t number);
bool save_sd_seq_json(uint8_t p); bool save_sd_drumsettings_json(uint8_t number);
bool load_sd_drummap_json(uint8_t p);
bool save_sd_drummap_json(uint8_t p);
bool check_performance_directory(uint8_t seq_number); bool check_performance_directory(uint8_t seq_number);

Loading…
Cancel
Save