From a3215de56d9b53d028eb4c2ec7ef15cc0013e6d9 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 10 Nov 2019 17:29:53 +0100 Subject: [PATCH] Several fixes. --- MicroDexed.ino | 15 +++++++++------ config.h | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index bdf2d06..e031e40 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -86,8 +86,8 @@ AudioConnection patchCord2(chorus_mixer, 0, modchorus, 0); AudioConnection patchCord3(delay_mixer, 0, delay_fb_mixer, 0); AudioConnection patchCord4(delay_fb_mixer, delay1); AudioConnection patchCord5(delay1, 0, delay_fb_mixer, 1); -AudioConnection patchCord6(delay_mixer, 0, master_mixer_r, 2); -AudioConnection patchCord7(delay_mixer, 0, master_mixer_l, 2); +AudioConnection patchCord6(delay1, 0, master_mixer_r, 2); +AudioConnection patchCord7(delay1, 0, master_mixer_l, 2); AudioConnection patchCord8(master_mixer_r, volume_r); AudioConnection patchCord9(master_mixer_l, volume_l); AudioConnection patchCord10(volume_r, 0, stereomono1, 0); @@ -360,7 +360,7 @@ void setup() #ifdef USE_REVERB // INIT REVERB for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - reverb_mixer.gain(instance_id, 0.0); + reverb_mixer.gain(instance_id, mapfloat(configuration.dexed[instance_id].reverb_send, REVERB_SEND_MIN, REVERB_SEND_MAX, 0.0, 1.0)); master_mixer_r.gain(REVERB, 1.0); master_mixer_l.gain(REVERB, 1.0); freeverbs1.roomsize(mapfloat(configuration.reverb_roomsize, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 0.0, 1.0)); @@ -369,10 +369,10 @@ void setup() // INIT DELAY for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - delay_mixer.gain(instance_id, 0.0); + delay_mixer.gain(instance_id, mapfloat(configuration.dexed[instance_id].delay_send, DELAY_SEND_MIN, DELAY_SEND_MAX, 0.0, 1.0)); master_mixer_r.gain(DELAY, 1.0); master_mixer_l.gain(DELAY, 1.0); - delay1.delay(0, mapfloat(configuration.delay_time, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); + delay1.delay(0, mapfloat(configuration.delay_time * 10, DELAY_TIME_MIN, DELAY_TIME_MAX, 0.0, float(DELAY_TIME_MAX))); // delay_fb_mixer is the feedback-adding mixer //delay_fb_mixer.gain(0, 1.0 - (mapfloat(configuration.delay_feedback, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 0.0, 1.0))); // original signal delay_fb_mixer.gain(0, 1.0); // original signal @@ -380,7 +380,7 @@ void setup() // INIT CHORUS for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) - chorus_mixer.gain(instance_id, 0.0); + chorus_mixer.gain(instance_id, mapfloat(configuration.dexed[instance_id].chorus_send, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 0.0, 1.0)); master_mixer_r.gain(CHORUS, 1.0); master_mixer_l.gain(CHORUS, 1.0); switch (configuration.chorus_waveform) @@ -395,6 +395,7 @@ void setup() modulator.begin(WAVEFORM_TRIANGLE); } modulator.phase(0); + modulator.frequency(configuration.chorus_frequency / 10.0); modulator.amplitude(mapfloat(configuration.chorus_depth, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 0.0, 1.0)); modulator.offset(0.0); #if MOD_FILTER_OUTPUT == MOD_BUTTERWORTH_FILTER_OUTPUT @@ -411,6 +412,8 @@ void setup() modchorus_inverter.gain(-1.0); // stereo mode else modchorus_inverter.gain(1.0); // mono mode + + // Filter for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++) { soften_filter_res[instance_id].init(configuration.dexed[instance_id].filter_resonance); diff --git a/config.h b/config.h index 6c5d357..efd621d 100644 --- a/config.h +++ b/config.h @@ -81,7 +81,7 @@ // CHORUS parameters #define MOD_DELAY_SAMPLE_BUFFER int32_t(TIME_MS2SAMPLES(20.0)) // 20.0 ms delay buffer. #define MOD_WAVEFORM WAVEFORM_TRIANGLE // WAVEFORM_SINE WAVEFORM_TRIANGLE WAVEFORM_SAWTOOTH WAVEFORM_SAWTOOTH_REVERSE -#define MOD_FILTER_OUTPUT MOD_LINKWITZ_RILEY_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT +#define MOD_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT // MOD_LINKWITZ_RILEY_FILTER_OUTPUT MOD_BUTTERWORTH_FILTER_OUTPUT MOD_NO_FILTER_OUTPUT #define MOD_FILTER_CUTOFF_HZ 3000 #define USE_REVERB 1 @@ -228,9 +228,9 @@ enum { DEXED, REVERB, DELAY, CHORUS }; // Teensy-3.6 settings #define MIDI_DEVICE_USB_HOST 1 #if defined(USE_REVERB) -#define MAX_NOTES 12 +#define MAX_NOTES 11 #else -#define MAX_NOTES 16 +#define MAX_NOTES 14 #endif #endif