|
|
|
@ -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));
|
|
|
|
|