Added special mode for controllers.

Small fixes.
pull/32/head
Holger Wirtz 5 years ago
parent 8a94868daa
commit e62e560ef9
  1. 1
      MicroDexed.ino
  2. 73
      UI.hpp
  3. 12
      config.h
  4. 3
      controllers.h

@ -755,6 +755,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
Serial.println(F("BREATH CC")); Serial.println(F("BREATH CC"));
#endif #endif
MicroDexed[instance_id]->controllers.breath_cc = inValue; MicroDexed[instance_id]->controllers.breath_cc = inValue;
//MicroDexed[instance_id]->controllers.breath_cc = 100 – BCrange + Output * BCrange * Bcvalue/100
MicroDexed[instance_id]->controllers.refresh(); MicroDexed[instance_id]->controllers.refresh();
break; break;
case 4: case 4:

@ -2024,6 +2024,9 @@ void UI_func_mw_assign(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign - 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX); configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign - 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX);
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_assign) switch (configuration.dexed[instance_id].mw_assign)
{ {
@ -2052,9 +2055,6 @@ void UI_func_mw_assign(uint8_t param)
lcd.print(F("[PTCH AMP EG-BS]")); lcd.print(F("[PTCH AMP EG-BS]"));
break; break;
} }
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2091,6 +2091,9 @@ void UI_func_mw_mode(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode - 1, MW_MODE_MIN, MW_MODE_MAX); configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode - 1, MW_MODE_MIN, MW_MODE_MAX);
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_mode) switch (configuration.dexed[instance_id].mw_mode)
{ {
@ -2100,9 +2103,9 @@ void UI_func_mw_mode(uint8_t param)
case 1: case 1:
lcd.print(F("[REVERSE]")); lcd.print(F("[REVERSE]"));
break; break;
} case 2:
lcd.print(F("[SPECIAL]"));
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); break;
} }
} }
@ -2181,6 +2184,9 @@ void UI_func_fc_assign(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign - 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX); configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign - 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX);
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_assign) switch (configuration.dexed[instance_id].fc_assign)
{ {
@ -2209,9 +2215,6 @@ void UI_func_fc_assign(uint8_t param)
lcd.print(F("[PTCH AMP EG-BS]")); lcd.print(F("[PTCH AMP EG-BS]"));
break; break;
} }
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2248,6 +2251,9 @@ void UI_func_fc_mode(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode - 1, FC_MODE_MIN, FC_MODE_MAX); configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode - 1, FC_MODE_MIN, FC_MODE_MAX);
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_mode) switch (configuration.dexed[instance_id].fc_mode)
{ {
@ -2257,9 +2263,9 @@ void UI_func_fc_mode(uint8_t param)
case 1: case 1:
lcd.print(F("[REVERSE]")); lcd.print(F("[REVERSE]"));
break; break;
} case 2:
lcd.print(F("[SPECIAL]"));
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); break;
} }
} }
@ -2338,6 +2344,9 @@ void UI_func_bc_assign(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign - 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX); configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign - 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX);
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_assign) switch (configuration.dexed[instance_id].bc_assign)
{ {
@ -2366,9 +2375,6 @@ void UI_func_bc_assign(uint8_t param)
lcd.print(F("[PTCH AMP EG-BS]")); lcd.print(F("[PTCH AMP EG-BS]"));
break; break;
} }
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2405,6 +2411,9 @@ void UI_func_bc_mode(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode - 1, BC_MODE_MIN, BC_MODE_MAX); configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode - 1, BC_MODE_MIN, BC_MODE_MAX);
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_mode) switch (configuration.dexed[instance_id].bc_mode)
{ {
@ -2414,9 +2423,9 @@ void UI_func_bc_mode(uint8_t param)
case 1: case 1:
lcd.print(F("[REVERSE]")); lcd.print(F("[REVERSE]"));
break; break;
} case 2:
lcd.print(F("[SPECIAL]"));
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); break;
} }
} }
@ -2495,6 +2504,9 @@ void UI_func_at_assign(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign - 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX); configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign - 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX);
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_assign) switch (configuration.dexed[instance_id].at_assign)
{ {
@ -2523,9 +2535,6 @@ void UI_func_at_assign(uint8_t param)
lcd.print(F("[PTCH AMP EG-BS]")); lcd.print(F("[PTCH AMP EG-BS]"));
break; break;
} }
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2562,6 +2571,9 @@ void UI_func_at_mode(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode - 1, AT_MODE_MIN, AT_MODE_MAX); configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode - 1, AT_MODE_MIN, AT_MODE_MAX);
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_mode) switch (configuration.dexed[instance_id].at_mode)
{ {
@ -2571,9 +2583,9 @@ void UI_func_at_mode(uint8_t param)
case 1: case 1:
lcd.print(F("[REVERSE]")); lcd.print(F("[REVERSE]"));
break; break;
} case 2:
lcd.print(F("[SPECIAL]"));
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); break;
} }
} }
@ -2611,6 +2623,9 @@ void UI_func_portamento_mode(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode - 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode - 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_mode) switch (configuration.dexed[instance_id].portamento_mode)
{ {
@ -2627,9 +2642,6 @@ void UI_func_portamento_mode(uint8_t param)
lcd.print(F("[FULL ]")); lcd.print(F("[FULL ]"));
break; break;
} }
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2666,6 +2678,9 @@ void UI_func_portamento_glissando(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando - 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando - 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX);
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
}
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_glissando) switch (configuration.dexed[instance_id].portamento_glissando)
{ {
@ -2676,9 +2691,6 @@ void UI_func_portamento_glissando(uint8_t param)
lcd.print(F("[ON ]")); lcd.print(F("[ON ]"));
break; break;
} }
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time);
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -3036,6 +3048,7 @@ void UI_func_volume(uint8_t param)
if (menu_state != MENU_VOLUME) if (menu_state != MENU_VOLUME)
{ {
LCDML.DISP_clear();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Volume", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true); lcd_display_bar_int("Volume", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true);
menu_state = MENU_VOLUME; menu_state = MENU_VOLUME;

@ -421,7 +421,7 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define MW_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias #define MW_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias
#define MW_MODE_MIN 0 #define MW_MODE_MIN 0
#define MW_MODE_MAX 1 #define MW_MODE_MAX 2
#define MW_MODE_DEFAULT 0 #define MW_MODE_DEFAULT 0
#define FC_RANGE_MIN 0 #define FC_RANGE_MIN 0
@ -433,7 +433,7 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define FC_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias #define FC_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias
#define FC_MODE_MIN 0 #define FC_MODE_MIN 0
#define FC_MODE_MAX 1 #define FC_MODE_MAX 2
#define FC_MODE_DEFAULT 0 #define FC_MODE_DEFAULT 0
#define BC_RANGE_MIN 0 #define BC_RANGE_MIN 0
@ -442,11 +442,11 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define BC_ASSIGN_MIN 0 #define BC_ASSIGN_MIN 0
#define BC_ASSIGN_MAX 7 #define BC_ASSIGN_MAX 7
#define BC_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias #define BC_ASSIGN_DEFAULT 2 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias
#define BC_MODE_MIN 0 #define BC_MODE_MIN 0
#define BC_MODE_MAX 1 #define BC_MODE_MAX 2
#define BC_MODE_DEFAULT 0 #define BC_MODE_DEFAULT 2
#define AT_RANGE_MIN 0 #define AT_RANGE_MIN 0
#define AT_RANGE_MAX 99 #define AT_RANGE_MAX 99
@ -457,7 +457,7 @@ enum { DEXED, CHORUS, DELAY, REVERB};
#define AT_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias #define AT_ASSIGN_DEFAULT 0 // Bitmapped: 0: Pitch, 1: Amp, 2: Bias
#define AT_MODE_MIN 0 #define AT_MODE_MIN 0
#define AT_MODE_MAX 1 #define AT_MODE_MAX 2
#define AT_MODE_DEFAULT 0 #define AT_MODE_DEFAULT 0
#define OP_ENABLED_MIN 0 #define OP_ENABLED_MIN 0

@ -82,6 +82,9 @@ class Controllers {
case 1: case 1:
total = (float)(127 - cc) * range; // REVERSE mode total = (float)(127 - cc) * range; // REVERSE mode
break; break;
case 2:
total = 100 - range + (float)cc * range / 100; // Special BC mode by opus.quattre
break;
} }
if (mod.amp) if (mod.amp)

Loading…
Cancel
Save