Fixing a bug when changing parameters for a selected instance.

Order of showing configuration parameters changed.
pull/15/head
Holger Wirtz 5 years ago
parent 8abae42e61
commit 6ec82dc0ee
  1. 80
      MicroDexed.ino
  2. 45
      UI.hpp
  3. 27
      config.h

@ -1093,9 +1093,11 @@ void initial_values_from_eeprom(void)
#endif
configuration.checksum = 0xffff;
configuration.instances = INSTANCES_DEFAULT;
configuration.instance_mode = INSTANCE_MODE_DEFAULT;
configuration.instance_splitpoint = INSTANCE_SPLITPOINT_DEFAULT;
configuration.vol = VOLUME_DEFAULT;
configuration.mono = MONO_DEFAULT;
configuration.reverb_roomsize = REVERB_ROOMSIZE_DEFAULT;
configuration.reverb_damping = REVERB_DAMPING_DEFAULT;
configuration.chorus_frequency = CHORUS_FREQUENCY_DEFAULT;
@ -1220,44 +1222,48 @@ void show_configuration(void)
{
Serial.println();
Serial.println(F("CONFIGURATION:"));
Serial.print(F("Checksum 0x")); Serial.println(configuration.checksum, HEX);
Serial.print(F("Volume ")); Serial.println(configuration.vol, DEC);
Serial.print(F("Mono ")); Serial.println(configuration.mono, DEC);
Serial.print(F("Reverb Roomsize ")); Serial.println(configuration.reverb_roomsize, DEC);
Serial.print(F("Reverb Damping ")); Serial.println(configuration.reverb_damping, DEC);
Serial.print(F("Chorus Frequency ")); Serial.println(configuration.chorus_frequency, DEC);
Serial.print(F("Chorus Waveform ")); Serial.println(configuration.chorus_waveform, DEC);
Serial.print(F("Chorus Depth ")); Serial.println(configuration.chorus_depth, DEC);
Serial.print(F("Delay Time ")); Serial.println(configuration.delay_time, DEC);
Serial.print(F("Delay Feedback ")); Serial.println(configuration.delay_feedback, DEC);
Serial.print(F("Checksum 0x")); Serial.println(configuration.checksum, HEX);
Serial.print(F("Instances ")); Serial.println(configuration.instances, DEC);
Serial.print(F("Instance Mode ")); Serial.println(configuration.instance_mode, DEC);
Serial.print(F("Instance Splitpoint ")); Serial.println(configuration.instance_splitpoint, DEC);
Serial.print(F("Volume ")); Serial.println(configuration.vol, DEC);
Serial.print(F("Mono ")); Serial.println(configuration.mono, DEC);
Serial.print(F("Reverb Roomsize ")); Serial.println(configuration.reverb_roomsize, DEC);
Serial.print(F("Reverb Damping ")); Serial.println(configuration.reverb_damping, DEC);
Serial.print(F("Chorus Frequency ")); Serial.println(configuration.chorus_frequency, DEC);
Serial.print(F("Chorus Waveform ")); Serial.println(configuration.chorus_waveform, DEC);
Serial.print(F("Chorus Depth ")); Serial.println(configuration.chorus_depth, DEC);
Serial.print(F("Delay Time ")); Serial.println(configuration.delay_time, DEC);
Serial.print(F("Delay Feedback ")); Serial.println(configuration.delay_feedback, DEC);
for (uint8_t i = 0; i < NUM_DEXED; i++)
{
Serial.print(F("DEXED Instance "));
Serial.println(i, DEC);
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.midi_channel[i], DEC);
Serial.print(F(" Bank ")); Serial.println(configuration.bank[i], DEC);
Serial.print(F(" Voice ")); Serial.println(configuration.voice[i], DEC);
Serial.print(F(" Panorama ")); Serial.println(configuration.pan[i], DEC);
Serial.print(F(" Chorus Level ")); Serial.println(configuration.chorus_level[i], DEC);
Serial.print(F(" Reverb Level ")); Serial.println(configuration.reverb_level[i], DEC);
Serial.print(F(" Delay Level ")); Serial.println(configuration.delay_level[i], DEC);
Serial.print(F(" Filter Cutoff ")); Serial.println(configuration.filter_cutoff[i], DEC);
Serial.print(F(" Filter Resonance ")); Serial.println(configuration.filter_resonance[i], DEC);
Serial.print(F(" Loudness ")); Serial.println(configuration.loudness[i], DEC);
Serial.print(F(" Polyphony ")); Serial.println(configuration.polyphony[i], DEC);
Serial.print(F(" Engine ")); Serial.println(configuration.engine[i], DEC);
Serial.print(F(" Mono/Pol ")); Serial.println(configuration.monopoly[i], DEC);
Serial.print(F(" Pitchbend Range ")); Serial.println(configuration.pb_range[i], DEC);
Serial.print(F(" Pitchbend Step ")); Serial.println(configuration.pb_step[i], DEC);
Serial.print(F(" Modwheel Range ")); Serial.println(configuration.mw_range[i], DEC);
Serial.print(F(" Modwheel Assign ")); Serial.println(configuration.mw_assign[i], DEC);
Serial.print(F(" Footctrl Range ")); Serial.println(configuration.fc_range[i], DEC);
Serial.print(F(" Footctrl Assign ")); Serial.println(configuration.fc_assign[i], DEC);
Serial.print(F(" BreathCtrl Range ")); Serial.println(configuration.bc_range[i], DEC);
Serial.print(F(" Breathctrl Assign ")); Serial.println(configuration.bc_assign[i], DEC);
Serial.print(F(" Aftertouch Range ")); Serial.println(configuration.at_range[i], DEC);
Serial.print(F(" Aftertouch Assign ")); Serial.println(configuration.at_assign[i], DEC);
Serial.print(F(" OP Enabled ")); Serial.println(configuration.op_enabled[i], DEC);
Serial.print(F("=== DEXED Instance "));
Serial.print(i, DEC);
Serial.println(" ===");
Serial.print(F(" MIDI-Channel ")); Serial.println(configuration.midi_channel[i], DEC);
Serial.print(F(" Bank ")); Serial.println(configuration.bank[i], DEC);
Serial.print(F(" Voice ")); Serial.println(configuration.voice[i], DEC);
Serial.print(F(" Panorama ")); Serial.println(configuration.pan[i], DEC);
Serial.print(F(" Reverb Level ")); Serial.println(configuration.reverb_level[i], DEC);
Serial.print(F(" Chorus Level ")); Serial.println(configuration.chorus_level[i], DEC);
Serial.print(F(" Delay Level ")); Serial.println(configuration.delay_level[i], DEC);
Serial.print(F(" Filter Cutoff ")); Serial.println(configuration.filter_cutoff[i], DEC);
Serial.print(F(" Filter Resonance ")); Serial.println(configuration.filter_resonance[i], DEC);
Serial.print(F(" Loudness ")); Serial.println(configuration.loudness[i], DEC);
Serial.print(F(" Polyphony ")); Serial.println(configuration.polyphony[i], DEC);
Serial.print(F(" Engine ")); Serial.println(configuration.engine[i], DEC);
Serial.print(F(" Mono/Poly ")); Serial.println(configuration.monopoly[i], DEC);
Serial.print(F(" Pitchbend Range ")); Serial.println(configuration.pb_range[i], DEC);
Serial.print(F(" Pitchbend Step ")); Serial.println(configuration.pb_step[i], DEC);
Serial.print(F(" Modwheel Range ")); Serial.println(configuration.mw_range[i], DEC);
Serial.print(F(" Modwheel Assign ")); Serial.println(configuration.mw_assign[i], DEC);
Serial.print(F(" Footctrl Range ")); Serial.println(configuration.fc_range[i], DEC);
Serial.print(F(" Footctrl Assign ")); Serial.println(configuration.fc_assign[i], DEC);
Serial.print(F(" BreathCtrl Range ")); Serial.println(configuration.bc_range[i], DEC);
Serial.print(F(" Breathctrl Assign ")); Serial.println(configuration.bc_assign[i], DEC);
Serial.print(F(" Aftertouch Range ")); Serial.println(configuration.at_range[i], DEC);
Serial.print(F(" Aftertouch Assign ")); Serial.println(configuration.at_assign[i], DEC);
Serial.print(F(" OP Enabled ")); Serial.println(configuration.op_enabled[i], DEC);
}
Serial.println();
}

