Changes for handling EEPROM updates and configuration data.

pull/32/head
Holger Wirtz 5 years ago
parent 448b3c4bd8
commit cd8ca8944b
  1. 333
      MicroDexed.ino
  2. 246
      UI.hpp
  3. 32
      UI_1_FX.h
  4. 22
      config.h
  5. 6
      dexed_sd.cpp
  6. 2
      dexed_sd.h
  7. 112
      midi_devices.hpp

@ -446,12 +446,12 @@ void setup()
master_mixer_r.gain(DEXED, 1.0); master_mixer_r.gain(DEXED, 1.0);
master_mixer_l.gain(DEXED, 1.0); master_mixer_l.gain(DEXED, 1.0);
master_mixer_r.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
@ -492,16 +492,16 @@ void setup()
#if defined(USE_FX) #if defined(USE_FX)
// DELAY // DELAY
delay_r.delay(0, mapfloat(configuration.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); delay_r.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX)));
delay_l.delay(0, mapfloat(configuration.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); delay_l.delay(0, mapfloat(configuration.fx.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX)));
// delay_fb_mixer is the feedback-adding mixer // delay_fb_mixer is the feedback-adding mixer
delay_fb_mixer_r.gain(0, 1.0); // original signal delay_fb_mixer_r.gain(0, 1.0); // original signal
delay_fb_mixer_r.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
delay_fb_mixer_l.gain(0, 1.0); // original signal delay_fb_mixer_l.gain(0, 1.0); // original signal
delay_fb_mixer_l.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
// CHORUS // CHORUS
switch (configuration.chorus_waveform) switch (configuration.fx.chorus_waveform)
{ {
case 0: case 0:
chorus_modulator.begin(WAVEFORM_TRIANGLE); chorus_modulator.begin(WAVEFORM_TRIANGLE);
@ -513,8 +513,8 @@ void setup()
chorus_modulator.begin(WAVEFORM_TRIANGLE); chorus_modulator.begin(WAVEFORM_TRIANGLE);
} }
chorus_modulator.phase(0); chorus_modulator.phase(0);
chorus_modulator.frequency(configuration.chorus_frequency / 10.0); chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0);
chorus_modulator.amplitude(mapfloat(configuration.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 0.0, 1.0)); chorus_modulator.amplitude(mapfloat(configuration.fx.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 0.0, 1.0));
chorus_modulator.offset(0.0); chorus_modulator.offset(0.0);
#if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT #if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT
// Butterworth filter, 12 db/octave // Butterworth filter, 12 db/octave
@ -533,20 +533,20 @@ void setup()
#endif #endif
// REVERB // REVERB
freeverb_r.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
freeverb_r.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
freeverb_l.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
freeverb_l.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
#endif #endif
// MONO/STEREO // MONO/STEREO
if (configuration.mono == 0) if (configuration.sys.mono == 0)
modchorus_inverter.gain(-1.0); // stereo mode modchorus_inverter.gain(-1.0); // stereo mode
else else
modchorus_inverter.gain(1.0); // mono mode modchorus_inverter.gain(1.0); // mono mode
// set initial volume // set initial volume
set_volume(configuration.vol, configuration.mono); set_volume(configuration.sys.vol, configuration.sys.mono);
// Initialize processor and memory measurements // Initialize processor and memory measurements
AudioProcessorUsageMaxReset(); AudioProcessorUsageMaxReset();
@ -610,7 +610,7 @@ void loop()
if (autostore >= AUTOSTORE_MS && eeprom_update_flag == true) if (autostore >= AUTOSTORE_MS && eeprom_update_flag == true)
{ {
// only store configuration data to EEPROM when AUTOSTORE_MS is reached and no voices are activated anymore // only store configuration data to EEPROM when AUTOSTORE_MS is reached and no voices are activated anymore
eeprom_update(); eeprom_update_sys();
} }
// check for value changes, unused voices and CPU overload // check for value changes, unused voices and CPU overload
@ -631,7 +631,6 @@ void loop()
Serial.println(F(".")); Serial.println(F("."));
#endif #endif
configuration.dexed[instance_id].polyphony = MicroDexed[instance_id]->getMaxNotes(); configuration.dexed[instance_id].polyphony = MicroDexed[instance_id]->getMaxNotes();
eeprom_update(); // useful to do this???
} }
#endif #endif
} }
@ -797,22 +796,22 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
eeprom_write(); eeprom_write();
break; break;
case 105: // CC 105: delay time case 105: // CC 105: delay time
configuration.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_time = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX);
delay_r.delay(0, configuration.delay_time * 10); delay_r.delay(0, configuration.fx.delay_time * 10);
delay_l.delay(0, configuration.delay_time * 10); delay_l.delay(0, configuration.fx.delay_time * 10);
eeprom_write(); eeprom_write();
case 106: // CC 106: delay feedback case 106: // CC 106: delay feedback
configuration.delay_feedback = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX); configuration.fx.delay_feedback = map(inValue, 0, 0x7f, DELAY_FEEDBACK_MIN , DELAY_FEEDBACK_MAX);
//delay_fb_mixer_r.gain(0, 1.0); // original signal //delay_fb_mixer_r.gain(0, 1.0); // original signal
delay_fb_mixer_r.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
//delay_fb_mixer_l.gain(0, 1.0); // original signal //delay_fb_mixer_l.gain(0, 1.0); // original signal
delay_fb_mixer_l.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
eeprom_write(); eeprom_write();
break; break;
case 107: // CC 107: delay volume case 107: // CC 107: delay volume
configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX); configuration.dexed[instance_id].delay_send = map(inValue, 0, 0x7f, DELAY_SEND_MIN, DELAY_SEND_MAX);
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
eeprom_write(); eeprom_write();
break; break;
#endif #endif
@ -1205,12 +1204,12 @@ bool checkMidiChannel(byte inChannel, uint8_t instance_id)
void set_volume(uint8_t v, uint8_t m) void set_volume(uint8_t v, uint8_t m)
{ {
configuration.vol = v; configuration.sys.vol = v;
if (configuration.vol > 100) if (configuration.sys.vol > 100)
configuration.vol = 100; configuration.sys.vol = 100;
configuration.mono = m; configuration.sys.mono = m;
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("Setting volume: VOL=")); Serial.print(F("Setting volume: VOL="));
@ -1257,37 +1256,19 @@ void set_volume(uint8_t v, uint8_t m)
void initial_values_from_eeprom(bool init) void initial_values_from_eeprom(bool init)
{ {
uint32_t checksum;
config_t tmp_conf;
if (init == true) if (init == true)
init_configuration(); init_configuration();
else else
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Loading inital data from EEPROM.")); Serial.println(F("Loading inital system data from EEPROM."));
#endif #endif
EEPROM.get(EEPROM_START_ADDRESS, tmp_conf); eeprom_get_sys();
checksum = crc32((byte*)&tmp_conf + 4, sizeof(tmp_conf) - 4); eeprom_get_fx();
for (uint8_t i = 0; i < NUM_DEXED; i++)
#ifdef DEBUG eeprom_get_dexed(i);
Serial.print(F("EEPROM checksum: 0x"));
Serial.print(tmp_conf.checksum, HEX);
Serial.print(F(" / 0x"));
Serial.println(checksum, HEX);
#endif
if (checksum != tmp_conf.checksum)
{
#ifdef DEBUG
Serial.println(F("Checksum mismatch -> initializing EEPROM!"));
#endif
init_configuration();
}
else
{
EEPROM.get(EEPROM_START_ADDRESS, configuration);
check_configuration(); check_configuration();
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
@ -1306,9 +1287,9 @@ void initial_values_from_eeprom(bool init)
delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0);
delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0); delay_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].delay_send / 100.0);
delay_fb_mixer_r.gain(0, 1.0); // original signal delay_fb_mixer_r.gain(0, 1.0); // original signal
delay_fb_mixer_r.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_r.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
delay_fb_mixer_l.gain(0, 1.0); // original signal delay_fb_mixer_l.gain(0, 1.0); // original signal
delay_fb_mixer_l.gain(1, mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback delay_fb_mixer_l.gain(1, mapfloat(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // amount of feedback
reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); reverb_send_mixer_r.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0);
reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0); reverb_send_mixer_l.gain(instance_id, configuration.dexed[instance_id].reverb_send / 100.0);
// MicroDexed[instance_id]->fx.Gain = configuration.dexed[instance_id].sound_intensity / 100.0; // MicroDexed[instance_id]->fx.Gain = configuration.dexed[instance_id].sound_intensity / 100.0;
@ -1319,21 +1300,20 @@ void initial_values_from_eeprom(bool init)
MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled);
dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));
} }
}
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("OK, loaded!")); Serial.println(F("OK, loaded!"));
#endif #endif
master_mixer_r.gain(DEXED, 1.0); master_mixer_r.gain(DEXED, 1.0);
master_mixer_l.gain(DEXED, 1.0); master_mixer_l.gain(DEXED, 1.0);
master_mixer_r.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
set_volume(configuration.vol, configuration.mono); set_volume(configuration.sys.vol, configuration.sys.mono);
} }
#ifdef DEBUG #ifdef DEBUG
show_configuration(); show_configuration();
@ -1342,20 +1322,21 @@ void initial_values_from_eeprom(bool init)
void check_configuration(void) void check_configuration(void)
{ {
configuration.instances = constrain(configuration.instances, INSTANCES_MIN, INSTANCES_MAX); configuration.sys.instances = constrain(configuration.sys.instances, INSTANCES_MIN, INSTANCES_MAX);
configuration.vol = constrain(configuration.vol, VOLUME_MIN, VOLUME_MAX); configuration.sys.vol = constrain(configuration.sys.vol, VOLUME_MIN, VOLUME_MAX);
configuration.mono = constrain(configuration.mono, MONO_MIN, MONO_MAX); configuration.sys.mono = constrain(configuration.sys.mono, MONO_MIN, MONO_MAX);
configuration.reverb_roomsize = constrain(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX);
configuration.reverb_damping = constrain(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
configuration.reverb_level = constrain(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX);
configuration.chorus_frequency = constrain(configuration.chorus_frequency, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
configuration.chorus_waveform = constrain(configuration.chorus_waveform, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); configuration.fx.reverb_level = constrain(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX);
configuration.chorus_depth = constrain(configuration.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX);
configuration.chorus_level = constrain(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); configuration.fx.chorus_waveform = constrain(configuration.fx.chorus_waveform, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX);
configuration.delay_time = constrain(configuration.delay_time, DELAY_TIME_MIN / 10, DELAY_TIME_MAX / 10); configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX);
configuration.delay_feedback = constrain(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.chorus_level = constrain(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX);
configuration.delay_level = constrain(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); configuration.fx.delay_time = constrain(configuration.fx.delay_time, DELAY_TIME_MIN / 10, DELAY_TIME_MAX / 10);
configuration.soft_midi_thru = constrain(configuration.soft_midi_thru, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
configuration.fx.delay_level = constrain(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
@ -1398,12 +1379,12 @@ void check_configuration(void)
configuration.dexed[instance_id].op_enabled = constrain(configuration.dexed[instance_id].op_enabled, OP_ENABLED_MIN, OP_ENABLED_MAX); configuration.dexed[instance_id].op_enabled = constrain(configuration.dexed[instance_id].op_enabled, OP_ENABLED_MIN, OP_ENABLED_MAX);
} }
master_mixer_r.gain(CHORUS, mapfloat(configuration.delay_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.delay_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(CHORUS, mapfloat(configuration.delay_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.delay_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_r.gain(REVERB, mapfloat(configuration.delay_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, mapfloat(configuration.fx.delay_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(REVERB, mapfloat(configuration.delay_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.fx.delay_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
} }
void init_configuration(void) void init_configuration(void)
@ -1412,25 +1393,26 @@ void init_configuration(void)
Serial.println(F("INITIALIZING CONFIGURATION")); Serial.println(F("INITIALIZING CONFIGURATION"));
#endif #endif
configuration.checksum = 0xffff; configuration.sys.checksum = 0xffff;
configuration.instances = INSTANCES_DEFAULT; configuration.sys.instances = INSTANCES_DEFAULT;
configuration.vol = VOLUME_DEFAULT; configuration.sys.vol = VOLUME_DEFAULT;
configuration.mono = MONO_DEFAULT; configuration.sys.mono = MONO_DEFAULT;
configuration.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT; configuration.fx.checksum = 0xffff;
configuration.reverb_damping = REVERB_DAMPING_DEFAULT; configuration.fx.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT;
configuration.reverb_level = REVERB_LEVEL_DEFAULT; configuration.fx.reverb_damping = REVERB_DAMPING_DEFAULT;
configuration.chorus_frequency = CHORUS_FREQUENCY_DEFAULT; configuration.fx.reverb_level = REVERB_LEVEL_DEFAULT;
configuration.chorus_waveform = CHORUS_WAVEFORM_DEFAULT; configuration.fx.chorus_frequency = CHORUS_FREQUENCY_DEFAULT;
configuration.chorus_depth = CHORUS_DEPTH_DEFAULT; configuration.fx.chorus_waveform = CHORUS_WAVEFORM_DEFAULT;
configuration.chorus_level = CHORUS_LEVEL_DEFAULT; configuration.fx.chorus_depth = CHORUS_DEPTH_DEFAULT;
configuration.delay_time = DELAY_TIME_DEFAULT / 10; configuration.fx.chorus_level = CHORUS_LEVEL_DEFAULT;
configuration.delay_feedback = DELAY_FEEDBACK_DEFAULT; configuration.fx.delay_time = DELAY_TIME_DEFAULT / 10;
configuration.delay_level = DELAY_LEVEL_DEFAULT; configuration.fx.delay_feedback = DELAY_FEEDBACK_DEFAULT;
configuration.soft_midi_thru = SOFT_MIDI_THRU_DEFAULT; configuration.fx.delay_level = DELAY_LEVEL_DEFAULT;
strcpy(configuration.config_name, "INITCONFIG"); configuration.sys.soft_midi_thru = SOFT_MIDI_THRU_DEFAULT;
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
configuration.dexed[instance_id].checksum = 0xffff;
configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL; configuration.dexed[instance_id].midi_channel = DEFAULT_MIDI_CHANNEL;
configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT; configuration.dexed[instance_id].bank = SYSEXBANK_DEFAULT;
configuration.dexed[instance_id].voice = SYSEXSOUND_DEFAULT; configuration.dexed[instance_id].voice = SYSEXSOUND_DEFAULT;
@ -1471,8 +1453,11 @@ void init_configuration(void)
MicroDexed[instance_id]->controllers.refresh(); MicroDexed[instance_id]->controllers.refresh();
} }
set_volume(configuration.vol, configuration.mono); set_volume(configuration.sys.vol, configuration.sys.mono);
eeprom_update(); eeprom_update_sys();
eeprom_update_fx();
for (uint8_t i = 0; i < NUM_DEXED; i++)
eeprom_update_dexed(i);
} }
void eeprom_write(void) void eeprom_write(void)
@ -1481,7 +1466,7 @@ void eeprom_write(void)
eeprom_update_flag = true; eeprom_update_flag = true;
} }
void eeprom_update(void) void eeprom_update_sys(void)
{ {
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
@ -1490,14 +1475,106 @@ void eeprom_update(void)
else else
{ {
eeprom_update_flag = false; eeprom_update_flag = false;
configuration.checksum = crc32((byte*)&configuration + 4, sizeof(configuration) - 4); configuration.sys.checksum = crc32((byte*)&configuration.sys + 4, sizeof(configuration.sys) - 4);
EEPROM.put(EEPROM_START_ADDRESS, configuration); EEPROM.put(EEPROM_SYS_START_ADDRESS, configuration.sys);
#ifdef DEBUG
Serial.println(F("Updating EEPROM sys"));
show_configuration();
#endif
}
}
}
bool eeprom_get_sys(void)
{
EEPROM.get(EEPROM_SYS_START_ADDRESS, configuration.sys);
uint32_t checksum = crc32((byte*)&configuration.sys + 4, sizeof(configuration.sys) - 4);
if (checksum != configuration.sys.checksum)
{
#ifdef DEBUG
Serial.println(F("Checksum error reading EEPROM sys."));
#endif
return (false);
}
else
{
#ifdef DEBUG
Serial.print(F("EEPROM sys loaded."));
show_configuration();
#endif
return (true);
}
}
void eeprom_update_fx(void)
{
configuration.fx.checksum = crc32((byte*)&configuration.fx + 4, sizeof(configuration.fx) - 4);
EEPROM.put(EEPROM_FX_START_ADDRESS, configuration.fx);
#ifdef DEBUG
Serial.println(F("Updating EEPROM fx"));
show_configuration();
#endif
}
bool eeprom_get_fx(void)
{
EEPROM.get(EEPROM_FX_START_ADDRESS, configuration.fx);
uint32_t checksum = crc32((byte*)&configuration.fx + 4, sizeof(configuration.fx) - 4);
if (checksum != configuration.fx.checksum)
{
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Updating EEPROM")); Serial.println(F("Checksum error reading EEPROM fx."));
#endif
return (false);
}
else
{
#ifdef DEBUG
Serial.print(F("EEPROM fx loaded."));
show_configuration(); show_configuration();
#endif #endif
return (true);
} }
} }
void eeprom_update_dexed(uint8_t instance_id)
{
configuration.dexed[instance_id].checksum = crc32((byte*)&configuration.dexed[instance_id] + 4, sizeof(configuration.dexed[instance_id]) - 4);
EEPROM.put(EEPROM_DEXED_START_ADDRESS + instance_id * sizeof(dexed_t), configuration.dexed[instance_id]);
#ifdef DEBUG
Serial.print(F("Updating EEPROM dexed (instance "));
Serial.print(instance_id);
Serial.println(F(")"));
show_configuration();
#endif
}
bool eeprom_get_dexed(uint8_t instance_id)
{
EEPROM.get(EEPROM_DEXED_START_ADDRESS + instance_id * sizeof(dexed_t), configuration.dexed[instance_id]);
uint32_t checksum = crc32((byte*)&configuration.dexed[instance_id] + 4, sizeof(configuration.dexed[instance_id]) - 4);
if (checksum != configuration.dexed[instance_id].checksum)
{
#ifdef DEBUG
Serial.print(F("Checksum error reading EEPROM dexed (instance "));
Serial.print(instance_id);
Serial.println(F(")"));
#endif
return (false);
}
else
{
#ifdef DEBUG
Serial.print(F("EEPROM dexed (instance "));
Serial.print(instance_id);
Serial.println(F(") loaded."));
show_configuration();
#endif
return (true);
}
} }
/****************************************************************************** /******************************************************************************
@ -1744,27 +1821,29 @@ void show_configuration(void)
{ {
Serial.println(); Serial.println();
Serial.println(F("CONFIGURATION:")); Serial.println(F("CONFIGURATION:"));
Serial.print(F("Checksum 0x")); Serial.println(configuration.checksum, HEX); Serial.println(F("System"));
Serial.print(F("Instances ")); Serial.println(configuration.instances, DEC); Serial.print(F(" Checksum 0x")); Serial.println(configuration.sys.checksum, HEX);
Serial.print(F("Volume ")); Serial.println(configuration.vol, DEC); Serial.print(F(" Instances ")); Serial.println(configuration.sys.instances, DEC);
Serial.print(F("Mono ")); Serial.println(configuration.mono, DEC); Serial.print(F(" Volume ")); Serial.println(configuration.sys.vol, DEC);
Serial.print(F("Reverb Roomsize ")); Serial.println(configuration.reverb_roomsize, DEC); Serial.print(F(" Mono ")); Serial.println(configuration.sys.mono, DEC);
Serial.print(F("Reverb Damping ")); Serial.println(configuration.reverb_damping, DEC); Serial.print(F(" Soft MIDI Thru ")); Serial.println(configuration.sys.soft_midi_thru, DEC);
Serial.print(F("Reverb Level ")); Serial.println(configuration.reverb_level, DEC); Serial.println(F("FX"));
Serial.print(F("Chorus Frequency ")); Serial.println(configuration.chorus_frequency, DEC); Serial.print(F(" Checksum 0x")); Serial.println(configuration.fx.checksum, HEX);
Serial.print(F("Chorus Waveform ")); Serial.println(configuration.chorus_waveform, DEC); Serial.print(F(" Reverb Roomsize ")); Serial.println(configuration.fx.reverb_roomsize, DEC);
Serial.print(F("Chorus Depth ")); Serial.println(configuration.chorus_depth, DEC); Serial.print(F(" Reverb Damping ")); Serial.println(configuration.fx.reverb_damping, DEC);
Serial.print(F("Chorus Level ")); Serial.println(configuration.chorus_level, DEC); Serial.print(F(" Reverb Level ")); Serial.println(configuration.fx.reverb_level, DEC);
Serial.print(F("Delay Time ")); Serial.println(configuration.delay_time, DEC); Serial.print(F(" Chorus Frequency ")); Serial.println(configuration.fx.chorus_frequency, DEC);
Serial.print(F("Delay Feedback ")); Serial.println(configuration.delay_feedback, DEC); Serial.print(F(" Chorus Waveform ")); Serial.println(configuration.fx.chorus_waveform, DEC);
Serial.print(F("Delay Level ")); Serial.println(configuration.delay_level, DEC); Serial.print(F(" Chorus Depth ")); Serial.println(configuration.fx.chorus_depth, DEC);
Serial.print(F("Soft MIDI Thru ")); Serial.println(configuration.soft_midi_thru, DEC); Serial.print(F(" Chorus Level ")); Serial.println(configuration.fx.chorus_level, DEC);
Serial.print(F(" Delay Time ")); Serial.println(configuration.fx.delay_time, DEC);
Serial.print(F(" Delay Feedback ")); Serial.println(configuration.fx.delay_feedback, DEC);
Serial.print(F(" Delay Level ")); Serial.println(configuration.fx.delay_level, DEC);
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{ {
Serial.print(F("=== DEXED INSTANCE ")); Serial.print(F("Dexed instance "));
Serial.print(instance_id, DEC); Serial.println(instance_id, DEC);
Serial.println(" ==="); Serial.print(F(" Checksum 0x")); Serial.println(configuration.dexed[instance_id].checksum, HEX);
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.dexed[instance_id].midi_channel, DEC); Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.dexed[instance_id].midi_channel, DEC);
Serial.print(F(" Bank ")); Serial.println(configuration.dexed[instance_id].bank, DEC); Serial.print(F(" Bank ")); Serial.println(configuration.dexed[instance_id].bank, DEC);
Serial.print(F(" Voice ")); Serial.println(configuration.dexed[instance_id].voice, DEC); Serial.print(F(" Voice ")); Serial.println(configuration.dexed[instance_id].voice, DEC);

246
UI.hpp

@ -206,6 +206,7 @@ void UI_func_volume(uint8_t param);
void UI_func_load_performance(uint8_t param); void UI_func_load_performance(uint8_t param);
void UI_func_save_performance(uint8_t param); void UI_func_save_performance(uint8_t param);
void UI_func_save_config(uint8_t param); void UI_func_save_config(uint8_t param);
void UI_func_save_config_default(uint8_t param);
void UI_func_midi_soft_thru(uint8_t param); void UI_func_midi_soft_thru(uint8_t param);
void UI_func_velocity_level(uint8_t param); void UI_func_velocity_level(uint8_t param);
void UI_func_eeprom_reset(uint8_t param); void UI_func_eeprom_reset(uint8_t param);
@ -822,7 +823,7 @@ void UI_func_reverb_roomsize(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Reverb Room", configuration.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, true); lcd_display_bar_int("Reverb Room", configuration.fx.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -830,21 +831,20 @@ void UI_func_reverb_roomsize(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.reverb_roomsize = constrain(configuration.reverb_roomsize + ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize + ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.reverb_roomsize = constrain(configuration.reverb_roomsize - ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); configuration.fx.reverb_roomsize = constrain(configuration.fx.reverb_roomsize - ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX);
lcd_display_bar_int("Reverb Room", configuration.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, false); lcd_display_bar_int("Reverb Room", configuration.fx.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, false);
freeverb_r.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_r.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
freeverb_l.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0));
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -856,7 +856,7 @@ void UI_func_reverb_damping(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Reverb Damp.", configuration.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, true); lcd_display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -864,21 +864,20 @@ void UI_func_reverb_damping(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.reverb_damping = constrain(configuration.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.reverb_damping = constrain(configuration.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); configuration.fx.reverb_damping = constrain(configuration.fx.reverb_damping - ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX);
lcd_display_bar_int("Reverb Damp.", configuration.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, false); lcd_display_bar_int("Reverb Damp.", configuration.fx.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, false);
freeverb_r.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
freeverb_l.damping(mapfloat(configuration.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0));
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -917,7 +916,6 @@ void UI_func_reverb_send(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -929,7 +927,7 @@ void UI_func_reverb_level(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Reverb Level", configuration.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); lcd_display_bar_int("Reverb Level", configuration.fx.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -937,21 +935,20 @@ void UI_func_reverb_level(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.reverb_level = constrain(configuration.reverb_level + ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); configuration.fx.reverb_level = constrain(configuration.fx.reverb_level + ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.reverb_level = constrain(configuration.reverb_level - ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); configuration.fx.reverb_level = constrain(configuration.fx.reverb_level - ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX);
lcd_display_bar_int("Reverb Level", configuration.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); lcd_display_bar_int("Reverb Level", configuration.fx.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true);
master_mixer_r.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(REVERB, mapfloat(configuration.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(REVERB, mapfloat(configuration.fx.reverb_level, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 0.0, 1.0));
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -963,7 +960,7 @@ void UI_func_chorus_frequency(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_float("Chorus Frq.", configuration.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, true); lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -971,20 +968,19 @@ void UI_func_chorus_frequency(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.chorus_frequency = constrain(configuration.chorus_frequency + ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency + ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.chorus_frequency = constrain(configuration.chorus_frequency - ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); configuration.fx.chorus_frequency = constrain(configuration.fx.chorus_frequency - ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX);
lcd_display_bar_float("Chorus Frq.", configuration.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, false); lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, false);
chorus_modulator.frequency(configuration.chorus_frequency / 10.0); chorus_modulator.frequency(configuration.fx.chorus_frequency / 10.0);
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1002,12 +998,12 @@ void UI_func_chorus_waveform(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
{ {
if (LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) if (LCDML.BT_checkDown() && encoderDir[ENC_R].Down())
configuration.chorus_waveform = constrain(configuration.chorus_waveform + 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); configuration.fx.chorus_waveform = constrain(configuration.fx.chorus_waveform + 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX);
else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) else if (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())
configuration.chorus_waveform = constrain(configuration.chorus_waveform - 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); configuration.fx.chorus_waveform = constrain(configuration.fx.chorus_waveform - 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.chorus_waveform) switch (configuration.fx.chorus_waveform)
{ {
case 0: case 0:
chorus_modulator.begin(WAVEFORM_TRIANGLE); chorus_modulator.begin(WAVEFORM_TRIANGLE);
@ -1027,7 +1023,6 @@ void UI_func_chorus_waveform(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
// you can here reset some global vars or do nothing // you can here reset some global vars or do nothing
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1039,7 +1034,7 @@ void UI_func_chorus_depth(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Chorus Dpt.", configuration.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, true); lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -1047,20 +1042,19 @@ void UI_func_chorus_depth(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.chorus_depth = constrain(configuration.chorus_depth + ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth + ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.chorus_depth = constrain(configuration.chorus_depth - ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_depth = constrain(configuration.fx.chorus_depth - ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX);
lcd_display_bar_int("Chorus Dpt.", configuration.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false); lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false);
chorus_modulator.amplitude(configuration.chorus_depth / 100.0); chorus_modulator.amplitude(configuration.fx.chorus_depth / 100.0);
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1099,7 +1093,6 @@ void UI_func_chorus_send(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1111,7 +1104,7 @@ void UI_func_chorus_level(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Chorus Lvl.", configuration.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, true); lcd_display_bar_int("Chorus Lvl.", configuration.fx.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -1119,21 +1112,20 @@ void UI_func_chorus_level(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.chorus_level = constrain(configuration.chorus_level + ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); configuration.fx.chorus_level = constrain(configuration.fx.chorus_level + ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.chorus_level = constrain(configuration.chorus_level - ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); configuration.fx.chorus_level = constrain(configuration.fx.chorus_level - ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX);
lcd_display_bar_int("Chorus Lvl.", configuration.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, false); lcd_display_bar_int("Chorus Lvl.", configuration.fx.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, false);
master_mixer_r.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(CHORUS, mapfloat(configuration.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(CHORUS, mapfloat(configuration.fx.chorus_level, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 0.0, 1.0));
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1145,7 +1137,7 @@ void UI_func_delay_time(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Delay Time", configuration.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); lcd_display_bar_int("Delay Time", configuration.fx.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -1153,21 +1145,20 @@ void UI_func_delay_time(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.delay_time = constrain(configuration.delay_time + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_time = constrain(configuration.fx.delay_time + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.delay_time = constrain(configuration.delay_time - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_time = constrain(configuration.fx.delay_time - ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX);
lcd_display_bar_int("Delay Time", configuration.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); lcd_display_bar_int("Delay Time", configuration.fx.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true);
delay_r.delay(0, configuration.delay_time * 10); delay_r.delay(0, configuration.fx.delay_time * 10);
delay_l.delay(0, configuration.delay_time * 10); delay_l.delay(0, configuration.fx.delay_time * 10);
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1179,7 +1170,7 @@ void UI_func_delay_feedback(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Delay Feedb.", configuration.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, true); lcd_display_bar_int("Delay Feedb.", configuration.fx.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -1187,22 +1178,21 @@ void UI_func_delay_feedback(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.delay_feedback = constrain(configuration.delay_feedback + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.delay_feedback = constrain(configuration.delay_feedback - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.delay_feedback = constrain(configuration.fx.delay_feedback - ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX);
lcd_display_bar_int("Delay Feedb.", configuration.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, false); lcd_display_bar_int("Delay Feedb.", configuration.fx.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, false);
delay_fb_mixer_r.gain(1, configuration.delay_feedback / 100.0); // amount of feedback delay_fb_mixer_r.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback
delay_fb_mixer_l.gain(1, configuration.delay_feedback / 100.0); // amount of feedback delay_fb_mixer_l.gain(1, configuration.fx.delay_feedback / 100.0); // amount of feedback
//delay_fb_mixer.gain(0, 1.0 - configuration.delay_feedback / 200.0); // original signal //delay_fb_mixer.gain(0, 1.0 - configuration.fx.delay_feedback / 200.0); // original signal
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1241,7 +1231,6 @@ void UI_func_delay_send(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1253,7 +1242,7 @@ void UI_func_delay_level(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Delay Lvl.", configuration.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, true); lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, true);
} }
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
@ -1261,21 +1250,20 @@ void UI_func_delay_level(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.delay_level = constrain(configuration.delay_level + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); configuration.fx.delay_level = constrain(configuration.fx.delay_level + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.delay_level = constrain(configuration.delay_level - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); configuration.fx.delay_level = constrain(configuration.fx.delay_level - ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX);
lcd_display_bar_int("Delay Lvl.", configuration.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, false); lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, false);
master_mixer_r.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
master_mixer_l.gain(DELAY, mapfloat(configuration.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); master_mixer_l.gain(DELAY, mapfloat(configuration.fx.delay_level, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0));
} }
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1313,7 +1301,6 @@ void UI_func_filter_cutoff(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1351,7 +1338,6 @@ void UI_func_filter_resonance(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1391,7 +1377,6 @@ void UI_func_transpose(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1430,7 +1415,6 @@ void UI_func_tune(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1471,7 +1455,6 @@ void UI_func_midi_channel(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
// you can here reset some global vars or do nothing // you can here reset some global vars or do nothing
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1523,7 +1506,6 @@ void UI_func_lowest_note(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1566,7 +1548,6 @@ void UI_func_highest_note(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1605,7 +1586,6 @@ void UI_func_sound_intensity(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1621,7 +1601,7 @@ void UI_func_panorama(uint8_t param)
{ {
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
if (configuration.mono > 0) if (configuration.sys.mono > 0)
{ {
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Panorama")); lcd.print(F("Panorama"));
@ -1635,12 +1615,12 @@ void UI_func_panorama(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
{ {
if (LCDML.BT_checkDown() && configuration.mono == 0) if (LCDML.BT_checkDown() && configuration.sys.mono == 0)
configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan + ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan + ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX);
else if (LCDML.BT_checkUp() && configuration.mono == 0) else if (LCDML.BT_checkUp() && configuration.sys.mono == 0)
configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan - ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan - ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX);
if (configuration.mono == 0) if (configuration.sys.mono == 0)
{ {
lcd_display_meter_float("Panorama", configuration.dexed[instance_id].pan, 0.05, -20.0, PANORAMA_MIN, PANORAMA_MAX, 3, 1, false, false, true, false); lcd_display_meter_float("Panorama", configuration.dexed[instance_id].pan, 0.05, -20.0, PANORAMA_MIN, PANORAMA_MAX, 3, 1, false, false, true, false);
mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0)); mono2stereo[instance_id]->panorama(mapfloat(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX, -1.0, 1.0));
@ -1650,7 +1630,6 @@ void UI_func_panorama(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1664,7 +1643,7 @@ void UI_func_stereo_mono(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Stereo/Mono")); lcd.print(F("Stereo/Mono"));
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.mono) switch (configuration.sys.mono)
{ {
case 0: case 0:
lcd.print(F("[STEREO]")); lcd.print(F("[STEREO]"));
@ -1688,12 +1667,12 @@ void UI_func_stereo_mono(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.mono = constrain(configuration.mono + 1, MONO_MIN, MONO_MAX); configuration.sys.mono = constrain(configuration.sys.mono + 1, MONO_MIN, MONO_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.mono = constrain(configuration.mono - 1, MONO_MIN, MONO_MAX); configuration.sys.mono = constrain(configuration.sys.mono - 1, MONO_MIN, MONO_MAX);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.mono) switch (configuration.sys.mono)
{ {
case 0: case 0:
lcd.print(F("[STEREO]")); lcd.print(F("[STEREO]"));
@ -1712,7 +1691,7 @@ void UI_func_stereo_mono(uint8_t param)
stereo2mono.stereo(false); stereo2mono.stereo(false);
break; break;
} }
set_volume(configuration.vol, configuration.mono); set_volume(configuration.sys.vol, configuration.sys.mono);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -1755,7 +1734,6 @@ void UI_func_polyphony(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1804,7 +1782,6 @@ void UI_func_engine(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1850,7 +1827,6 @@ void UI_func_mono_poly(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1896,7 +1872,6 @@ void UI_func_note_refresh(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1934,7 +1909,6 @@ void UI_func_pb_range(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -1972,7 +1946,6 @@ void UI_func_pb_step(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2010,7 +1983,6 @@ void UI_func_mw_range(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2074,7 +2046,6 @@ void UI_func_mw_assign(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2124,7 +2095,6 @@ void UI_func_mw_mode(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2163,7 +2133,6 @@ void UI_func_fc_range(uint8_t param)
{ {
// you can here reset some global vars or do nothing // you can here reset some global vars or do nothing
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2227,7 +2196,6 @@ void UI_func_fc_assign(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2277,7 +2245,6 @@ void UI_func_fc_mode(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2315,7 +2282,6 @@ void UI_func_bc_range(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2379,7 +2345,6 @@ void UI_func_bc_assign(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2429,7 +2394,6 @@ void UI_func_bc_mode(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2467,7 +2431,6 @@ void UI_func_at_range(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2531,7 +2494,6 @@ void UI_func_at_assign(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2581,7 +2543,6 @@ void UI_func_at_mode(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2633,7 +2594,6 @@ void UI_func_portamento_mode(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2679,7 +2639,6 @@ void UI_func_portamento_glissando(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2717,7 +2676,6 @@ void UI_func_portamento_time(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2835,7 +2793,6 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id)
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -2883,12 +2840,12 @@ void UI_func_midi_soft_thru(uint8_t param)
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.soft_midi_thru = constrain(configuration.soft_midi_thru + 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru + 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.soft_midi_thru = constrain(configuration.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); configuration.sys.soft_midi_thru = constrain(configuration.sys.soft_midi_thru - 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX);
} }
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.soft_midi_thru) switch (configuration.sys.soft_midi_thru)
{ {
case 0: case 0:
lcd.print(F("[OFF]")); lcd.print(F("[OFF]"));
@ -2938,7 +2895,6 @@ void UI_func_velocity_level(uint8_t param)
{ {
// you can here reset some global vars or do nothing // you can here reset some global vars or do nothing
lcd_special_chars(SCROLLBAR); lcd_special_chars(SCROLLBAR);
eeprom_write();
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
} }
} }
@ -3173,7 +3129,7 @@ void UI_func_volume(uint8_t param)
encoderDir[ENC_L].reset(); encoderDir[ENC_L].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Master Vol.", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true); lcd_display_bar_int("Master Vol.", configuration.sys.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true);
back_from_volume = 0; back_from_volume = 0;
} }
@ -3186,16 +3142,16 @@ void UI_func_volume(uint8_t param)
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
{ {
configuration.vol = constrain(configuration.vol + ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); configuration.sys.vol = constrain(configuration.sys.vol + ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX);
} }
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
{ {
configuration.vol = constrain(configuration.vol - ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); configuration.sys.vol = constrain(configuration.sys.vol - ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX);
} }
} }
lcd_display_bar_int("Master Vol.", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, false); lcd_display_bar_int("Master Vol.", configuration.sys.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, false);
set_volume(configuration.vol, configuration.mono); set_volume(configuration.sys.vol, configuration.sys.mono);
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -3290,7 +3246,7 @@ void UI_func_save_config(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Save Config SD")); lcd.print(F("Save Cfg SD"));
#if NUMDEXED > 1 #if NUMDEXED > 1
instance_id = -1; instance_id = -1;
@ -3359,7 +3315,7 @@ void UI_func_save_config(uint8_t param)
if (yesno == true) if (yesno == true)
{ {
LCDML.DISP_clear(); LCDML.DISP_clear();
lcd.print(F("Storing config")); lcd.print(F("Save Cfg SD"));
save_sd_voiceconfig(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); save_sd_voiceconfig(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id);
@ -3372,6 +3328,56 @@ void UI_func_save_config(uint8_t param)
} }
} }
void UI_func_save_config_default(uint8_t param)
{
static bool yesno;
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
encoderDir[ENC_R].reset();
lcd.setCursor(0, 0);
lcd.print(F("Save Cfg default"));
lcd.setCursor(0, 1);
lcd.print(F("[NO ]"));
if (LCDML.FUNC_loop()) // ****** LOOP *********
{
if ((LCDML.BT_checkDown() || LCDML.BT_checkUp()))
{
yesno = !yesno;
if (yesno == true)
{
lcd.setCursor(1, 1);
lcd.print(F("YES"));
}
else
{
lcd.setCursor(1, 1);
lcd.print(F("NO "));
}
}
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
if (yesno == true)
{
LCDML.DISP_clear();
lcd.print(F("Save Cfg default"));
// EEPROM!!!
lcd.setCursor(0, 1);
lcd.print(F("Done."));
delay(500);
}
encoderDir[ENC_R].reset();
}
}
}
void UI_func_sysex_send_voice(uint8_t param) void UI_func_sysex_send_voice(uint8_t param)
{ {
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********

@ -98,19 +98,23 @@ LCDML_add(69, LCDML_0_2_3, 1, "Roomsize", UI_func_reverb_roomsize);
LCDML_add(70, LCDML_0_2_3, 2, "Damping", UI_func_reverb_damping); LCDML_add(70, LCDML_0_2_3, 2, "Damping", UI_func_reverb_damping);
LCDML_add(71, LCDML_0_2_3, 3, "Level", UI_func_reverb_level); LCDML_add(71, LCDML_0_2_3, 3, "Level", UI_func_reverb_level);
LCDML_add(72, LCDML_0, 3, "Load/Save", NULL); LCDML_add(72, LCDML_0, 3, "Load/Save", NULL);
//LCDML_add(73, LCDML_0_3, 2, "Load Perf. SD", UI_func_load_performance); LCDML_add(73, LCDML_0_3, 1, "Performance", NULL);
//LCDML_add(74, LCDML_0_3, 2, "Save Perf. SD", UI_func_save_performance); LCDML_add(74, LCDML_0_3_1, 1, "Load Perf. SD", UI_func_load_performance);
LCDML_add(73, LCDML_0_3, 1, "Save Config SD", UI_func_save_config); LCDML_add(75, LCDML_0_3_1, 2, "Save Perf. SD", UI_func_save_performance);
LCDML_add(74, LCDML_0_3, 3, "Save Voice SD", UI_func_save_voice); LCDML_add(76, LCDML_0_3, 2, "Voice", NULL);
LCDML_add(75, LCDML_0_3, 4, "MIDI Recv Bank", UI_func_sysex_receive_bank); LCDML_add(77, LCDML_0_3_2, 1, "Save Cfg SD", UI_func_save_config);
LCDML_add(76, LCDML_0_3, 5, "MIDI Send Bank", UI_func_sysex_send_bank); LCDML_add(78, LCDML_0_3_2, 2, "Save Cfg default", UI_func_save_config_default);
LCDML_add(77, LCDML_0_3, 6, "EEPROM Reset", UI_func_eeprom_reset); LCDML_add(79, LCDML_0_3_2, 3, "Save Voice SD", UI_func_save_voice);
LCDML_add(78, LCDML_0, 4, "System", NULL); LCDML_add(80, LCDML_0_3, 3, "MIDI", NULL);
LCDML_add(79, LCDML_0_4, 3, "Volume", UI_func_volume); LCDML_add(81, LCDML_0_3_3, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank);
LCDML_add(80, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); LCDML_add(82, LCDML_0_3_3, 2, "MIDI Send Bank", UI_func_sysex_send_bank);
LCDML_add(81, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); LCDML_add(83, LCDML_0_3, 6, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(82, LCDML_0, 6, "Info", UI_func_information); LCDML_add(84, LCDML_0, 4, "System", NULL);
#define _LCDML_DISP_cnt 82 LCDML_add(85, LCDML_0_4, 3, "Volume", UI_func_volume);
LCDML_add(86, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(87, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(88, LCDML_0, 6, "Info", UI_func_information);
#define _LCDML_DISP_cnt 88
#define MENU_ID_OF_INSTANCE_2 58 #define MENU_ID_OF_INSTANCE_2 58
#define VOLUME_MENU_ID 79 #define VOLUME_MENU_ID 85
#endif #endif

@ -237,6 +237,10 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define CONTROL_RATE_MS 100 #define CONTROL_RATE_MS 100
#define EEPROM_SYS_START_ADDRESS EEPROM_START_ADDRESS
#define EEPROM_FX_START_ADDRESS EEPROM_START_ADDRESS + sizeof(configuration.sys)
#define EEPROM_DEXED_START_ADDRESS EEPROM_START_ADDRESS + sizeof(configuration.sys)+ sizeof(configuration.fx)
// MIDI // MIDI
#ifdef MIDI_DEVICE_USB #ifdef MIDI_DEVICE_USB
#define USBCON 1 #define USBCON 1
@ -503,6 +507,7 @@ enum { DEXED, CHORUS, DELAY, REVERB};
// //
typedef struct { typedef struct {
uint32_t checksum;
uint8_t lowest_note; uint8_t lowest_note;
uint8_t highest_note; uint8_t highest_note;
uint8_t reverb_send; uint8_t reverb_send;
@ -542,12 +547,8 @@ typedef struct {
uint8_t voice; uint8_t voice;
} dexed_t; } dexed_t;
// struct for holding the current configuration
typedef struct { typedef struct {
uint32_t checksum; uint32_t checksum;
uint8_t instances;
uint8_t vol;
uint8_t mono;
uint8_t reverb_roomsize; uint8_t reverb_roomsize;
uint8_t reverb_damping; uint8_t reverb_damping;
uint8_t reverb_level; uint8_t reverb_level;
@ -558,9 +559,20 @@ typedef struct {
uint8_t delay_time; uint8_t delay_time;
uint8_t delay_feedback; uint8_t delay_feedback;
uint8_t delay_level; uint8_t delay_level;
} fx_t;
typedef struct {
uint32_t checksum;
uint8_t instances;
uint8_t vol;
uint8_t mono;
uint8_t soft_midi_thru; uint8_t soft_midi_thru;
} sys_t;
typedef struct {
sys_t sys;
fx_t fx;
dexed_t dexed[NUM_DEXED]; dexed_t dexed[NUM_DEXED];
char config_name[11];
} config_t; } config_t;
#if !defined(_MAPFLOAT) #if !defined(_MAPFLOAT)

@ -202,7 +202,7 @@ bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id)
Serial.print(filename); Serial.print(filename);
Serial.println(F(" on SD.")); Serial.println(F(" on SD."));
#endif #endif
return (get_sd_voiceconfig(sysex, (uint8_t*)&configuration.dexed[instance_id])); return (get_sd_voiceconfig(sysex, (uint8_t*)&configuration.dexed[instance_id], instance_id));
} }
} }
else else
@ -218,7 +218,7 @@ bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id)
return (false); return (false);
} }
bool get_sd_voiceconfig(File sysex, uint8_t* conf) bool get_sd_voiceconfig(File sysex, uint8_t* conf, uint8_t instance_id)
{ {
uint16_t n; uint16_t n;
int32_t bulk_checksum_calc = 0; int32_t bulk_checksum_calc = 0;
@ -287,7 +287,7 @@ bool get_sd_voiceconfig(File sysex, uint8_t* conf)
#ifdef DEBUG #ifdef DEBUG
Serial.println(F("Voice config loaded.")); Serial.println(F("Voice config loaded."));
#endif #endif
configuration.checksum = crc32((uint8_t*)&configuration + 4, sizeof(configuration) - 4); configuration.dexed[instance_id].checksum = crc32((uint8_t*)&configuration.dexed[instance_id] + 4, sizeof(configuration.dexed[instance_id]) - 4);
return (true); return (true);
} }

@ -49,7 +49,7 @@ bool load_sd_voice(uint8_t b, uint8_t v, uint8_t instance_id);
bool get_sd_voice(File sysex, uint8_t voice_number, uint8_t* data); bool get_sd_voice(File sysex, uint8_t voice_number, uint8_t* data);
bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id); bool load_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id);
bool get_sd_voiceconfig(File sysex, uint8_t* conf); bool get_sd_voiceconfig(File sysex, uint8_t* conf, uint8_t instance_id);
bool save_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id); bool save_sd_voiceconfig(uint8_t b, uint8_t v, uint8_t instance_id);
bool write_sd_voiceconfig(File sysex, uint8_t* data, uint16_t len); bool write_sd_voiceconfig(File sysex, uint8_t* data, uint16_t len);

@ -79,7 +79,7 @@ void handleNoteOn_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocity
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] NoteOn")); Serial.print(F("[MIDI_DIN] NoteOn"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendNoteOn(inNumber, inVelocity, inChannel); midi_usb.sendNoteOn(inNumber, inVelocity, inChannel);
@ -105,7 +105,7 @@ void handleNoteOff_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte inVelocit
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] NoteOff")); Serial.print(F("[MIDI_DIN] NoteOff"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendNoteOff(inNumber, inVelocity, inChannel); midi_usb.sendNoteOff(inNumber, inVelocity, inChannel);
@ -131,7 +131,7 @@ void handleControlChange_MIDI_DEVICE_DIN(byte inChannel, byte inData1, byte inDa
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] CC")); Serial.print(F("[MIDI_DIN] CC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendControlChange(inData1, inData2, inChannel); midi_usb.sendControlChange(inData1, inData2, inChannel);
@ -157,7 +157,7 @@ void handleAfterTouch_MIDI_DEVICE_DIN(byte inChannel, byte inPressure)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] AT")); Serial.print(F("[MIDI_DIN] AT"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendAfterTouch(inPressure, inChannel); midi_usb.sendAfterTouch(inPressure, inChannel);
@ -183,7 +183,7 @@ void handlePitchBend_MIDI_DEVICE_DIN(byte inChannel, int inPitch)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] PB")); Serial.print(F("[MIDI_DIN] PB"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendPitchBend(inPitch, inChannel); midi_usb.sendPitchBend(inPitch, inChannel);
@ -209,7 +209,7 @@ void handleProgramChange_MIDI_DEVICE_DIN(byte inChannel, byte inProgram)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] PC")); Serial.print(F("[MIDI_DIN] PC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendProgramChange(inProgram, inChannel); midi_usb.sendProgramChange(inProgram, inChannel);
@ -235,7 +235,7 @@ void handleSystemExclusive_MIDI_DEVICE_DIN(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] SysEx")); Serial.print(F("[MIDI_DIN] SysEx"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendSysEx(len, data); midi_usb.sendSysEx(len, data);
@ -261,7 +261,7 @@ void handleSystemExclusive_MIDI_DEVICE_DIN(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] SysExChunk")); Serial.print(F("[MIDI_DIN] SysExChunk"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendSysEx(len, data, last); midi_usb.sendSysEx(len, data, last);
@ -287,7 +287,7 @@ void handleTimeCodeQuarterFrame_MIDI_DEVICE_DIN(byte data)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] TimeCodeQuarterFrame")); Serial.print(F("[MIDI_DIN] TimeCodeQuarterFrame"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendTimeCodeQuarterFrame(0xF1, data); midi_usb.sendTimeCodeQuarterFrame(0xF1, data);
@ -313,7 +313,7 @@ void handleAfterTouchPoly_MIDI_DEVICE_DIN(byte inChannel, byte inNumber, byte in
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] AT-Poly")); Serial.print(F("[MIDI_DIN] AT-Poly"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendAfterTouch(inNumber, inVelocity, inChannel); midi_usb.sendAfterTouch(inNumber, inVelocity, inChannel);
@ -339,7 +339,7 @@ void handleSongSelect_MIDI_DEVICE_DIN(byte inSong)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] SongSelect")); Serial.print(F("[MIDI_DIN] SongSelect"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendSongSelect(inSong); midi_usb.sendSongSelect(inSong);
@ -365,7 +365,7 @@ void handleTuneRequest_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] TuneRequest")); Serial.print(F("[MIDI_DIN] TuneRequest"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendTuneRequest(); midi_usb.sendTuneRequest();
@ -391,7 +391,7 @@ void handleClock_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] Clock")); Serial.print(F("[MIDI_DIN] Clock"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::Clock); midi_usb.sendRealTime(midi::Clock);
@ -417,7 +417,7 @@ void handleStart_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] Start")); Serial.print(F("[MIDI_DIN] Start"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::Start); midi_usb.sendRealTime(midi::Start);
@ -443,7 +443,7 @@ void handleContinue_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] Continue")); Serial.print(F("[MIDI_DIN] Continue"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::Continue); midi_usb.sendRealTime(midi::Continue);
@ -469,7 +469,7 @@ void handleStop_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] Stop")); Serial.print(F("[MIDI_DIN] Stop"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::Stop); midi_usb.sendRealTime(midi::Stop);
@ -495,7 +495,7 @@ void handleActiveSensing_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] ActiveSensing")); Serial.print(F("[MIDI_DIN] ActiveSensing"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::ActiveSensing); midi_usb.sendRealTime(midi::ActiveSensing);
@ -521,7 +521,7 @@ void handleSystemReset_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] SystemReset")); Serial.print(F("[MIDI_DIN] SystemReset"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(midi::SystemReset); midi_usb.sendRealTime(midi::SystemReset);
@ -547,7 +547,7 @@ void handleSystemReset_MIDI_DEVICE_DIN(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_DIN] RealTimeSystem")); Serial.print(F("[MIDI_DIN] RealTimeSystem"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_USB_HOST #ifdef MIDI_DEVICE_USB_HOST
midi_usb.sendRealTime(inRealTime); midi_usb.sendRealTime(inRealTime);
@ -578,7 +578,7 @@ void handleNoteOn_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVel
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] NoteOn")); Serial.print(F("[MIDI_USB_HOST] NoteOn"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendNoteOn(inNumber, inVelocity, inChannel); midi_serial.sendNoteOn(inNumber, inVelocity, inChannel);
@ -604,7 +604,7 @@ void handleNoteOff_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, byte inVe
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] NoteOff")); Serial.print(F("[MIDI_USB_HOST] NoteOff"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendNoteOff(inNumber, inVelocity, inChannel); midi_serial.sendNoteOff(inNumber, inVelocity, inChannel);
@ -630,7 +630,7 @@ void handleControlChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inData1, byte
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] CC")); Serial.print(F("[MIDI_USB_HOST] CC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendControlChange(inData1, inData2, inChannel); midi_serial.sendControlChange(inData1, inData2, inChannel);
@ -656,7 +656,7 @@ void handleAfterTouch_MIDI_DEVICE_USB_HOST(byte inChannel, byte inPressure)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] AT")); Serial.print(F("[MIDI_USB_HOST] AT"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendAfterTouch(inPressure, inChannel); midi_serial.sendAfterTouch(inPressure, inChannel);
@ -682,7 +682,7 @@ void handlePitchBend_MIDI_DEVICE_USB_HOST(byte inChannel, int inPitch)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] PB")); Serial.print(F("[MIDI_USB_HOST] PB"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendPitchBend(inPitch, inChannel); midi_serial.sendPitchBend(inPitch, inChannel);
@ -708,7 +708,7 @@ void handleProgramChange_MIDI_DEVICE_USB_HOST(byte inChannel, byte inProgram)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] PC")); Serial.print(F("[MIDI_USB_HOST] PC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendProgramChange(inProgram, inChannel); midi_serial.sendProgramChange(inProgram, inChannel);
@ -734,7 +734,7 @@ void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] SysEx")); Serial.print(F("[MIDI_USB_HOST] SysEx"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSysEx(len, data); midi_serial.sendSysEx(len, data);
@ -760,7 +760,7 @@ void handleSystemExclusive_MIDI_DEVICE_USB_HOST(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] SysExChunk")); Serial.print(F("[MIDI_USB_HOST] SysExChunk"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSysEx(len, data, last); midi_serial.sendSysEx(len, data, last);
@ -786,7 +786,7 @@ void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB_HOST(midi::DataByte data)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] TimeCodeQuarterFrame")); Serial.print(F("[MIDI_USB_HOST] TimeCodeQuarterFrame"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendTimeCodeQuarterFrame(data); midi_serial.sendTimeCodeQuarterFrame(data);
@ -812,7 +812,7 @@ void handleAfterTouchPoly_MIDI_DEVICE_USB_HOST(byte inChannel, byte inNumber, by
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] AT-Poly")); Serial.print(F("[MIDI_USB_HOST] AT-Poly"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel); midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel);
@ -838,7 +838,7 @@ void handleSongSelect_MIDI_DEVICE_USB_HOST(byte inSong)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] SongSelect")); Serial.print(F("[MIDI_USB_HOST] SongSelect"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSongSelect(inSong); midi_serial.sendSongSelect(inSong);
@ -864,7 +864,7 @@ void handleTuneRequest_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] TuneRequest")); Serial.print(F("[MIDI_USB_HOST] TuneRequest"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendTuneRequest(); midi_serial.sendTuneRequest();
@ -890,7 +890,7 @@ void handleClock_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] Clock")); Serial.print(F("[MIDI_USB_HOST] Clock"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Clock); midi_serial.sendRealTime(midi::Clock);
@ -916,7 +916,7 @@ void handleStart_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] Start")); Serial.print(F("[MIDI_USB_HOST] Start"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Start); midi_serial.sendRealTime(midi::Start);
@ -942,7 +942,7 @@ void handleContinue_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] Continue")); Serial.print(F("[MIDI_USB_HOST] Continue"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Continue); midi_serial.sendRealTime(midi::Continue);
@ -968,7 +968,7 @@ void handleStop_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] Stop")); Serial.print(F("[MIDI_USB_HOST] Stop"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Stop); midi_serial.sendRealTime(midi::Stop);
@ -994,7 +994,7 @@ void handleActiveSensing_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] ActiveSensing")); Serial.print(F("[MIDI_USB_HOST] ActiveSensing"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::ActiveSensing); midi_serial.sendRealTime(midi::ActiveSensing);
@ -1020,7 +1020,7 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] SystemReset")); Serial.print(F("[MIDI_USB_HOST] SystemReset"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::SystemReset); midi_serial.sendRealTime(midi::SystemReset);
@ -1046,7 +1046,7 @@ void handleSystemReset_MIDI_DEVICE_USB_HOST(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB_HOST] RealTimeSystem")); Serial.print(F("[MIDI_USB_HOST] RealTimeSystem"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(inRealTime); midi_serial.sendRealTime(inRealTime);
@ -1077,7 +1077,7 @@ void handleNoteOn_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte inVelocity
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] NoteOn")); Serial.print(F("[MIDI_USB] NoteOn"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendNoteOn(inNumber, inVelocity, inChannel); midi_serial.sendNoteOn(inNumber, inVelocity, inChannel);
@ -1103,7 +1103,7 @@ void handleNoteOff_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte inVelocit
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] NoteOff")); Serial.print(F("[MIDI_USB] NoteOff"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendNoteOff(inNumber, inVelocity, inChannel); midi_serial.sendNoteOff(inNumber, inVelocity, inChannel);
@ -1129,7 +1129,7 @@ void handleControlChange_MIDI_DEVICE_USB(byte inChannel, byte inData1, byte inDa
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] CC")); Serial.print(F("[MIDI_USB] CC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendControlChange(inData1, inData2, inChannel); midi_serial.sendControlChange(inData1, inData2, inChannel);
@ -1155,7 +1155,7 @@ void handleAfterTouch_MIDI_DEVICE_USB(byte inChannel, byte inPressure)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] AT")); Serial.print(F("[MIDI_USB] AT"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendAfterTouch(inPressure, inChannel); midi_serial.sendAfterTouch(inPressure, inChannel);
@ -1181,7 +1181,7 @@ void handlePitchBend_MIDI_DEVICE_USB(byte inChannel, int inPitch)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] PB")); Serial.print(F("[MIDI_USB] PB"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendPitchBend(inPitch, inChannel); midi_serial.sendPitchBend(inPitch, inChannel);
@ -1207,7 +1207,7 @@ void handleProgramChange_MIDI_DEVICE_USB(byte inChannel, byte inProgram)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] PC")); Serial.print(F("[MIDI_USB] PC"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendProgramChange(inProgram, inChannel); midi_serial.sendProgramChange(inProgram, inChannel);
@ -1233,7 +1233,7 @@ void handleSystemExclusive_MIDI_DEVICE_USB(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] SysEx")); Serial.print(F("[MIDI_USB] SysEx"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSysEx(len, data); midi_serial.sendSysEx(len, data);
@ -1259,7 +1259,7 @@ void handleSystemExclusive_MIDI_DEVICE_USB(byte * data, uint len)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] SysExChunk")); Serial.print(F("[MIDI_USB] SysExChunk"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSysEx(len, data, last); midi_serial.sendSysEx(len, data, last);
@ -1285,7 +1285,7 @@ void handleTimeCodeQuarterFrame_MIDI_DEVICE_USB(midi::DataByte data)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] TimeCodeQuarterFrame")); Serial.print(F("[MIDI_USB] TimeCodeQuarterFrame"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendTimeCodeQuarterFrame(data); midi_serial.sendTimeCodeQuarterFrame(data);
@ -1311,7 +1311,7 @@ void handleAfterTouchPoly_MIDI_DEVICE_USB(byte inChannel, byte inNumber, byte in
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] AT-Poly")); Serial.print(F("[MIDI_USB] AT-Poly"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel); midi_serial.sendAfterTouch(inNumber, inVelocity, inChannel);
@ -1337,7 +1337,7 @@ void handleSongSelect_MIDI_DEVICE_USB(byte inSong)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] SongSelect")); Serial.print(F("[MIDI_USB] SongSelect"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendSongSelect(inSong); midi_serial.sendSongSelect(inSong);
@ -1363,7 +1363,7 @@ void handleTuneRequest_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] TuneRequest")); Serial.print(F("[MIDI_USB] TuneRequest"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendTuneRequest(); midi_serial.sendTuneRequest();
@ -1389,7 +1389,7 @@ void handleClock_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] Clock")); Serial.print(F("[MIDI_USB] Clock"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Clock); midi_serial.sendRealTime(midi::Clock);
@ -1415,7 +1415,7 @@ void handleStart_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] Start")); Serial.print(F("[MIDI_USB] Start"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Start); midi_serial.sendRealTime(midi::Start);
@ -1441,7 +1441,7 @@ void handleContinue_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] Continue")); Serial.print(F("[MIDI_USB] Continue"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Continue); midi_serial.sendRealTime(midi::Continue);
@ -1467,7 +1467,7 @@ void handleStop_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] Stop")); Serial.print(F("[MIDI_USB] Stop"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::Stop); midi_serial.sendRealTime(midi::Stop);
@ -1493,7 +1493,7 @@ void handleActiveSensing_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] ActiveSensing")); Serial.print(F("[MIDI_USB] ActiveSensing"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::ActiveSensing); midi_serial.sendRealTime(midi::ActiveSensing);
@ -1519,7 +1519,7 @@ void handleSystemReset_MIDI_DEVICE_USB(void)
#ifdef DEBUG #ifdef DEBUG
Serial.print(F("[MIDI_USB] SystemReset")); Serial.print(F("[MIDI_USB] SystemReset"));
#endif #endif
if (configuration.soft_midi_thru == 1) if (configuration.sys.soft_midi_thru == 1)
{ {
#ifdef MIDI_DEVICE_DIN #ifdef MIDI_DEVICE_DIN
midi_serial.sendRealTime(midi::SystemReset); midi_serial.sendRealTime(midi::SystemReset);

Loading…
Cancel
Save