From 07048b543ea710da0fa7632244bf8059d283d3d5 Mon Sep 17 00:00:00 2001 From: dronus Date: Tue, 27 Mar 2018 18:16:12 +0200 Subject: [PATCH] allow frequency() to store basef outside the limits to allow full range modulation via control in. --- filter_moog_f32.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter_moog_f32.h b/filter_moog_f32.h index 30ab716..9e6c179 100644 --- a/filter_moog_f32.h +++ b/filter_moog_f32.h @@ -60,12 +60,12 @@ public: y_d_1 = 0; } void frequency(float freq,bool setf=true) { + if(setf) + basef=freq; if (freq < 20.0) freq = 20.0; else if (freq > AUDIO_SAMPLE_RATE_EXACT/2.5) freq = AUDIO_SAMPLE_RATE_EXACT/2.5; g = 1 - expf(-2 * tanf(2 * M_PI * freq/(2 * AUDIO_SAMPLE_RATE_EXACT))); // Serial.println(freq); - if(setf) - basef=freq; } void resonance(float qi) { if (qi < 0.7) qi = 0.7;