Added special mode for controllers.

Small fixes.
pull/32/head
Holger Wirtz 5 years ago
parent 8a94868daa
commit e62e560ef9
  1. 1
      MicroDexed.ino
  2. 389
      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:

389
UI.hpp

@ -2024,37 +2024,37 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); 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);
switch (configuration.dexed[instance_id].mw_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2091,19 +2091,22 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].mw_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
}
MicroDexed[instance_id]->setMWController(configuration.dexed[instance_id].mw_range, configuration.dexed[instance_id].mw_assign, configuration.dexed[instance_id].mw_mode); 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);
switch (configuration.dexed[instance_id].mw_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
case 2:
lcd.print(F("[SPECIAL]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2181,37 +2184,37 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); 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);
switch (configuration.dexed[instance_id].fc_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2248,19 +2251,22 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].fc_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
}
MicroDexed[instance_id]->setFCController(configuration.dexed[instance_id].fc_range, configuration.dexed[instance_id].fc_assign, configuration.dexed[instance_id].fc_mode); 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);
switch (configuration.dexed[instance_id].fc_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
case 2:
lcd.print(F("[SPECIAL]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2338,37 +2344,37 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); 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);
switch (configuration.dexed[instance_id].bc_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2405,19 +2411,22 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].bc_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
}
MicroDexed[instance_id]->setBCController(configuration.dexed[instance_id].bc_range, configuration.dexed[instance_id].bc_assign, configuration.dexed[instance_id].bc_mode); 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);
switch (configuration.dexed[instance_id].bc_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
case 2:
lcd.print(F("[SPECIAL]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2495,37 +2504,37 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); 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);
switch (configuration.dexed[instance_id].at_assign)
{
case 0:
lcd.print(F("[ NONE ]"));
break;
case 1:
lcd.print(F("[PTCH ]"));
break;
case 2:
lcd.print(F("[ AMP ]"));
break;
case 3:
lcd.print(F("[PTCH AMP ]"));
break;
case 4:
lcd.print(F("[ EG-BS]"));
break;
case 5:
lcd.print(F("[PTCH EG-BS]"));
break;
case 6:
lcd.print(F("[ AMP EG-BS]"));
break;
case 7:
lcd.print(F("[PTCH AMP EG-BS]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2562,19 +2571,22 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].at_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
}
MicroDexed[instance_id]->setATController(configuration.dexed[instance_id].at_range, configuration.dexed[instance_id].at_assign, configuration.dexed[instance_id].at_mode); 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);
switch (configuration.dexed[instance_id].at_mode)
{
case 0:
lcd.print(F("[NORMAL ]"));
break;
case 1:
lcd.print(F("[REVERSE]"));
break;
case 2:
lcd.print(F("[SPECIAL]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2611,25 +2623,25 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_mode)
{
case 0:
if (configuration.dexed[instance_id].monopoly == 1)
lcd.print(F("[RETAIN ]"));
else
lcd.print(F("[FINGERED]"));
break;
case 1:
if (configuration.dexed[instance_id].monopoly == 1)
lcd.print(F("[FOLLOW ]"));
else
lcd.print(F("[FULL ]"));
break;
}
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); 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);
switch (configuration.dexed[instance_id].portamento_mode)
{
case 0:
if (configuration.dexed[instance_id].monopoly == 1)
lcd.print(F("[RETAIN ]"));
else
lcd.print(F("[FINGERED]"));
break;
case 1:
if (configuration.dexed[instance_id].monopoly == 1)
lcd.print(F("[FOLLOW ]"));
else
lcd.print(F("[FULL ]"));
break;
}
} }
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
@ -2666,19 +2678,19 @@ 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);
lcd.setCursor(0, 1);
switch (configuration.dexed[instance_id].portamento_glissando)
{
case 0:
lcd.print(F("[OFF]"));
break;
case 1:
lcd.print(F("[ON ]"));
break;
}
MicroDexed[instance_id]->setPortamentoMode(configuration.dexed[instance_id].portamento_mode, configuration.dexed[instance_id].portamento_glissando, configuration.dexed[instance_id].portamento_time); 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);
switch (configuration.dexed[instance_id].portamento_glissando)
{
case 0:
lcd.print(F("[OFF]"));
break;
case 1:
lcd.print(F("[ON ]"));
break;
}
} }
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