diff --git a/MicroDexed.ino b/MicroDexed.ino index 56006b5..08f2155 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -415,8 +415,8 @@ void setup() master_mixer_r.gain(instance_id, 1.0); master_mixer_l.gain(instance_id, 1.0); } - master_mixer_r.gain(3, 1.0); - master_mixer_l.gain(3, 1.0); + master_mixer_r.gain(3, configuration.fx.reverb_level / 100.0); + master_mixer_l.gain(3, configuration.fx.reverb_level / 100.0); set_sys_params(); @@ -699,7 +699,7 @@ void handleControlChange(byte inChannel, byte inCtrl, byte inValue) break; case 105: // CC 105: delay time configuration.fx.delay_time[instance_id] = map(inValue, 0, 0x7f, DELAY_TIME_MIN, DELAY_TIME_MAX); - delay_fx[instance_id]->delay(0, configuration.fx.delay_time[instance_id] * 10); + delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN, DELAY_TIME_MAX)); if (LCDML.FUNC_getID() == LCDML.OTHER_getIDFromFunction(UI_func_delay_time)) { LCDML.OTHER_updateFunc(); @@ -1369,8 +1369,8 @@ void initial_values_from_eeprom(bool init) MicroDexed[instance_id]->setOPs(configuration.dexed[instance_id].op_enabled); dexed_level[instance_id]->gain(mapfloat(configuration.dexed[instance_id].sound_intensity, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 0.0, SOUND_INTENSITY_AMP_MAX)); - reverb_mixer_r.gain(instance_id, configuration.fx.reverb_level / 100.0); - reverb_mixer_l.gain(instance_id, configuration.fx.reverb_level / 100.0); + reverb_mixer_r.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); + reverb_mixer_l.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); } set_volume(configuration.sys.vol, configuration.sys.mono); @@ -1445,9 +1445,10 @@ void check_configuration(void) configuration.fx.chorus_waveform[instance_id] = constrain(configuration.fx.chorus_waveform[instance_id], CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); configuration.fx.chorus_depth[instance_id] = constrain(configuration.fx.chorus_depth[instance_id], CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); configuration.fx.chorus_level[instance_id] = constrain(configuration.fx.chorus_level[instance_id], CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); - configuration.fx.delay_time[instance_id] = constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN / 10, DELAY_TIME_MAX / 10); + configuration.fx.delay_time[instance_id] = constrain(configuration.fx.delay_time[instance_id], DELAY_TIME_MIN, DELAY_TIME_MAX); configuration.fx.delay_feedback[instance_id] = constrain(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); configuration.fx.delay_level[instance_id] = constrain(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); + configuration.fx.reverb_send[instance_id] = constrain(configuration.fx.reverb_send[instance_id], REVERB_SEND_MIN, REVERB_SEND_MAX); } } @@ -1514,6 +1515,7 @@ void init_configuration(void) configuration.fx.delay_time[instance_id] = DELAY_TIME_DEFAULT / 10; configuration.fx.delay_feedback[instance_id] = DELAY_FEEDBACK_DEFAULT; configuration.fx.delay_level[instance_id] = DELAY_LEVEL_DEFAULT; + configuration.fx.reverb_send[instance_id] = REVERB_SEND_DEFAULT; configuration.performance.bank[instance_id] = SYSEXBANK_DEFAULT; configuration.performance.voice[instance_id] = SYSEXSOUND_DEFAULT; @@ -1683,13 +1685,13 @@ void set_fx_params(void) // DELAY delay_mixer[instance_id]->gain(0, 1.0); delay_mixer[instance_id]->gain(1, mapfloat(configuration.fx.delay_level[instance_id], DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 0.0, 1.0)); - delay_fx[instance_id]->delay(0, mapfloat(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); + delay_fx[instance_id]->delay(0, constrain(configuration.fx.delay_time[instance_id] * 10, DELAY_TIME_MIN, DELAY_TIME_MAX)); delay_fb_mixer[instance_id]->gain(0, 1.0); delay_fb_mixer[instance_id]->gain(1, mapfloat(configuration.fx.delay_feedback[instance_id], DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0)); // REVERB - reverb_mixer_r.gain(instance_id, configuration.fx.reverb_level / 100.0); - reverb_mixer_l.gain(instance_id, configuration.fx.reverb_level / 100.0); + reverb_mixer_r.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); + reverb_mixer_l.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); } // REVERB @@ -1697,6 +1699,8 @@ void set_fx_params(void) freeverb_r.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); freeverb_l.roomsize(mapfloat(configuration.fx.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); freeverb_l.damping(mapfloat(configuration.fx.reverb_damping, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 0.0, 1.0)); + master_mixer_r.gain(3, configuration.fx.reverb_level / 100.0); + master_mixer_l.gain(3, configuration.fx.reverb_level / 100.0); #endif } diff --git a/UI.hpp b/UI.hpp index 34de4b1..8ecfb30 100644 --- a/UI.hpp +++ b/UI.hpp @@ -1311,8 +1311,8 @@ void UI_func_reverb_send(uint8_t param) lcd_display_bar_int("Reverb Send", configuration.fx.reverb_send[instance_id], 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, false); - reverb_mixer_r.gain(1, configuration.fx.reverb_send[instance_id] / 100.0); - reverb_mixer_l.gain(1, configuration.fx.reverb_send[instance_id] / 100.0); + reverb_mixer_r.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); + reverb_mixer_l.gain(instance_id, configuration.fx.reverb_send[instance_id] / 100.0); } if (LCDML.FUNC_close()) // ****** STABLE END *********