|
|
|
@ -356,8 +356,6 @@ void setup() |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
initial_values_from_eeprom(false); |
|
|
|
|
|
|
|
|
|
#if defined(USE_FX) |
|
|
|
|
// Init effects
|
|
|
|
|
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) |
|
|
|
@ -379,6 +377,8 @@ void setup() |
|
|
|
|
#endif |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
initial_values_from_eeprom(false); |
|
|
|
|
|
|
|
|
|
// start SD card
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
|
change_disp_sd(false); |
|
|
|
@ -1465,8 +1465,9 @@ void initial_values_from_eeprom(bool init) |
|
|
|
|
MicroDexed[instance_id]->fx.Gain = 1.0; |
|
|
|
|
MicroDexed[instance_id]->fx.Reso = mapfloat(configuration.dexed[instance_id].filter_resonance, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 1.0, 0.0); |
|
|
|
|
MicroDexed[instance_id]->fx.Cutoff = mapfloat(configuration.dexed[instance_id].filter_cutoff, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 1.0, 0.0); |
|
|
|
|
|
|
|
|
|
dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX))); |
|
|
|
|
*/ |
|
|
|
|
//dexed_level[instance_id]->gain(pseudo_log_curve(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)));
|
|
|
|
|
} |
|
|
|
|
set_fx_params(); |
|
|
|
|
set_sys_params(); |
|
|
|
@ -1845,6 +1846,11 @@ void set_sys_params(void) |
|
|
|
|
HELPERS |
|
|
|
|
******************************************************************************/ |
|
|
|
|
|
|
|
|
|
float mapfloat(float val, float in_min, float in_max, float out_min, float out_max) |
|
|
|
|
{ |
|
|
|
|
return (val - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// https://www.reddit.com/r/Teensy/comments/7r19uk/reset_and_reboot_teensy_lc_via_code/
|
|
|
|
|
#define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) // Application Interrupt and Reset Control location
|
|
|
|
|
void _softRestart(void) |
|
|
|
@ -1857,12 +1863,12 @@ float pseudo_log_curve(float value) |
|
|
|
|
{ |
|
|
|
|
const float _pseudo_log = 1048575 / (float)(1 << 20); |
|
|
|
|
|
|
|
|
|
/* #ifdef DEBUG
|
|
|
|
|
#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 */ |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
return (mapfloat(_pseudo_log * arm_sin_f32(value), 0.0, _pseudo_log * arm_sin_f32(1.0), 0.0, 1.0)); |
|
|
|
|
} |
|
|
|
|