From 978f876ab5bcb24b67c621d2f1192f267d11e6b5 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 14 Jul 2020 14:47:28 +0200 Subject: [PATCH] Bugfix for setting delay level. Fix pseudo-log curve. --- MicroDexed.ino | 2 +- UI.hpp | 5 +++-- config.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 2d3c20e..f935b44 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -1860,7 +1860,7 @@ float pseudo_log_curve(float value) //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(2, value) - 1); - return (pow(value, 2.5)); + return (pow(value, 2.2)); } uint32_t crc32(byte * calc_start, uint16_t calc_bytes) // base code from https://www.arduino.cc/en/Tutorial/EEPROMCrc diff --git a/UI.hpp b/UI.hpp index 4c66650..71ecd6d 100644 --- a/UI.hpp +++ b/UI.hpp @@ -1361,10 +1361,11 @@ void UI_func_delay_level(uint8_t param) lcd_display_bar_int("Delay Lvl.", configuration.fx.delay_level[selected_instance_id], 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false); - if (configuration.fx.delay_level[selected_instance_id] <= DELAY_LEVEL_MIN) + /*if (configuration.fx.delay_level[selected_instance_id] <= DELAY_LEVEL_MIN) delay_fx[selected_instance_id]->disable(0); else - delay_fx[selected_instance_id]->delay(0, constrain(configuration.fx.delay_time[selected_instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); + delay_fx[selected_instance_id]->delay(0, constrain(configuration.fx.delay_time[selected_instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX) * 10); */ + delay_mixer[selected_instance_id]->gain(1, pseudo_log_curve(mapfloat(configuration.fx.delay_level[selected_instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0))); } if (LCDML.FUNC_close()) // ****** STABLE END ********* diff --git a/config.h b/config.h index 55656cd..03559f3 100644 --- a/config.h +++ b/config.h @@ -56,7 +56,7 @@ // sed -i.orig 's/^#define USB_MIDI_SYSEX_MAX 290/#define USB_MIDI_SYSEX_MAX 4104/' /usr/local/arduino-teensy/hardware/teensy/avr/cores/teensy3/usb_midi.h //#define USB_MIDI_SYSEX_MAX 4104 -#define VERSION "1.0.4" +#define VERSION "1.0.5" //************************************************************************************************* //* DEVICE SETTINGS @@ -112,7 +112,7 @@ #define MOD_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT #define MOD_FILTER_CUTOFF_HZ 2000 // REVERB parameters -//#define REVERB_ANTIALIAS_FRQ 7500 +#define REVERB_ANTIALIAS_FRQ 7500 // SGTL5000 #ifdef TEENSY_AUDIO_BOARD #define SGTL5000_AUDIO_ENHANCE 1