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].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].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].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);

@ -2083,8 +2083,11 @@ void UI_func_polyphony(uint8_t param)
encoderDir[ENC_R].reset();
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);
UI_update_instance_icons();
}
@ -2095,14 +2098,25 @@ void UI_func_polyphony(uint8_t param)
{
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);
#endif
}
else if (LCDML.BT_checkUp())
{
if (configuration.dexed[selected_instance_id].polyphony - 1 < 0)
configuration.dexed[selected_instance_id].polyphony = 0;
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);
#endif
}
}
#if NUM_DEXED > 1
else if (LCDML.BT_checkEnter())
@ -2115,8 +2129,11 @@ void UI_func_polyphony(uint8_t param)
#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);
#endif
MicroDexed[selected_instance_id]->setMaxNotes(configuration.dexed[selected_instance_id].polyphony);
}

@ -306,13 +306,12 @@
// Teensy-4.x settings
#ifdef TEENSY4
#define MAX_NOTES 32
#define MAX_NOTES 64
#endif
// Teensy-3.6 settings
#if defined(TEENSY3_6)
# if defined(USE_FX)
# if NUM_DEXED == 1
# if F_CPU == 256000000
# define MAX_NOTES 20
# elif F_CPU == 240000000
@ -323,19 +322,7 @@
# warning >>> You should consider to use 216MHz overclocking to get polyphony of 16 instead 12 voices <<<
# define MAX_NOTES 12
# endif
# else
# 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
# elif F_CPU == 216000000
@ -343,15 +330,6 @@
# else
# define MAX_NOTES 16
# 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

Loading…
Cancel
Save