Dynamic polyphony allocation now allows to distribute the voices dynamically with bitimbral engine.

pull/41/head
Holger Wirtz 4 years ago
parent fafbf8f90c
commit 5706e0f59d
  1. 2
      MicroDexed.ino
  2. 23
      UI.hpp
  3. 24
      config.h

@ -1585,7 +1585,7 @@ void check_configuration(void)
configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX); configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan, PANORAMA_MIN, PANORAMA_MAX);
configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose, TRANSPOSE_MIN, TRANSPOSE_MAX); configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose, TRANSPOSE_MIN, TRANSPOSE_MAX);
configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune, TUNE_MIN, TUNE_MAX); configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune, TUNE_MIN, TUNE_MAX);
configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony, POLYPHONY_MIN, POLYPHONY_MAX); configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony, POLYPHONY_MIN, POLYPHONY_MAX/instance_id);
configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX);
configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine, ENGINE_MIN, ENGINE_MAX); configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine, ENGINE_MIN, ENGINE_MAX);
configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly, MONOPOLY_MIN, MONOPOLY_MAX); configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly, MONOPOLY_MIN, MONOPOLY_MAX);

@ -2083,8 +2083,11 @@ void UI_func_polyphony(uint8_t param)
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd_special_chars(BLOCKBAR); lcd_special_chars(BLOCKBAR);
lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 2, false, false, true); #if NUM_DEXED>1
lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX - configuration.dexed[(selected_instance_id + 1) % NUM_DEXED].polyphony, 2, false, false, true);
#else
lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX].polyphony, 2, false, false, true);
#endif
lcd_active_instance_number(selected_instance_id); lcd_active_instance_number(selected_instance_id);
UI_update_instance_icons(); UI_update_instance_icons();
} }
@ -2095,14 +2098,25 @@ void UI_func_polyphony(uint8_t param)
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
{ {
#if NUM_DEXED>1
if (configuration.dexed[selected_instance_id].polyphony < POLYPHONY_MAX - configuration.dexed[selected_instance_id + 1 % NUM_DEXED].polyphony)
configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony + 1, POLYPHONY_MIN, POLYPHONY_MAX - configuration.dexed[(selected_instance_id + 1) % NUM_DEXED].polyphony);
#else
configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony + 1, POLYPHONY_MIN, POLYPHONY_MAX); configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony + 1, POLYPHONY_MIN, POLYPHONY_MAX);
#endif
} }
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
{ {
if (configuration.dexed[selected_instance_id].polyphony - 1 < 0) if (configuration.dexed[selected_instance_id].polyphony - 1 < 0)
configuration.dexed[selected_instance_id].polyphony = 0; configuration.dexed[selected_instance_id].polyphony = 0;
else else
{
#if NUM_DEXED>1
configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony - 1, POLYPHONY_MIN, POLYPHONY_MAX - configuration.dexed[(selected_instance_id + 1) % NUM_DEXED].polyphony);
#else
configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony - 1, POLYPHONY_MIN, POLYPHONY_MAX); configuration.dexed[selected_instance_id].polyphony = constrain(configuration.dexed[selected_instance_id].polyphony - 1, POLYPHONY_MIN, POLYPHONY_MAX);
#endif
}
} }
#if NUM_DEXED > 1 #if NUM_DEXED > 1
else if (LCDML.BT_checkEnter()) else if (LCDML.BT_checkEnter())
@ -2115,8 +2129,11 @@ void UI_func_polyphony(uint8_t param)
#endif #endif
} }
#if NUM_DEXED>1
lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX - configuration.dexed[selected_instance_id + 1 % NUM_DEXED].polyphony, 2, false, false, false);
#else
lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 2, false, false, false); lcd_display_bar_int("Polyphony", configuration.dexed[selected_instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 2, false, false, false);
#endif
MicroDexed[selected_instance_id]->setMaxNotes(configuration.dexed[selected_instance_id].polyphony); MicroDexed[selected_instance_id]->setMaxNotes(configuration.dexed[selected_instance_id].polyphony);
} }

@ -306,13 +306,12 @@
// Teensy-4.x settings // Teensy-4.x settings
#ifdef TEENSY4 #ifdef TEENSY4
#define MAX_NOTES 32 #define MAX_NOTES 64
#endif #endif
// Teensy-3.6 settings // Teensy-3.6 settings
#if defined(TEENSY3_6) #if defined(TEENSY3_6)
# if defined(USE_FX) # if defined(USE_FX)
# if NUM_DEXED == 1
# if F_CPU == 256000000 # if F_CPU == 256000000
# define MAX_NOTES 20 # define MAX_NOTES 20
# elif F_CPU == 240000000 # elif F_CPU == 240000000
@ -325,33 +324,12 @@
# endif # endif
# else # else
# if F_CPU == 256000000 # if F_CPU == 256000000
# define MAX_NOTES 8
# elif F_CPU == 240000000
# define MAX_NOTES 7
# elif F_CPU == 216000000
# define MAX_NOTES 6
# else
# define MAX_NOTES 5
# endif
# endif
# else
# if NUM_DEXED == 1
# if F_CPU == 256000000
# define MAX_NOTES 20 # define MAX_NOTES 20
# elif F_CPU == 216000000 # elif F_CPU == 216000000
# define MAX_NOTES 20 # define MAX_NOTES 20
# else # else
# define MAX_NOTES 16 # define MAX_NOTES 16
# endif # endif
# else
# if F_CPU == 256000000
# define MAX_NOTES 20
# elif F_CPU == 216000000
# define MAX_NOTES 16
# else
# define MAX_NOTES 8
# endif
# endif
# endif # endif
#endif #endif

Loading…
Cancel
Save