Started creating new performance load and removing most EEPROM function.

pull/111/head
Holger Wirtz 3 years ago
parent 29da47d19e
commit 86e695d754
  1. 149
      MicroDexed.ino
  2. 0
      PERFORMANCE/0/0-S.json
  3. 0
      PERFORMANCE/0/0-d.json
  4. 0
      PERFORMANCE/0/0-fx.json
  5. 0
      PERFORMANCE/0/0-pat.json
  6. 0
      PERFORMANCE/0/0-v0.json
  7. 0
      PERFORMANCE/0/0-v1.json
  8. 0
      PERFORMANCE/0/0-vel.json
  9. 0
      PERFORMANCE/1/1-S.json
  10. 0
      PERFORMANCE/1/1-d.json
  11. 0
      PERFORMANCE/1/1-fx.json
  12. 0
      PERFORMANCE/1/1-pat.json
  13. 0
      PERFORMANCE/1/1-v0.json
  14. 0
      PERFORMANCE/1/1-v1.json
  15. 0
      PERFORMANCE/1/1-vel.json
  16. 0
      PERFORMANCE/2/2-S.json
  17. 0
      PERFORMANCE/2/2-d.json
  18. 0
      PERFORMANCE/2/2-fx.json
  19. 0
      PERFORMANCE/2/2-pat.json
  20. 0
      PERFORMANCE/2/2-v0.json
  21. 0
      PERFORMANCE/2/2-v1.json
  22. 0
      PERFORMANCE/2/2-vel.json
  23. 0
      PERFORMANCE/3/3-S.json
  24. 0
      PERFORMANCE/3/3-d.json
  25. 0
      PERFORMANCE/3/3-fx.json
  26. 0
      PERFORMANCE/3/3-pat.json
  27. 0
      PERFORMANCE/3/3-v0.json
  28. 0
      PERFORMANCE/3/3-v1.json
  29. 0
      PERFORMANCE/3/3-vel.json
  30. 0
      PERFORMANCE/4/4-S.json
  31. 0
      PERFORMANCE/4/4-d.json
  32. 0
      PERFORMANCE/4/4-fx.json
  33. 0
      PERFORMANCE/4/4-pat.json
  34. 0
      PERFORMANCE/4/4-v0.json
  35. 0
      PERFORMANCE/4/4-v1.json
  36. 0
      PERFORMANCE/4/4-vel.json
  37. 0
      PERFORMANCE/5/5-S.json
  38. 0
      PERFORMANCE/5/5-d.json
  39. 0
      PERFORMANCE/5/5-fx.json
  40. 0
      PERFORMANCE/5/5-pat.json
  41. 0
      PERFORMANCE/5/5-v0.json
  42. 0
      PERFORMANCE/5/5-v1.json
  43. 0
      PERFORMANCE/5/5-vel.json
  44. 0
      PERFORMANCE/6/6-S.json
  45. 0
      PERFORMANCE/6/6-d.json
  46. 0
      PERFORMANCE/6/6-fx.json
  47. 0
      PERFORMANCE/6/6-pat.json
  48. 0
      PERFORMANCE/6/6-v0.json
  49. 0
      PERFORMANCE/6/6-v1.json
  50. 0
      PERFORMANCE/6/6-vel.json
  51. 0
      PERFORMANCE/7/7-S.json
  52. 0
      PERFORMANCE/7/7-d.json
  53. 0
      PERFORMANCE/7/7-fx.json
  54. 0
      PERFORMANCE/7/7-pat.json
  55. 0
      PERFORMANCE/7/7-v0.json
  56. 0
      PERFORMANCE/7/7-v1.json
  57. 0
      PERFORMANCE/7/7-vel.json
  58. 0
      PERFORMANCE/8/8-S.json
  59. 0
      PERFORMANCE/8/8-d.json
  60. 0
      PERFORMANCE/8/8-fx.json
  61. 0
      PERFORMANCE/8/8-pat.json
  62. 0
      PERFORMANCE/8/8-v0.json
  63. 0
      PERFORMANCE/8/8-v1.json
  64. 0
      PERFORMANCE/8/8-vel.json
  65. 313
      UI.hpp
  66. 7
      UI_FX.h
  67. 7
      UI_FX_T4.h
  68. 7
      UI_NO_FX.h
  69. 97
      addon/FeedbackDelay.cpp
  70. 0
      addon/test.mid
  71. 0
      addon/tools/tx_edit.c
  72. 0
      addon/tools/wav2sketch
  73. 0
      addon/tools/wav2sketch.c
  74. 13
      config.h
  75. 56
      dexed_sd.cpp