@ -538,7 +538,7 @@ void encoder_right_up(void)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
switch (menu_state)
@ -600,7 +600,7 @@ void encoder_right_down(void)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
switch (menu_state)
@ -891,6 +891,8 @@ void lcdml_menu_display(void)
}
}
//####################################################################################################################################################################################################
/***********************************************************************
MENU
***********************************************************************/
@ -994,7 +996,7 @@ void UI_func_reverb_level(uint8_t param)
#ifdef USE_REVERB
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1189,7 +1191,7 @@ void UI_func_chorus_level(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1326,7 +1328,7 @@ void UI_func_delay_level(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1375,7 +1377,7 @@ void UI_func_filter_cutoff(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1408,6 +1410,13 @@ void UI_func_filter_cutoff(uint8_t param)
lcd.setCursor(0, 1);
lcd_display_int(configuration.filter_cutoff[instance_id], 3, true, true, false);
Serial.print(LCDML.FUNC_getID(),DEC);
Serial.print(" ");
Serial.print(MENU_ID_OF_INSTANCE_2,DEC);
Serial.print(" INSTANCE: ");
Serial.print(instance_id,DEC);
Serial.print(" value: ");
Serial.println(configuration.filter_cutoff[instance_id] / 100.0,3);
MicroDexed[instance_id]->fx.Cutoff = configuration.filter_cutoff[instance_id] / 100.0;
}
@ -1423,7 +1432,7 @@ void UI_func_filter_resonance(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1471,7 +1480,7 @@ void UI_func_midi_channel(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1524,7 +1533,7 @@ void UI_func_loudness(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1572,7 +1581,7 @@ void UI_func_panorama(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1628,7 +1637,7 @@ void UI_func_stereo_mono(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1692,7 +1701,7 @@ void UI_func_polyphony(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1740,7 +1749,7 @@ void UI_func_engine(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1799,7 +1808,7 @@ void UI_func_mono_poly(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1855,7 +1864,7 @@ void UI_func_pb_range(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -1903,7 +1912,7 @@ void UI_func_pb_step(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
if (LCDML.FUNC_setup()) // ****** SETUP *********
@ -2008,7 +2017,7 @@ void UI_func_voice_selection(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
#ifdef DEBUG
@ -2075,7 +2084,7 @@ void UI_func_volume(uint8_t param)
{
uint8_t instance_id = 0;
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2)
if (LCDML.FUNC_getID() < MENU_ID_OF_INSTANCE_2)
instance_id = 1;
#ifdef DEBUG

@ -400,24 +400,39 @@ enum { DEXED, REVERB, DELAY, CHORUS };
#define PORTAMENTO_TIME_MAX 99
#define PORTAMENTO_TIME_DEFAULT 50
#define INSTANCES_MIN 1
#define INSTANCES_MAX NUM_DEXED
#define INSTANCES_DEFAULT 1
#define INSTANCE_MODE_MIN 0
#define INSTANCE_MODE_MAX 1
#define INSTANCE_MODE_DEFAULT 0
#define INSTANCE_SPLITPOINT_MIN MIDI_AIS0
#define INSTANCE_SPLITPOINT_MAX MIDI_B7
#define INSTANCE_SPLITPOINT_DEFAULT MIDI_C3
// struct for holding the current configuration
struct config_t {
uint32_t checksum;
uint8_t bank[NUM_DEXED];
uint8_t voice[NUM_DEXED];
uint8_t instances;
uint8_t instance_mode;
uint8_t instance_splitpoint;
uint8_t vol;
int8_t pan[NUM_DEXED];
uint8_t mono;
uint8_t midi_channel[NUM_DEXED];
uint8_t reverb_roomsize;
uint8_t reverb_damping;
uint8_t reverb_level[NUM_DEXED];
uint8_t chorus_frequency;
uint8_t chorus_waveform;
uint8_t chorus_depth;
uint8_t chorus_level[NUM_DEXED];
uint8_t delay_time;
uint8_t delay_feedback;
uint8_t midi_channel[NUM_DEXED];
uint8_t bank[NUM_DEXED];
uint8_t voice[NUM_DEXED];
int8_t pan[NUM_DEXED];
uint8_t reverb_level[NUM_DEXED];
uint8_t chorus_level[NUM_DEXED];
uint8_t delay_level[NUM_DEXED];
uint8_t filter_cutoff[NUM_DEXED];
uint8_t filter_resonance[NUM_DEXED];

Loading…
Cancel
Save