From 16e9ba2842ef2e45bb66885007af3958e76acd7c Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 1 Nov 2021 14:19:28 +0100 Subject: [PATCH] Only saving the current state. It's not ready... --- MicroDexed.ino | 31 ++++++++++++++++------------ UI.hpp | 11 +++++++--- UI_FX.h => UI_FX_T3_6.h | 0 config.h | 45 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 16 deletions(-) rename UI_FX.h => UI_FX_T3_6.h (100%) diff --git a/MicroDexed.ino b/MicroDexed.ino index 14a735f..ddc0ebb 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -113,6 +113,13 @@ AudioEffectFreeverbStereoFloat freeverb; #endif #endif +#if defined(USE_EPIANO) +AudioMixer<5> master_mixer_r; +AudioMixer<5> master_mixer_l; +#else +AudioMixer<4> master_mixer_r; +AudioMixer<4> master_mixer_l; +#endif AudioAmplifier volume_r; AudioAmplifier volume_l; AudioEffectStereoMono stereo2mono; @@ -275,8 +282,8 @@ AudioConnection patchCord[] = { {ep_delay_mixer_r, 0, reverb_mixer_r, 3}, {ep_delay_mixer_l, 0, reverb_mixer_l, 5}, #else - {ep, 0, master_mixer_r, 3}, - {ep, 1, master_mixer_l, 3}, , + {ep, 0, master_mixer_r, 4}, + {ep, 1, master_mixer_l, 4}, , #endif #endif }; @@ -587,7 +594,7 @@ void setup() // Setup EPiano #if defined(USE_FX) // EP_CHORUS - switch (configuration.fx.ep_chorus_waveform[instance_id]) + switch (configuration.fx.ep_chorus_waveform) { case 0: ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); @@ -599,26 +606,24 @@ void setup() ep_chorus_modulator.begin(WAVEFORM_TRIANGLE); } ep_chorus_modulator.phase(0); - ep_chorus_modulator.frequency(configuration.fx.ep_chorus_frequency[i - nstance_id] / 10.0); + ep_chorus_modulator.frequency(configuration.fx.ep_chorus_frequency / 10.0); ep_chorus_modulator.amplitude(mapfloat(configuration.fx.ep_chorus_depth, EP_CHORUS_DEPTH_MIN, EP_CHORUS_DEPTH_MAX, 0.0, 1.0)); ep_chorus_modulator.offset(0.0); #if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT // Butterworth filter, 12 db/octave - ep_modchorus_filter[instance_id]->setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); + ep_modchorus_filter.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.707); #elif MOD_FILTER_OUTPUT == MOD_LINKWITZ_RILEY_FILTER_OUTPUT // Linkwitz-Riley filter, 48 dB/octave - ep_modchorus_filter[instance_id]->setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); - ep_modchorus_filter[instance_id]->setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); - ep_modchorus_filter[instance_id]->setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); - ep_modchorus_filter[instance_id]->setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); -#endif + ep_modchorus_filter.setLowpass(0, MOD_FILTER_CUTOFF_HZ, 0.54); + ep_modchorus_filter.setLowpass(1, MOD_FILTER_CUTOFF_HZ, 1.3); + ep_modchorus_filter.setLowpass(2, MOD_FILTER_CUTOFF_HZ, 0.54); + ep_modchorus_filter.setLowpass(3, MOD_FILTER_CUTOFF_HZ, 1.3); #endif ep_chorus_mixer_r.gain(0, 1.0); ep_chorus_mixer_l.gain(0, 1.0); - ep_chorus_mixer.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); - ep_chorus_mixer.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); + ep_chorus_mixer_r.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); + ep_chorus_mixer_l.gain(1, mapfloat(configuration.fx.ep_chorus_level, EP_CHORUS_LEVEL_MIN, EP_CHORUS_LEVEL_MAX, 0.0, 0.5)); ep_chorus_inverter.gain(-1.0); ep_delay_mixer_r.gain(0, 1.0); ep_delay_mixer_l.gain(0, 1.0);; diff --git a/UI.hpp b/UI.hpp index 7c1da91..3083cb9 100644 --- a/UI.hpp +++ b/UI.hpp @@ -138,8 +138,13 @@ extern AudioMixer<2> ep_delay_mixer_r; extern AudioMixer<2> ep_delay_mixer_l; #endif -extern AudioMixer<4> master_mixer_r; -extern AudioMixer<4> master_mixer_l; +#if defined(USE_EPIANO) +extern AudioMixer<5> master_mixer_r; +extern AudioMixer<5> master_mixer_l; +#else +extern AudioMixer<4> master_mixer_r; +extern AudioMixer<4> master_mixer_l; +#endif extern AudioEffectStereoMono stereo2mono; extern AudioAnalyzePeak master_peak_r; extern AudioAnalyzePeak master_peak_l; @@ -369,7 +374,7 @@ LCDMenuLib2 LCDML(LCDML_0, _LCDML_DISP_rows, _LCDML_DISP_cols, lcdml_menu_displa #if defined(TEENSY4) #include "UI_FX_T4.h" #else -#include "UI_FX.h" +#include "UI_FX_T3_6.h" #endif #else #include "UI_NO_FX.h" diff --git a/UI_FX.h b/UI_FX_T3_6.h similarity index 100% rename from UI_FX.h rename to UI_FX_T3_6.h diff --git a/config.h b/config.h index 4ef8ff7..9328d35 100644 --- a/config.h +++ b/config.h @@ -679,6 +679,42 @@ #define EQ_7_MAX 18 #define EQ_7_DEFAULT 15 +#define EP_CHORUS_FREQUENCY_MIN 0 +#define EP_CHORUS_FREQUENCY_MAX 100 +#define EP_CHORUS_FREQUENCY_DEFAULT 0 + +#define EP_CHORUS_WAVEFORM_MIN 0 +#define EP_CHORUS_WAVEFORM_MAX 1 +#define EP_CHORUS_WAVEFORM_DEFAULT 0 + +#define EP_CHORUS_DEPTH_MIN 0 +#define EP_CHORUS_DEPTH_MAX 100 +#define EP_CHORUS_DEPTH_DEFAULT 0 + +#define EP_CHORUS_LEVEL_MIN 0 +#define EP_CHORUS_LEVEL_MAX 100 +#define EP_CHORUS_LEVEL_DEFAULT 0 + +#define EP_DELAY_TIME_MIN 0 +#define EP_DELAY_TIME_MAX DELAY_MAX_TIME/10 +#define EP_DELAY_TIME_DEFAULT 0 + +#define EP_DELAY_FEEDBACK_MIN 0 +#define EP_DELAY_FEEDBACK_MAX 100 +#define EP_DELAY_FEEDBACK_DEFAULT 0 + +#define EP_DELAY_LEVEL_MIN 0 +#define EP_DELAY_LEVEL_MAX 100 +#define EP_DELAY_LEVEL_DEFAULT 0 + +#define EP_DELAY_SYNC_MIN 0 +#define EP_DELAY_SYNC_MAX 9 +#define EP_DELAY_SYNC_DEFAULT 0 + +#define EP_REVERB_SEND_MIN 0 +#define EP_REVERB_SEND_MAX 100 +#define EP_REVERB_SEND_DEFAULT 0 + #define FAVORITES_NUM_MIN 0 #define FAVORITES_NUM_MAX 100 #define FAVORITES_NUM_DEFAULT 0 @@ -753,6 +789,15 @@ typedef struct fx_s { int8_t eq_5; int8_t eq_6; uint8_t eq_7; + uint8_t ep_chorus_frequency; + uint8_t ep_chorus_waveform; + uint8_t ep_chorus_depth; + uint8_t ep_chorus_level; + uint8_t ep_delay_time; + uint8_t ep_delay_feedback; + uint8_t ep_delay_level; + uint8_t ep_delay_sync; + uint8_t ep_reverb_send; } fx_t; typedef struct sys_s {