@ -562,6 +562,10 @@ void setup()
}
}
// Start timer (to avoid a crash when loading the performance)
timer1.begin(sequencer, seq_tempo_ms / 2, false);
// Load initial Performance or the last used one
initial_values_from_eeprom(false);
#ifdef DISPLAY_LCD_SPI
@ -578,7 +582,7 @@ void setup()
Serial.print(F("Dexed instance "));
Serial.print(instance_id);
Serial.println(F(":"));
Serial.print(F("Bank/Voice from EEPROM ["));
Serial.print(F("Bank/Voice ["));
Serial.print(configuration.performance.bank[instance_id], DEC);
Serial.print(F("/"));
Serial.print(configuration.performance.voice[instance_id], DEC);
@ -645,7 +649,6 @@ void setup()
strcpy(seq_name, "INIT Perf");
LCDML.OTHER_jumpToFunc(UI_func_voice_select);
timer1.begin(sequencer, seq_tempo_ms / 2, false);
}
void loop()
@ -1714,6 +1717,7 @@ void dac_unmute(void)
sgtl5000.dacVolume(1.0);
sgtl5000.volume(SGTL5000_HEADPHONE_VOLUME, SGTL5000_HEADPHONE_VOLUME); // Headphone volume
}
void handleStart(void)
{
midi_bpm_timer = 0;
@ -1877,57 +1881,34 @@ void initial_values_from_eeprom(bool init)
init_configuration();
else
{
_m_ = (EEPROM[EEPROM_START_ADDRESS + offsetof(configuration_s, _marker_)] << 8) | EEPROM[EEPROM_START_ADDRESS + offsetof(configuration_s, _marker_) + 1];
_m_ = (EEPROM[EEPROM_START_ADDRESS] << 8) | EEPROM[EEPROM_START_ADDRESS + 1];
if (_m_ != EEPROM_MARKER)
{
#ifdef DEBUG
Serial.println(F("Found wrong EEPROM marker, initializing EEPROM..."));
#endif
configuration._marker_ = EEPROM_MARKER;
init_configuration();
load_sd_seq_json(PERFORMANCE_NUM_MIN);
}
else
{
uint8_t eeprom_performance = EEPROM[EEPROM_START_ADDRESS + 2];
#ifdef DEBUG
Serial.println(F("Loading initial system data from EEPROM."));
Serial.print(F("Loading initial system data from performance "));
Serial.println(eeprom_performance, DEC);
#endif
eeprom_get_performance();
eeprom_get_sys();
eeprom_get_fx();
for (uint8_t i = 0; i < NUM_DEXED; i++)
{
eeprom_get_dexed(i);
load_sd_seq_json(eeprom_performance);
}
#ifdef DEBUG
Serial.println(F("OK, loaded!"));
#endif
check_configuration();
}
/*
#ifdef DEBUG
Serial.print(F("Loading performance "));
Serial.print(configuration.sys.performance_number, DEC);
Serial.print(F(": "));
if (load_sd_seq_json(configuration.sys.performance_number) == true)
Serial.println(F("OK"));
else
Serial.println(F("ERROR"));
#else
load_sd_seq_json(configuration.sys.performance_number);
#endif
*/
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{
set_voiceconfig_params(instance_id);
}
set_fx_params();
set_sys_params();
set_volume(configuration.sys.vol, configuration.sys.mono);
#ifdef DEBUG
show_configuration();
#endif
@ -2123,105 +2104,9 @@ void init_configuration(void)
void eeprom_update(void)
{
uint8_t* c = (uint8_t*)&configuration;
for (uint16_t i = 0; i < sizeof(configuration); i++)
EEPROM.update(EEPROM_START_ADDRESS + i, c[i]);
}
void eeprom_update_sys(void)
{
uint8_t* c = (uint8_t*)&configuration.sys;
for (uint16_t i = 0; i < sizeof(configuration.sys); i++)
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys) + i, c[i]);
#ifdef DEBUG
Serial.println(F("Updating EEPROM sys."));
#endif
}
bool eeprom_get_sys(void)
{
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, sys), configuration.sys);
return (true);
}
void eeprom_update_fx(void)
{
uint8_t* c = (uint8_t*)&configuration.fx;
for (uint16_t i = 0; i < sizeof(configuration.fx); i++)
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx) + i, c[i]);
#ifdef DEBUG
Serial.println(F("Updating EEPROM fx."));
#endif
}
bool eeprom_get_fx(void)
{
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, fx), configuration.fx);
return (true);
}
void eeprom_update_dexed(uint8_t instance_id)
{
#if NUM_DEXED == 1
uint8_t* c = (uint8_t*)&configuration.dexed[0];
for (uint16_t i = 0; i < sizeof(configuration.dexed[0]); i++)
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0]) + i, c[i]);
#else
uint8_t* c;
if (instance_id == 0)
c = (uint8_t*)&configuration.dexed[0];
else
c = (uint8_t*)&configuration.dexed[1];
for (uint16_t i = 0; i < sizeof(configuration.dexed[instance_id]); i++)
{
if (instance_id == 0)
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0]) + i, c[i]);
else
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1]) + i, c[i]);
}
#endif
#ifdef DEBUG
Serial.print(F("Updating EEPROM dexed (instance "));
Serial.print(instance_id);
Serial.println(F(")."));
#endif
}
bool eeprom_get_dexed(uint8_t instance_id)
{
for (uint8_t instance_id = 0; instance_id < MAX_DEXED; instance_id++)
{
if (instance_id == 0)
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0]), configuration.dexed[0]);
else
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1]), configuration.dexed[1]);
}
return (true);
}
void eeprom_update_performance()
{
EEPROM.put(EEPROM_START_ADDRESS + offsetof(configuration_s, performance), configuration.performance);
#ifdef DEBUG
Serial.println(F("Updating EEPROM performance."));
#endif
}
bool eeprom_get_performance()
{
EEPROM.get(EEPROM_START_ADDRESS + offsetof(configuration_s, performance), configuration.performance);
#ifdef DEBUG
Serial.println(F("Getting EEPROM performance."));
#endif
return (true);
EEPROM.update(EEPROM_START_ADDRESS, (EEPROM_MARKER & 0xff00) >> 8);
EEPROM.update(EEPROM_START_ADDRESS + 1, EEPROM_MARKER & 0xff);
EEPROM.update(EEPROM_START_ADDRESS + 2, configuration.sys.performance_number);
}
/******************************************************************************

313
UI.hpp

@ -59,12 +59,7 @@ extern config_t configuration;
extern void set_volume(uint8_t v, uint8_t m);
extern bool load_sysex(uint8_t b, uint8_t v);
extern void generate_version_string(char* buffer, uint8_t len);
extern void initial_values_from_eeprom(bool init);
extern void _softRestart(void);
extern void eeprom_update_sys(void);
extern void eeprom_update_performance(void);
extern void eeprom_update_fx(void);
extern void eeprom_update_dexed(uint8_t instance_id);
//extern float pseudo_log_curve(float value);
extern float midi_volume_transform(uint8_t midi_amp);
extern float volume_transform(float amp);
@ -321,7 +316,6 @@ void UI_func_drum_midi_channel(uint8_t param);
void UI_func_load_performance(uint8_t param);
void UI_func_save_performance(uint8_t param);
void UI_func_save_voice(uint8_t param);
void UI_func_eeprom_reset(uint8_t param);
void UI_func_midi_soft_thru(uint8_t param);
void UI_func_velocity_level(uint8_t param);
void UI_func_voice_select(uint8_t param);
@ -350,7 +344,6 @@ void lcd_display_meter_float(const char* title, float value, float factor, float
void lcd_active_instance_number(uint8_t instance_id);
void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op);
void lcd_special_chars(uint8_t mode);
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string);
void lcd_display_delay_sync(uint8_t sync);
void string_trim(char *s);
void save_favorite(uint8_t b, uint8_t v, uint8_t instance_id);
@ -1128,7 +1121,6 @@ void UI_func_reverb_roomsize(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_roomsize), configuration.fx.reverb_roomsize);
}
}
@ -1162,7 +1154,6 @@ void UI_func_reverb_damping(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_damping), configuration.fx.reverb_damping);
}
}
#else
@ -1195,7 +1186,6 @@ void UI_func_reverb_lowpass(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_lowpass), configuration.fx.reverb_lowpass);
}
}
@ -1228,7 +1218,6 @@ void UI_func_reverb_lodamp(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_lodamp), configuration.fx.reverb_lodamp);
}
}
@ -1261,7 +1250,6 @@ void UI_func_reverb_hidamp(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_hidamp), configuration.fx.reverb_hidamp);
}
}
@ -1294,7 +1282,6 @@ void UI_func_reverb_diffusion(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_diffusion), configuration.fx.reverb_diffusion);
}
}
#endif // PLATEREVERB != 1
@ -1331,7 +1318,6 @@ void UI_func_reverb_level(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_level), configuration.fx.reverb_level);
}
}
@ -1374,10 +1360,6 @@ void UI_func_chorus_frequency(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_frequency[0]), configuration.fx.chorus_frequency[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_frequency[1]), configuration.fx.chorus_frequency[1]);
#endif
}
}
@ -1431,10 +1413,6 @@ void UI_func_chorus_waveform(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_waveform[0]), configuration.fx.chorus_waveform[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_waveform[1]), configuration.fx.chorus_waveform[1]);
#endif
}
}
@ -1478,10 +1456,6 @@ void UI_func_chorus_depth(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_depth[0]), configuration.fx.chorus_depth[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_depth[1]), configuration.fx.chorus_depth[1]);
#endif
}
}
@ -1534,10 +1508,6 @@ void UI_func_chorus_level(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_level[0]), configuration.fx.chorus_level[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.chorus_level[1]), configuration.fx.chorus_level[1]);
#endif
}
}
@ -1631,12 +1601,6 @@ void UI_func_delay_time(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_time[0]), configuration.fx.delay_time[0]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_sync[0]), configuration.fx.delay_sync[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_time[1]), configuration.fx.delay_time[1]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_sync[1]), configuration.fx.delay_sync[1]);
#endif
}
}
@ -1686,10 +1650,6 @@ void UI_func_delay_feedback(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_feedback[0]), configuration.fx.delay_feedback[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_feedback[1]), configuration.fx.delay_feedback[1]);
#endif
}
}
@ -1739,10 +1699,6 @@ void UI_func_delay_level(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_level[0]), configuration.fx.delay_level[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.delay_level[1]), configuration.fx.delay_level[1]);
#endif
}
}
@ -1793,10 +1749,6 @@ void UI_func_reverb_send(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_send[0]), configuration.fx.reverb_send[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.reverb_send[1]), configuration.fx.reverb_send[1]);
#endif
}
}
@ -1846,10 +1798,6 @@ void UI_func_filter_cutoff(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.filter_cutoff[0]), configuration.fx.filter_cutoff[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.filter_cutoff[1]), configuration.fx.filter_cutoff[1]);
#endif
}
}
@ -1899,10 +1847,6 @@ void UI_func_filter_resonance(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.filter_resonance[0]), configuration.fx.filter_resonance[0]);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.filter_resonance[1]), configuration.fx.filter_resonance[1]);
#endif
}
}
#endif
@ -1949,10 +1893,6 @@ void UI_func_transpose(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].transpose), configuration.dexed[0].transpose);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].transpose), configuration.dexed[1].transpose);
#endif
}
}
@ -2003,10 +1943,6 @@ void UI_func_tune(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].tune), configuration.dexed[0].tune);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].tune), configuration.dexed[1].tune);
#endif
}
}
@ -2052,12 +1988,7 @@ void UI_func_midi_channel(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].midi_channel), configuration.dexed[0].midi_channel);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].midi_channel), configuration.dexed[1].midi_channel);
#endif
}
}
@ -2116,12 +2047,7 @@ void UI_func_lowest_note(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].lowest_note), configuration.dexed[0].lowest_note);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].lowest_note), configuration.dexed[1].lowest_note);
#endif
}
}
@ -2171,12 +2097,7 @@ void UI_func_highest_note(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].highest_note), configuration.dexed[0].highest_note);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].highest_note), configuration.dexed[1].highest_note);
#endif
}
}
@ -2228,10 +2149,6 @@ void UI_func_sound_intensity(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].sound_intensity), configuration.dexed[0].sound_intensity);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].sound_intensity), configuration.dexed[1].sound_intensity);
#endif
}
}
@ -2288,10 +2205,6 @@ void UI_func_panorama(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].pan), configuration.dexed[0].pan);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].pan), configuration.dexed[1].pan);
#endif
}
}
@ -2347,10 +2260,7 @@ void UI_func_favorites(uint8_t param)
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
encoderDir[ENC_L].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys.favorites), configuration.sys.favorites);
}
}
@ -2415,10 +2325,7 @@ void UI_func_stereo_mono(uint8_t param)
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys.mono), configuration.sys.mono);
}
}
void UI_func_polyphony(uint8_t param)
@ -2486,10 +2393,6 @@ void UI_func_polyphony(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].polyphony), configuration.dexed[0].polyphony);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].polyphony), configuration.dexed[1].polyphony);
#endif
}
}
@ -2543,12 +2446,7 @@ void UI_func_mono_poly(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].monopoly), configuration.dexed[0].monopoly);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].monopoly), configuration.dexed[1].monopoly);
#endif
}
}
@ -2600,12 +2498,7 @@ void UI_func_note_refresh(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].note_refresh), configuration.dexed[0].note_refresh);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].note_refresh), configuration.dexed[1].note_refresh);
#endif
}
}
@ -2650,10 +2543,6 @@ void UI_func_pb_range(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].pb_range), configuration.dexed[0].pb_range);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].pb_range), configuration.dexed[1].pb_range);
#endif
}
}
@ -2698,10 +2587,6 @@ void UI_func_pb_step(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].pb_step), configuration.dexed[0].pb_step);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].pb_step), configuration.dexed[1].pb_step);
#endif
}
}
@ -2746,10 +2631,6 @@ void UI_func_mw_range(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].mw_range), configuration.dexed[0].mw_range);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].mw_range), configuration.dexed[1].mw_range);
#endif
}
}
@ -2821,10 +2702,6 @@ void UI_func_mw_assign(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].mw_assign), configuration.dexed[0].mw_assign);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].mw_assign), configuration.dexed[1].mw_assign);
#endif
}
}
@ -2881,10 +2758,6 @@ void UI_func_mw_mode(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].mw_mode), configuration.dexed[0].mw_mode);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].mw_mode), configuration.dexed[1].mw_mode);
#endif
}
}
@ -2929,10 +2802,6 @@ void UI_func_fc_range(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].fc_range), configuration.dexed[0].fc_range);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].fc_range), configuration.dexed[1].fc_range);
#endif
}
}
@ -3004,10 +2873,6 @@ void UI_func_fc_assign(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].fc_assign), configuration.dexed[0].fc_assign);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].fc_assign), configuration.dexed[1].fc_assign);
#endif
}
}
@ -3064,10 +2929,6 @@ void UI_func_fc_mode(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].fc_mode), configuration.dexed[0].fc_mode);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].fc_mode), configuration.dexed[1].fc_mode);
#endif
}
}
@ -3112,10 +2973,6 @@ void UI_func_bc_range(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].bc_range), configuration.dexed[0].bc_range);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].bc_range), configuration.dexed[1].bc_range);
#endif
}
}
@ -3187,10 +3044,6 @@ void UI_func_bc_assign(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].bc_assign), configuration.dexed[0].bc_assign);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].bc_assign), configuration.dexed[1].bc_assign);
#endif
}
}
@ -3247,10 +3100,6 @@ void UI_func_bc_mode(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].bc_mode), configuration.dexed[0].bc_mode);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].bc_mode), configuration.dexed[1].bc_mode);
#endif
}
}
@ -3295,10 +3144,6 @@ void UI_func_at_range(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].at_range), configuration.dexed[0].at_range);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].at_range), configuration.dexed[1].at_range);
#endif
}
}
@ -3370,10 +3215,6 @@ void UI_func_at_assign(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].at_assign), configuration.dexed[0].at_assign);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].at_assign), configuration.dexed[1].at_assign);
#endif
}
}
@ -3430,10 +3271,6 @@ void UI_func_at_mode(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].at_mode), configuration.dexed[0].at_mode);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].at_mode), configuration.dexed[1].at_mode);
#endif
}
}
@ -3493,10 +3330,6 @@ void UI_func_portamento_mode(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].portamento_mode), configuration.dexed[0].portamento_mode);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].portamento_mode), configuration.dexed[1].portamento_mode);
#endif
}
}
@ -3550,10 +3383,6 @@ void UI_func_portamento_glissando(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].portamento_glissando), configuration.dexed[0].portamento_glissando);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].portamento_glissando), configuration.dexed[1].portamento_glissando);
#endif
}
}
@ -3598,10 +3427,6 @@ void UI_func_portamento_time(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].portamento_time), configuration.dexed[0].portamento_time);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].portamento_time), configuration.dexed[1].portamento_time);
#endif
}
}
@ -3677,12 +3502,7 @@ void UI_handle_OP(uint8_t param)
lcd.noBlink();
lcd.noCursor();
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].op_enabled), configuration.dexed[0].op_enabled);
#if NUM_DEXED > 1
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].op_enabled), configuration.dexed[1].op_enabled);
#endif
}
}
@ -3802,10 +3622,7 @@ void UI_func_drum_midi_channel(uint8_t param)
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
encoderDir[ENC_R].reset();
// EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].midi_channel), configuration.dexed[0].midi_channel); }
}
}
void UI_func_drums_main_volume(uint8_t param)
{
@ -6627,10 +6444,7 @@ void UI_func_midi_soft_thru(uint8_t param)
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys.soft_midi_thru), configuration.sys.soft_midi_thru);
}
}
void UI_func_smart_filter(uint8_t param)
@ -6698,79 +6512,6 @@ void UI_func_velocity_level(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
if (selected_instance_id == 0)
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[0].velocity_level), configuration.dexed[0].velocity_level);
#if NUM_DEXED > 1
else
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, dexed[1].velocity_level), configuration.dexed[1].velocity_level);
#endif
}
}
void UI_func_eeprom_reset(uint8_t param)
{
static bool yesno = false;
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
encoderDir[ENC_R].reset();
// setup function
lcd.print("Reset EEPROM?");
lcd.setCursor(0, 1);
lcd.print("[NO ]");
}
if (LCDML.FUNC_loop()) // ****** LOOP *********
{
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()))
{
if (LCDML.BT_checkDown())
yesno = true;
else if (LCDML.BT_checkUp())
yesno = false;
else if (LCDML.BT_checkEnter())
{
if (yesno == true)
{
LCDML.DISP_clear();
lcd.print("EEPROM Reset");
initial_values_from_eeprom(true);
lcd.setCursor(0, 1);
lcd.print("Done.");
delay(MESSAGE_WAIT_TIME);
_softRestart();
}
else
{
lcd.setCursor(0, 1);
lcd.print("Canceled.");
delay(MESSAGE_WAIT_TIME);
LCDML.FUNC_goBackToMenu();
}
}
if (yesno == true)
{
lcd.setCursor(1, 1);
lcd.print("YES");
}
else
{
lcd.setCursor(1, 1);
lcd.print("NO ");
}
}
}
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd.setCursor(0, 1);
lcd.print("Canceled.");
delay(MESSAGE_WAIT_TIME);
encoderDir[ENC_R].reset();
}
}
@ -7097,29 +6838,14 @@ void UI_func_voice_select(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
if (selected_instance_id == 0)
{
//eeprom_update_var(offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[0], "configuration.performance.voice[0]");
//eeprom_update_var(offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[0], "configuration.performance.bank[0]");
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[0]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[0]);
}
#if NUM_DEXED > 1
else
{
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[1]), configuration.performance.voice[1]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[1]), configuration.performance.bank[1]);
}
#endif
}
}
void UI_func_volume(uint8_t param)
{
char tmp[6];
if (LCDML.FUNC_setup()) // ****** SETUP *********
{
@ -7283,11 +7009,10 @@ void UI_func_volume(uint8_t param)
if (LCDML.FUNC_close()) // ****** STABLE END *********
{
lcd_special_chars(SCROLLBAR);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys.vol), configuration.sys.vol);
encoderDir[ENC_L].reset();
}
EEPROM.update(EEPROM_START_ADDRESS + 3, configuration.sys.vol);
}
}
void UI_func_save_voice(uint8_t param)
@ -7454,21 +7179,6 @@ void UI_func_save_voice(uint8_t param)
lcd.show(1, 0, 16, "Canceled.");
delay(MESSAGE_WAIT_TIME);
}
else
{
if (selected_instance_id == 0)
{
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[0]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[0]);
}
#if NUM_DEXED > 1
else
{
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voice[0]), configuration.performance.voice[1]);
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.bank[0]), configuration.performance.bank[1]);
}
#endif
}
encoderDir[ENC_R].reset();
}
}
@ -8012,7 +7722,6 @@ void UI_func_eq_1(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_1), configuration.fx.eq_1);
}
#endif
}
@ -8060,7 +7769,6 @@ void UI_func_eq_2(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_2), configuration.fx.eq_2);
}
#endif
}
@ -8108,7 +7816,6 @@ void UI_func_eq_3(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_3), configuration.fx.eq_3);
}
#endif
}
@ -8156,7 +7863,6 @@ void UI_func_eq_4(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_4), configuration.fx.eq_4);
}
#endif
}
@ -8204,7 +7910,6 @@ void UI_func_eq_5(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_5), configuration.fx.eq_5);
}
#endif
}
@ -8252,7 +7957,6 @@ void UI_func_eq_6(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_6), configuration.fx.eq_6);
}
#endif
}
@ -8300,7 +8004,6 @@ void UI_func_eq_7(uint8_t param)
{
lcd_special_chars(SCROLLBAR);
encoderDir[ENC_R].reset();
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, fx.eq_7), configuration.fx.eq_7);
}
#endif
}
@ -8876,16 +8579,6 @@ void lcd_display_delay_sync(uint8_t sync)
}
#endif
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string)
{
#ifdef DEBUG
char tmp[80];
sprintf(tmp, "EEPROM update '%s' at position %d with value %d.", val_string, pos, val);
Serial.println(tmp);
#endif
EEPROM.update(EEPROM_START_ADDRESS + pos, val);
}
void string_trim(char *s)
{
int i;

@ -132,8 +132,7 @@ LCDML_add(98, LCDML_0, 6, "System", NULL);
LCDML_add(99, LCDML_0_6, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(100, LCDML_0_6, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(101, LCDML_0_6, 3, "Favorites", UI_func_favorites);
LCDML_add(102, LCDML_0_6, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(103, LCDML_0, 7, "Info", UI_func_information);
LCDML_addAdvanced(104, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 104
LCDML_add(102, LCDML_0, 7, "Info", UI_func_information);
LCDML_addAdvanced(103, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 103
#endif

@ -140,8 +140,7 @@ LCDML_add(106, LCDML_0, 5, "System", NULL);
LCDML_add(107, LCDML_0_5, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(108, LCDML_0_5, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(109, LCDML_0_5, 3, "Favorites", UI_func_favorites);
LCDML_add(110, LCDML_0_5, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(111, LCDML_0, 6, "Info", UI_func_information);
LCDML_addAdvanced(112, LCDML_0, 7, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 112
LCDML_add(110, LCDML_0, 6, "Info", UI_func_information);
LCDML_addAdvanced(111, LCDML_0, 7, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 111
#endif

@ -106,8 +106,7 @@ LCDML_add(72, LCDML_0, 5, "System", NULL);
LCDML_add(73, LCDML_0_5, 1, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(74, LCDML_0_5, 2, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(75, LCDML_0_5, 3, "Favorites", UI_func_favorites);
LCDML_add(76, LCDML_0_5, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(77, LCDML_0, 6, "Info", UI_func_information);
LCDML_addAdvanced(78, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 78
LCDML_add(76, LCDML_0, 6, "Info", UI_func_information);
LCDML_addAdvanced(77, LCDML_0, 8, COND_hide, "Volume", UI_func_volume, 0, _LCDML_TYPE_default);
#define _LCDML_DISP_cnt 77
#endif

@ -1,97 +0,0 @@
// http://digitalmedia.risd.edu/pbadger/PhysComp/index.php?n=Devices.CombinedFilterAndFeedbackDelayCodeFromTheTutorials
/* Filter combined with Feedback (Echo) Delay from the
Teensy Audio Library examples. Check the pins you use
on pots. Inputs to the mixer are on inputs 0 (signal) and 1 (delay line)
*/
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioPlaySdWav playSdWav1; //xy=192,121
AudioFilterStateVariable filter1; //xy=396,132
AudioMixer4 mixer1; //xy=584,134
AudioEffectDelay delay1; //xy=598,313
AudioOutputI2S i2s1; //xy=799,289
AudioConnection patchCord1(playSdWav1, 0, filter1, 0);
AudioConnection patchCord2(filter1, 1, mixer1, 0); // filter 1, 1 is bandbass -
// try filter 1, 0 for high pass
// try filter 1, 2 for high pass
AudioConnection patchCord3(mixer1, delay1);
AudioConnection patchCord4(delay1, 0, mixer1, 1);
AudioConnection patchCord5(delay1, 0, i2s1, 0);
AudioConnection patchCord6(delay1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=597,539
// GUItool: end automatically generated code
#include <Bounce.h>
Bounce button0 = Bounce(17, 5);
float freq ;
int knob2;
void setup() {
Serial.begin(57600); // you may have to set serial monitor to higher speed
pinMode(0, INPUT_PULLUP);
AudioMemory(200);
sgtl5000_1.enable();
sgtl5000_1.volume(0.55);
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
SPI.setMOSI(7);
SPI.setSCK(14);
if (!(SD.begin(10))) {
while (1) {
Serial.println("Unable to access the SD card");
delay(500);
}
}
mixer1.gain(0, 0.7);
mixer1.gain(1, 0.7);
delay1.delay(0, 400);
filter1.resonance(2.5); // values between 0.7 and 5.0 useful
delay(1000);
}
void loop() {
// uncomment for A3 knob to control the feedback level
if (playSdWav1.isPlaying() == false) {
Serial.println("Start playing");
playSdWav1.play("SDTEST1.WAV");
delay(20); // wait for library to parse WAV info
}
int knob = analogRead(16);
float feedback = (float)knob / 1050.0;
mixer1.gain(1, feedback);
Serial.println(feedback);
// uncomment for pin 0 button to double the feedback (allowing unstable)
/*
button0.update();
if (button0.read() == LOW) {
mixer1.gain(1, feedback * 2.0);
}
*/
// read the knob and adjust the filter frequency
knob2 = analogRead(A1) + 20;
// quick and dirty equation for exp scale frequency adjust
freq = expf((float)knob2 / 150.0) * 20.0 + 80.0;
filter1.frequency(freq);
/* //uncomment for freq debug
Serial.print(knob2);
Serial.print("\t");
Serial.print("freq = ");
Serial.println(freq);
delay(5); */
}

@ -323,8 +323,8 @@
#define FAV_CONFIG_PATH "FAVCFG"
#define FAV_CONFIG_NAME "FAVCFG"
#define SEQ_CONFIG_PATH "SEQ"
#define SEQ_CONFIG_NAME "SEQ"
#define SEQ_CONFIG_PATH "PERFORMANCE"
#define SEQ_CONFIG_NAME "PERFORMANCE"
#define DRUM_CONFIG_PATH "DRM"
#define DRUM_CONFIG_NAME "DRM"
@ -626,7 +626,7 @@
#define PERFORMANCE_NUM_MIN 0
#define PERFORMANCE_NUM_MAX MAX_PERFORMANCE
#define PERFORMANCE_NUM_DEFAULT -1
#define PERFORMANCE_NUM_DEFAULT 0
#define FX_NUM_MIN 0
#define FX_NUM_MAX MAX_FX
@ -665,8 +665,8 @@
#define EQ_7_DEFAULT 15
// Buffer-size define for load/save configuration as JSON
#define JSON_BUFFER_SIZE 8192
//#define JSON_BUFFER_SIZE 8192
#define JSON_BUFFER_SIZE 16384
// Internal configuration structure
typedef struct dexed_s {
@ -741,7 +741,7 @@ typedef struct sys_s {
uint8_t vol;
uint8_t mono;
uint8_t soft_midi_thru;
int8_t performance_number;
uint8_t performance_number;
uint8_t favorites;
} sys_t;
@ -750,7 +750,6 @@ typedef struct configuration_s {
fx_t fx;
performance_t performance;
dexed_t dexed[MAX_DEXED];
uint16_t _marker_;
} config_t;
#if !defined(_MAPFLOAT)

@ -467,9 +467,10 @@ bool load_sd_drumsettings_json(uint8_t number, uint8_t target)
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
if (target == 0)
sprintf(filename, "/%s/%s%d.json", DRUM_CONFIG_PATH, DRUM_CONFIG_NAME, number);
sprintf(filename, "/%s/%d/%s%d.json", DRUM_CONFIG_PATH, number, DRUM_CONFIG_NAME, number);
else
sprintf(filename, "/%s/%d-d.json", SEQ_CONFIG_PATH, number);
sprintf(filename, "/%s/%d/%d-d.json", SEQ_CONFIG_PATH, number, number);
// first check if file exists...
AudioNoInterrupts();
if (SD.exists(filename))
@ -545,9 +546,9 @@ bool save_sd_drumsettings_json(uint8_t number, uint8_t target)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
if (target == 0)
sprintf(filename, "/%s/%s%d.json", DRUM_CONFIG_PATH, DRUM_CONFIG_NAME, number);
sprintf(filename, "/%s/%d/%s%d.json", DRUM_CONFIG_PATH, number, DRUM_CONFIG_NAME, number);
else
sprintf(filename, "/%s/%d-d.json", SEQ_CONFIG_PATH, number);
sprintf(filename, "/%s/%d/%d-d.json", SEQ_CONFIG_PATH, number, number);
#ifdef DEBUG
Serial.print(F("Saving drums config "));
Serial.print(number);
@ -612,9 +613,9 @@ bool load_sd_voiceconfig_json(uint8_t vc, uint8_t instance_id, uint8_t target)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
if (target == 0)
sprintf(filename, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, vc);
sprintf(filename, "/%s/%d/%s%d.json", VOICE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, vc);
else
sprintf(filename, "/%s/%d-v%d.json", SEQ_CONFIG_PATH, vc, instance_id);
sprintf(filename, "/%s/%d/%d-v%d.json", SEQ_CONFIG_PATH, vc, vc, instance_id);
// first check if file exists...
AudioNoInterrupts();
if (SD.exists(filename))
@ -706,9 +707,9 @@ bool save_sd_voiceconfig_json(uint8_t vc, uint8_t instance_id, uint8_t target)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
if (target == 0)
sprintf(filename, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, vc);
sprintf(filename, "/%s/%d/%s%d.json", VOICE_CONFIG_PATH, vc, VOICE_CONFIG_NAME, vc);
else
sprintf(filename, "/%s/%d-v%d.json", SEQ_CONFIG_PATH, vc, instance_id);
sprintf(filename, "/%s/%d/%d-v%d.json", SEQ_CONFIG_PATH, vc, vc, instance_id);
#ifdef DEBUG
Serial.print(F("Saving voice config "));
Serial.print(vc);
@ -798,9 +799,9 @@ bool load_sd_fx_json(uint8_t fx, uint8_t target)
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
if (target == 0)
sprintf(filename, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, fx);
sprintf(filename, "/%s/%d/%s%d.json", FX_CONFIG_PATH, fx, FX_CONFIG_NAME, fx);
else
sprintf(filename, "/%s/%d-fx.json", SEQ_CONFIG_PATH, fx);
sprintf(filename, "/%s/%d/%d-fx.json", SEQ_CONFIG_PATH, fx, fx);
// first check if file exists...
AudioNoInterrupts();
if (SD.exists(filename))
@ -895,9 +896,9 @@ bool save_sd_fx_json(uint8_t fx, uint8_t target)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
if (target == 0)
sprintf(filename, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, fx);
sprintf(filename, "/%s/%d/%s%d.json", FX_CONFIG_PATH, fx, FX_CONFIG_NAME, fx);
else
sprintf(filename, "/%s/%d-fx.json", SEQ_CONFIG_PATH, fx);
sprintf(filename, "/%s/%d/%d-fx.json", SEQ_CONFIG_PATH, fx, fx);
#ifdef DEBUG
Serial.print(F("Saving fx config "));
Serial.print(fx);
@ -973,7 +974,7 @@ bool save_sd_seq_sub_vel_json(uint8_t seq_number)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%d-vel.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-vel.json", SEQ_CONFIG_PATH, seq_number, seq_number);
#ifdef DEBUG
Serial.print(F("Saving sequencer velocity "));
Serial.print(seq_number);
@ -1028,7 +1029,7 @@ bool save_sd_seq_sub_patterns_json(uint8_t seq_number)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%d-pat.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-pat.json", SEQ_CONFIG_PATH, seq_number, seq_number);
#ifdef DEBUG
Serial.print(F("Saving sequencer patterns "));
Serial.print(seq_number);
@ -1088,7 +1089,7 @@ bool save_sd_seq_json(uint8_t seq_number)
AudioNoInterrupts();
save_sd_seq_sub_vel_json(seq_number);
save_sd_seq_sub_patterns_json(seq_number);
sprintf(filename, "/%s/%d-fx.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-fx.json", SEQ_CONFIG_PATH, seq_number, seq_number);
#ifdef DEBUG
Serial.print(F("write SEQ-FX-Config "));
Serial.print(seq_number);
@ -1096,7 +1097,7 @@ bool save_sd_seq_json(uint8_t seq_number)
#endif
save_sd_fx_json(seq_number, 1);
for (uint8_t i = 0; i < MAX_DEXED; i++)
{ sprintf(filename, "/%s/%d-v%d.json", SEQ_CONFIG_PATH, seq_number, i);
{ sprintf(filename, "/%s/%d/%d-v%d.json", SEQ_CONFIG_PATH, seq_number, seq_number, i);
#ifdef DEBUG
Serial.print(F("Write Voice-Config for sequencer"));
Serial.print(filename);
@ -1108,7 +1109,7 @@ bool save_sd_seq_json(uint8_t seq_number)
{
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
sprintf(filename, "/%s/%d-S.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-S.json", SEQ_CONFIG_PATH, seq_number, seq_number);
#ifdef DEBUG
Serial.print(F("Saving sequencer config "));
Serial.print(seq_number);
@ -1204,7 +1205,7 @@ void get_sd_seq_name_json(uint8_t seq_number)
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%d-S.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-S.json", SEQ_CONFIG_PATH, seq_number, seq_number);
// first check if file exists...
AudioNoInterrupts();
@ -1241,7 +1242,7 @@ bool load_sd_seq_sub_vel_json(uint8_t seq_number)
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%d-vel.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-vel.json", SEQ_CONFIG_PATH, seq_number, seq_number);
// first check if file exists...
AudioNoInterrupts();
@ -1309,7 +1310,7 @@ bool load_sd_seq_sub_patterns_json(uint8_t seq_number)
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%d-pat.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-pat.json", SEQ_CONFIG_PATH, seq_number, seq_number);
// first check if file exists...
AudioNoInterrupts();
@ -1380,8 +1381,8 @@ bool load_sd_seq_json(uint8_t seq_number)
}
dac_mute();
handleStop();
AudioNoInterrupts();
seq_number = constrain(seq_number, 0, 99);
AudioNoInterrupts();
load_sd_seq_sub_patterns_json(seq_number);
load_sd_seq_sub_vel_json(seq_number);
load_sd_fx_json(seq_number, 1);
@ -1391,7 +1392,7 @@ bool load_sd_seq_json(uint8_t seq_number)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%d-S.json", SEQ_CONFIG_PATH, seq_number);
sprintf(filename, "/%s/%d/%d-S.json", SEQ_CONFIG_PATH, seq_number, seq_number);
// first check if file exists...
if (SD.exists(filename))
{
@ -1519,10 +1520,9 @@ bool check_sd_seq_exists(uint8_t number)
{
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%d-S.json", SEQ_CONFIG_PATH, number);
sprintf(filename, "/%s/%d/%d-S.json", SEQ_CONFIG_PATH, number, number);
// check if file exists...
if (SD.exists(filename))
{
AudioInterrupts();
@ -1532,8 +1532,10 @@ bool check_sd_seq_exists(uint8_t number)
AudioInterrupts();
return (false);
}
} else
{ AudioInterrupts();
}
else
{
AudioInterrupts();
return (false);
}
}
@ -1552,7 +1554,7 @@ bool load_sd_performance_json(uint8_t p)
File json;
StaticJsonDocument<JSON_BUFFER_SIZE> data_json;
char filename[FILENAME_LEN];
sprintf(filename, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, p);
sprintf(filename, "/%s/%d/%s%d.json", PERFORMANCE_CONFIG_PATH, p, PERFORMANCE_CONFIG_NAME, p);
// first check if file exists...
AudioNoInterrupts();
if (SD.exists(filename))

Loading…
Cancel
Save