Fixes for Mono/Poly-Mode.

pull/45/head
Holger Wirtz 3 years ago
parent 22bdb020ca
commit 3b095746de
  1. 51
      MicroDexed.ino
  2. 15
      UI.hpp

@ -301,6 +301,21 @@ void setup()
#endif #endif
#endif #endif
#ifdef DEBUG
generate_version_string(version_string, sizeof(version_string));
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed"));
Serial.println(F("(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>"));
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed"));
Serial.print(F("Version: "));
Serial.println(version_string);
Serial.print(F("CPU-Speed: "));
Serial.print(F_CPU / 1000000.0, 1);
Serial.println(F(" MHz"));
Serial.println(F("<setup start>"));
Serial.flush();
#endif
setup_midi_devices(); setup_midi_devices();
// Start audio system // Start audio system
@ -376,6 +391,17 @@ void setup()
create_audio_engine_chain(instance_id); create_audio_engine_chain(instance_id);
} }
#ifdef DEBUG
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{
Serial.print(F("Instance "));
Serial.print(instance_id);
Serial.print(F(": "));
Serial.print(MicroDexed[instance_id]->getMaxNotes());
Serial.println(F(" voices"));
}
#endif
#if defined(USE_FX) #if defined(USE_FX)
// Init effects // Init effects
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
@ -397,29 +423,6 @@ void setup()
#endif #endif
#endif #endif
#ifdef DEBUG
generate_version_string(version_string, sizeof(version_string));
Serial.println(F("MicroDexed based on https://github.com/asb2m10/dexed"));
Serial.println(F("(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>"));
Serial.println(F("https://codeberg.org/dcoredump/MicroDexed"));
Serial.print(F("Version: "));
Serial.println(version_string);
Serial.print(F("CPU-Speed: "));
Serial.print(F_CPU / 1000000.0, 1);
Serial.println(F(" MHz"));
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)
{
Serial.print(F("Instance "));
Serial.print(instance_id);
Serial.print(F(": "));
Serial.print(MicroDexed[instance_id]->getMaxNotes());
Serial.println(F(" voices"));
}
Serial.println(F("<setup start>"));
Serial.flush();
#endif
initial_values_from_eeprom(false); initial_values_from_eeprom(false);
// start SD card // start SD card
@ -1961,7 +1964,7 @@ void set_voiceconfig_params(uint8_t instance_id)
MicroDexed[instance_id]->ControllersRefresh(); MicroDexed[instance_id]->ControllersRefresh();
MicroDexed[instance_id]->setOPAll(configuration.dexed[instance_id].op_enabled); MicroDexed[instance_id]->setOPAll(configuration.dexed[instance_id].op_enabled);
MicroDexed[instance_id]->doRefreshVoice(); MicroDexed[instance_id]->doRefreshVoice();
MicroDexed[instance_id]->setMonoMode(configuration.sys.mono); MicroDexed[instance_id]->setMonoMode(configuration.dexed[instance_id].monopoly);
// Dexed output level // Dexed output level
MicroDexed[instance_id]->setGain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); MicroDexed[instance_id]->setGain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));

@ -2307,14 +2307,18 @@ void UI_func_mono_poly(uint8_t param)
if (LCDML.FUNC_loop()) // ****** LOOP ********* if (LCDML.FUNC_loop()) // ****** LOOP *********
{ {
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()))
{ {
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
configuration.dexed[selected_instance_id].monopoly = constrain(configuration.dexed[selected_instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX); configuration.dexed[selected_instance_id].monopoly = constrain(configuration.dexed[selected_instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX);
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
configuration.dexed[selected_instance_id].monopoly = constrain(configuration.dexed[selected_instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX); configuration.dexed[selected_instance_id].monopoly = constrain(configuration.dexed[selected_instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX);
MicroDexed[selected_instance_id]->setMonoMode(!configuration.dexed[selected_instance_id].monopoly);
configuration.dexed[selected_instance_id].monopoly = MicroDexed[selected_instance_id]->getMonoMode();
}
#if NUM_DEXED > 1 #if NUM_DEXED > 1
else if (LCDML.BT_checkEnter()) if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())
{ {
selected_instance_id = !selected_instance_id; selected_instance_id = !selected_instance_id;
lcd_active_instance_number(selected_instance_id); lcd_active_instance_number(selected_instance_id);
@ -2324,19 +2328,16 @@ void UI_func_mono_poly(uint8_t param)
#endif #endif
} }
MicroDexed[selected_instance_id]->setMonoMode(!configuration.dexed[selected_instance_id].monopoly);
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
switch (configuration.dexed[selected_instance_id].monopoly) switch (configuration.dexed[selected_instance_id].monopoly)
{ {
case 0: case 1:
lcd.print(F("[MONOPHONIC]")); lcd.print(F("[MONOPHONIC]"));
break; break;
case 1: case 0:
lcd.print(F("[POLYPHONIC]")); lcd.print(F("[POLYPHONIC]"));
break; break;
} }
}
if (LCDML.FUNC_close()) // ****** STABLE END ********* if (LCDML.FUNC_close()) // ****** STABLE END *********
{ {

Loading…
Cancel
Save