summaryrefslogtreecommitdiffstats
path: root/arts/modules/synth/synth_moog_vcf_impl.cc
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-12-08 22:26:17 +0900
commitfce86b22a2367f1be1f9aae5e1ba3d18d1371b74 (patch)
tree707fe84fef0569a152e632ce1e16407f9d19a3d2 /arts/modules/synth/synth_moog_vcf_impl.cc
parent41fa1afc2c571b909acd0312e4eebb4a0b21e3c2 (diff)
downloadtdemultimedia-fce86b22a2367f1be1f9aae5e1ba3d18d1371b74.tar.gz
tdemultimedia-fce86b22a2367f1be1f9aae5e1ba3d18d1371b74.zip
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'arts/modules/synth/synth_moog_vcf_impl.cc')
-rw-r--r--arts/modules/synth/synth_moog_vcf_impl.cc91
1 files changed, 0 insertions, 91 deletions
diff --git a/arts/modules/synth/synth_moog_vcf_impl.cc b/arts/modules/synth/synth_moog_vcf_impl.cc
deleted file mode 100644
index 77bf5394..00000000
--- a/arts/modules/synth/synth_moog_vcf_impl.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-
- Copyright (C) 2000 Jeff Tranter
- tranter@pobox.com
-
- (C) 1999 Stefan Westerfeld
- stefan@space.twc.de
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
- */
-
-#include "artsmodulessynth.h"
-#include "stdsynthmodule.h"
-
-using namespace Arts;
-
-/*
-Try this. It's a really nice 4pole. Very Moog like.
-
-in[x] and out[x] are member variables, init to 0.0
-the controls:
-
-fc = cutoff, nearly linear [0,1] -> [0, fs/2]
-res = resonance [0, 4] -> [no resonance, self-oscillation]
-*/
-
-class Synth_MOOG_VCF_impl : virtual public Synth_MOOG_VCF_skel,
- virtual public StdSynthModule
-{
-protected:
- float _frequency, _resonance;
- double freqcorrect;
- double in1, in2, in3, in4;
- double out1, out2, out3, out4;
-
-public:
- float frequency() { return _frequency; }
- void frequency(float newFrequency) { _frequency = newFrequency; }
-
- float resonance() { return _resonance; }
- void resonance(float newResonance) { _resonance = newResonance; }
-
- void streamInit()
- {
- in1 = in2 = in3 = in4 = out1 = out2 = out3 = out4 = 0.0;
- }
-
- void calculateBlock(unsigned long samples)
- {
- freqcorrect = 1.16 / (double)(samplingRate / 2);
-
- for (unsigned int i=0; i < samples; i++)
- {
- double input = invalue[i];
- double fc = _frequency;
- double res = _resonance;
- double f = fc * freqcorrect;
- double fb = res * (1.0 - 0.15 * f * f);
-
- input -= out4 * fb;
- input *= 0.35013 * (f * f) * (f * f);
-
- out1 = input + 0.3 * in1 + (1 - f) * out1; // Pole 1
- in1 = input;
- out2 = out1 + 0.3 * in2 + (1 - f) * out2; // Pole 2
- in2 = out1;
- out3 = out2 + 0.3 * in3 + (1 - f) * out3; // Pole 3
- in3 = out2;
- out4 = out3 + 0.3 * in4 + (1 - f) * out4; // Pole 4
- in4 = out3;
-
- outvalue[i] = out4;
- }
- }
-
-};
-
-REGISTER_IMPLEMENTATION(Synth_MOOG_VCF_impl);