Fixing handling of internal sound intensity and MIDI-CC#7.

pull/32/head
Holger Wirtz 5 years ago
parent 90927a5a28
commit 91a4dbbb33
  1. 21
      MicroDexed.ino
  2. 2
      UI.hpp

@ -687,13 +687,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue)
Serial.println(F("VOLUME CC"));
#endif
//configuration.dexed[instance_id].sound_intensity = map(inValue, 0, 0x7f, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX);
/*#ifdef USE_FX
MicroDexed[instance_id]->fx.Gain = mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX);
#else*/
//dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(map(inValue, 0, 0x7f, 0, configuration.dexed[instance_id].sound_intensity), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX))); // That's not right... have to fix this!
MicroDexed[instance_id]->fx.Gain = mapfloat(map(inValue, 0, 0x7f, 0, configuration.dexed[instance_id].sound_intensity), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX);
//#endif
MicroDexed[instance_id]->fx.Gain = pseudo_log_curve(mapfloat(map(inValue, 0, 0x7f, 0, configuration.dexed[instance_id].sound_intensity), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));
if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_sound_intensity))
{
LCDML.OTHER_updateFunc();
@ -1814,19 +1808,6 @@ void _softRestart(void)
float pseudo_log_curve(float value)
{
// ideas from here: https://forum.pjrc.com/threads/56015-Changing-Volume-Levels-based-on-pot-wheel
//const float _pseudo_log = 1048575 / (float)(1 << 20);
/*
#ifdef DEBUG
Serial.print(F("value in: "));
Serial.print(value, 3);
Serial.print(F(" value out: "));
Serial.println(mapfloat(_pseudo_log * arm_sin_f32(value), 0.0, _pseudo_log * arm_sin_f32(1.0), 0.0, 1.0), 3);
#endif
*/
//return (mapfloat(_pseudo_log * arm_sin_f32(value), 0.0, _pseudo_log * arm_sin_f32(1.0), 0.0, 1.0));
//return (1 - sqrt(1 - value * value));
//return (pow(value, 2));

@ -1887,7 +1887,7 @@ void UI_func_sound_intensity(uint8_t param)
lcd_display_bar_int("Voice Level", configuration.dexed[selected_instance_id].sound_intensity, 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, false, false, false);
MicroDexed[selected_instance_id]->fx.Gain = mapfloat(configuration.dexed[selected_instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX);
MicroDexed[selected_instance_id]->fx.Gain = pseudo_log_curve(mapfloat(configuration.dexed[selected_instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX));
}
if (LCDML.FUNC_close()) // ****** STABLE END *********

Loading…
Cancel
Save