From 8ece0379350b087ba09f4f56d6ae2fb8fbd42367 Mon Sep 17 00:00:00 2001 From: Paul Ferrand Date: Thu, 20 Feb 2020 15:19:16 +0100 Subject: [PATCH] Regenerated the filters with faust 2.20.2 --- src/sfizz/gen/filters/sfz2chApf1p.cxx | 95 +++++++--------- src/sfizz/gen/filters/sfz2chBpf1p.cxx | 101 +++++++---------- src/sfizz/gen/filters/sfz2chBpf2p.cxx | 101 +++++++---------- src/sfizz/gen/filters/sfz2chBpf2pSv.cxx | 98 +++++++--------- src/sfizz/gen/filters/sfz2chBpf4p.cxx | 103 +++++++---------- src/sfizz/gen/filters/sfz2chBpf6p.cxx | 131 +++++++++------------- src/sfizz/gen/filters/sfz2chBrf1p.cxx | 101 +++++++---------- src/sfizz/gen/filters/sfz2chBrf2p.cxx | 93 ++++++---------- src/sfizz/gen/filters/sfz2chBrf2pSv.cxx | 95 ++++++---------- src/sfizz/gen/filters/sfz2chEq.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfz2chHpf1p.cxx | 99 +++++++---------- src/sfizz/gen/filters/sfz2chHpf2p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfz2chHpf2pSv.cxx | 95 ++++++---------- src/sfizz/gen/filters/sfz2chHpf4p.cxx | 98 +++++++--------- src/sfizz/gen/filters/sfz2chHpf6p.cxx | 100 +++++++---------- src/sfizz/gen/filters/sfz2chHsh.cxx | 113 ++++++++----------- src/sfizz/gen/filters/sfz2chLpf1p.cxx | 99 +++++++---------- src/sfizz/gen/filters/sfz2chLpf2p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfz2chLpf2pSv.cxx | 95 ++++++---------- src/sfizz/gen/filters/sfz2chLpf4p.cxx | 98 +++++++--------- src/sfizz/gen/filters/sfz2chLpf6p.cxx | 100 +++++++---------- src/sfizz/gen/filters/sfz2chLsh.cxx | 119 ++++++++------------ src/sfizz/gen/filters/sfz2chPeq.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfz2chPink.cxx | 52 +++------ src/sfizz/gen/filters/sfzApf1p.cxx | 94 +++++++--------- src/sfizz/gen/filters/sfzBpf1p.cxx | 97 +++++++--------- src/sfizz/gen/filters/sfzBpf2p.cxx | 100 +++++++---------- src/sfizz/gen/filters/sfzBpf2pSv.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfzBpf4p.cxx | 101 +++++++---------- src/sfizz/gen/filters/sfzBpf6p.cxx | 130 +++++++++------------- src/sfizz/gen/filters/sfzBrf1p.cxx | 97 +++++++--------- src/sfizz/gen/filters/sfzBrf2p.cxx | 92 ++++++--------- src/sfizz/gen/filters/sfzBrf2pSv.cxx | 93 ++++++---------- src/sfizz/gen/filters/sfzEq.cxx | 95 +++++++--------- src/sfizz/gen/filters/sfzHpf1p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfzHpf2p.cxx | 95 +++++++--------- src/sfizz/gen/filters/sfzHpf2pSv.cxx | 93 ++++++---------- src/sfizz/gen/filters/sfzHpf4p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfzHpf6p.cxx | 97 +++++++--------- src/sfizz/gen/filters/sfzHsh.cxx | 138 ++++++++++------------- src/sfizz/gen/filters/sfzLpf1p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfzLpf2p.cxx | 95 +++++++--------- src/sfizz/gen/filters/sfzLpf2pSv.cxx | 93 ++++++---------- src/sfizz/gen/filters/sfzLpf4p.cxx | 96 +++++++--------- src/sfizz/gen/filters/sfzLpf6p.cxx | 97 +++++++--------- src/sfizz/gen/filters/sfzLsh.cxx | 142 ++++++++++-------------- src/sfizz/gen/filters/sfzPeq.cxx | 95 +++++++--------- src/sfizz/gen/filters/sfzPink.cxx | 48 +++----- 48 files changed, 1897 insertions(+), 2845 deletions(-) diff --git a/src/sfizz/gen/filters/sfz2chApf1p.cxx b/src/sfizz/gen/filters/sfz2chApf1p.cxx index e67c3fc6..08c62853 100644 --- a/src/sfizz/gen/filters/sfz2chApf1p.cxx +++ b/src/sfizz/gen/filters/sfz2chApf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chApf1p_H__ @@ -11,50 +11,49 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chApf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chApf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faust2chApf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -87,80 +84,68 @@ class faust2chApf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (6.2831853071795862 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (6.2831853071795862 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chApf1p* clone() { return new faust2chApf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0]))); fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1])); @@ -168,9 +153,7 @@ class faust2chApf1p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBpf1p.cxx b/src/sfizz/gen/filters/sfz2chBpf1p.cxx index bbcefe50..9aa4ab02 100644 --- a/src/sfizz/gen/filters/sfz2chBpf1p.cxx +++ b/src/sfizz/gen/filters/sfz2chBpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf1p_H__ @@ -11,52 +11,51 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec2[2]; double fRec1[2]; double fRec0[2]; double fRec4[2]; double fRec3[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -69,14 +68,12 @@ class faust2chBpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -89,95 +86,81 @@ class faust2chBpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec1[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec4[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBpf1p* clone() { return new faust2chBpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1); - fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0); + fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1])); double fTemp2 = (1.0 - fRec2[0]); fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1])); double fTemp3 = (fRec2[0] + 1.0); double fTemp4 = (0.0 - (0.5 * fTemp3)); output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4))); - fRec4[0] = ((fRec2[0] * fRec4[1]) + fTemp1); + fRec4[0] = (fTemp1 + (fRec2[0] * fRec4[1])); fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1])); output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1]))); fRec2[1] = fRec2[0]; @@ -185,9 +168,7 @@ class faust2chBpf1p : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec4[1] = fRec4[0]; fRec3[1] = fRec3[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBpf2p.cxx b/src/sfizz/gen/filters/sfz2chBpf2p.cxx index 28610423..dd4a004e 100644 --- a/src/sfizz/gen/filters/sfz2chBpf2p.cxx +++ b/src/sfizz/gen/filters/sfz2chBpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faust2chBpf2p : public sfzFilterDsp { double fRec4[2]; double fRec5[2]; double fRec6[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,14 +71,12 @@ class faust2chBpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -92,92 +89,76 @@ class faust2chBpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec6[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBpf2p* clone() { return new faust2chBpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); @@ -186,18 +167,18 @@ class faust2chBpf2p : public sfzFilterDsp { double fSlow6 = (1.0 - fSlow0); double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6); double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6); - double fSlow9 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow9 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow10 = (fSlow9 * fSlow6); double fSlow11 = ((0.0 - fSlow9) * fSlow6); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow7); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow8); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow7); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow8); fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow10); - fRec4[0] = (fRec4[1] * fSlow0); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow11); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow10); + fRec4[0] = (fSlow0 * fRec4[1]); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow11); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2]))); output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2]))); @@ -210,9 +191,7 @@ class faust2chBpf2p : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBpf2pSv.cxx b/src/sfizz/gen/filters/sfz2chBpf2pSv.cxx index b16a4fa0..7191bb6c 100644 --- a/src/sfizz/gen/filters/sfz2chBpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfz2chBpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -44,23 +45,21 @@ class faust2chBpf2pSv : public sfzFilterDsp { double fRec6[2]; double fRec8[2]; double fRec9[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -73,14 +72,12 @@ class faust2chBpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -93,96 +90,79 @@ class faust2chBpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec6[l5] = 0.0; - } for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; - } for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) { fRec9[l7] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBpf2pSv* clone() { return new faust2chBpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); @@ -190,11 +170,11 @@ class faust2chBpf2pSv : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); double fTemp2 = (fSlow3 + fRec3[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0))); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0))); double fTemp3 = (fRec3[0] * fRec4[0]); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2)); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2)); double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fTemp5 = (fTemp3 * fTemp4); double fTemp6 = (fRec2[1] + fTemp5); @@ -202,7 +182,7 @@ class faust2chBpf2pSv : public sfzFilterDsp { fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6))); double fTemp7 = (fRec2[1] + (2.0 * fTemp5)); fRec2[0] = fTemp7; - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow4); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow4); output0[i] = FAUSTFLOAT((fRec0 * fRec6[0])); double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1]))); double fTemp9 = (fTemp3 * fTemp8); @@ -220,9 +200,7 @@ class faust2chBpf2pSv : public sfzFilterDsp { fRec6[1] = fRec6[0]; fRec8[1] = fRec8[0]; fRec9[1] = fRec9[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBpf4p.cxx b/src/sfizz/gen/filters/sfz2chBpf4p.cxx index b1548f38..a2afdc8f 100644 --- a/src/sfizz/gen/filters/sfz2chBpf4p.cxx +++ b/src/sfizz/gen/filters/sfz2chBpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -45,23 +46,21 @@ class faust2chBpf4p : public sfzFilterDsp { double fRec1[3]; double fRec8[3]; double fRec7[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -74,14 +73,12 @@ class faust2chBpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -94,106 +91,88 @@ class faust2chBpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec6[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec8[l7] = 0.0; - } for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) { fRec7[l8] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBpf4p* clone() { return new faust2chBpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); - double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (fSlow6 * fSlow7); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7); @@ -202,12 +181,12 @@ class faust2chBpf4p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow9); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow10); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow9); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow10); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = (fRec5[1] * fSlow0); - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow11); + fRec5[0] = (fSlow0 * fRec5[1]); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow11); fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2]))); fRec8[0] = (fTemp1 - ((fRec3[0] * fRec8[1]) + (fRec4[0] * fRec8[2]))); @@ -226,9 +205,7 @@ class faust2chBpf4p : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[2] = fRec7[1]; fRec7[1] = fRec7[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBpf6p.cxx b/src/sfizz/gen/filters/sfz2chBpf6p.cxx index f871c716..e9690ea2 100644 --- a/src/sfizz/gen/filters/sfz2chBpf6p.cxx +++ b/src/sfizz/gen/filters/sfz2chBpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf6p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -47,23 +48,21 @@ class faust2chBpf6p : public sfzFilterDsp { double fRec10[3]; double fRec9[3]; double fRec8[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -76,14 +75,12 @@ class faust2chBpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -96,114 +93,94 @@ class faust2chBpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { - fRec3[l1] = 0.0; - + fRec4[l1] = 0.0; } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } - for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fRec6[l3] = 0.0; - + for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { + fRec3[l3] = 0.0; } - for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) { - fRec4[l4] = 0.0; - + for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { + fRec6[l4] = 0.0; } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec7[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec2[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec1[l7] = 0.0; - } for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) { fRec10[l8] = 0.0; - } for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) { fRec9[l9] = 0.0; - } for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) { fRec8[l10] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBpf6p* clone() { return new faust2chBpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); - double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (fSlow6 * fSlow7); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7); @@ -212,19 +189,19 @@ class faust2chBpf6p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8); - fRec3[0] = (fRec3[1] * fSlow0); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9); - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow10); - fRec4[0] = (fTemp0 - ((fRec5[0] * fRec4[1]) + (fRec6[0] * fRec4[2]))); - fRec7[0] = (fSlow11 + (fRec7[1] * fSlow0)); - fRec2[0] = (((fRec3[0] * fRec4[1]) + ((fRec4[0] * fRec0[0]) + (fRec7[0] * fRec4[2]))) - ((fRec5[0] * fRec2[1]) + (fRec6[0] * fRec2[2]))); - fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec3[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec5[0] * fRec1[1]) + (fRec6[0] * fRec1[2]))); - output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec3[0] * fRec1[1])) + (fRec7[0] * fRec1[2]))); - fRec10[0] = (fTemp1 - ((fRec5[0] * fRec10[1]) + (fRec6[0] * fRec10[2]))); - fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec3[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec5[0] * fRec9[1]) + (fRec6[0] * fRec9[2]))); - fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec3[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec5[0] * fRec8[1]) + (fRec6[0] * fRec8[2]))); - output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec3[0] * fRec8[1])) + (fRec7[0] * fRec8[2]))); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow10); + fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); + fRec6[0] = (fSlow0 * fRec6[1]); + fRec7[0] = ((fSlow0 * fRec7[1]) + fSlow11); + fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); + fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); + output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2]))); + fRec10[0] = (fTemp1 - ((fRec4[0] * fRec10[1]) + (fRec5[0] * fRec10[2]))); + fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec6[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2]))); + fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec6[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2]))); + output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec6[0] * fRec8[1])) + (fRec7[0] * fRec8[2]))); fRec0[1] = fRec0[0]; fRec3[1] = fRec3[0]; fRec5[1] = fRec5[0]; @@ -242,9 +219,7 @@ class faust2chBpf6p : public sfzFilterDsp { fRec9[1] = fRec9[0]; fRec8[2] = fRec8[1]; fRec8[1] = fRec8[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBrf1p.cxx b/src/sfizz/gen/filters/sfz2chBrf1p.cxx index ad37272d..99b3bd51 100644 --- a/src/sfizz/gen/filters/sfz2chBrf1p.cxx +++ b/src/sfizz/gen/filters/sfz2chBrf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf1p_H__ @@ -11,52 +11,51 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBrf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBrf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec2[2]; double fRec1[2]; double fRec0[2]; double fRec4[2]; double fRec3[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -69,14 +68,12 @@ class faust2chBrf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -89,102 +86,86 @@ class faust2chBrf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (6.2831853071795862 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (6.2831853071795862 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec1[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec4[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBrf1p* clone() { return new faust2chBrf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1); + fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1])); fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1]))); - output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0)); + output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0])))); fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1])); fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1]))); - output1[i] = FAUSTFLOAT(((fRec3[1] + (fRec2[0] * fRec3[0])) + fTemp1)); + output1[i] = FAUSTFLOAT((fTemp1 + (fRec3[1] + (fRec2[0] * fRec3[0])))); fRec2[1] = fRec2[0]; fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; fRec4[1] = fRec4[0]; fRec3[1] = fRec3[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBrf2p.cxx b/src/sfizz/gen/filters/sfz2chBrf2p.cxx index eb209c91..044fb4f6 100644 --- a/src/sfizz/gen/filters/sfz2chBrf2p.cxx +++ b/src/sfizz/gen/filters/sfz2chBrf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBrf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBrf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -41,23 +42,21 @@ class faust2chBrf2p : public sfzFilterDsp { double fRec1[3]; double fRec3[2]; double fRec4[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -70,14 +69,12 @@ class faust2chBrf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -90,84 +87,70 @@ class faust2chBrf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec1[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBrf2p* clone() { return new faust2chBrf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); @@ -178,11 +161,11 @@ class faust2chBrf2p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow5); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow5); double fTemp2 = (fRec0[0] * fRec1[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow6); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow6); fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7); output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2])))); double fTemp3 = (fRec0[0] * fRec4[1]); fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2]))); @@ -194,9 +177,7 @@ class faust2chBrf2p : public sfzFilterDsp { fRec3[1] = fRec3[0]; fRec4[2] = fRec4[1]; fRec4[1] = fRec4[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chBrf2pSv.cxx b/src/sfizz/gen/filters/sfz2chBrf2pSv.cxx index 146cffbe..773f7fd7 100644 --- a/src/sfizz/gen/filters/sfz2chBrf2pSv.cxx +++ b/src/sfizz/gen/filters/sfz2chBrf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chBrf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chBrf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faust2chBrf2pSv : public sfzFilterDsp { double fRec3[2]; double fRec9[2]; double fRec10[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,14 +71,12 @@ class faust2chBrf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -92,102 +89,86 @@ class faust2chBrf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec5[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec6[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec9[l5] = 0.0; - } for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec10[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chBrf2pSv* clone() { return new faust2chBrf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow2); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2); double fTemp2 = (fSlow3 + fRec5[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec5[0] * fTemp2) + 1.0))); - fRec6[0] = ((fRec6[1] * fSlow0) + (fSlow1 * fTemp2)); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec5[0] * fTemp2) + 1.0))); + fRec6[0] = ((fSlow0 * fRec6[1]) + (fSlow1 * fTemp2)); double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1]))); double fRec0 = (fRec4[0] * fTemp3); double fTemp4 = (fRec5[0] * fRec4[0]); @@ -214,9 +195,7 @@ class faust2chBrf2pSv : public sfzFilterDsp { fRec3[1] = fRec3[0]; fRec9[1] = fRec9[0]; fRec10[1] = fRec10[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chEq.cxx b/src/sfizz/gen/filters/sfz2chEq.cxx index ce80c458..73fbe5a7 100644 --- a/src/sfizz/gen/filters/sfz2chEq.cxx +++ b/src/sfizz/gen/filters/sfz2chEq.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chEq_H__ @@ -11,7 +11,7 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif /* link with : "" */ #include @@ -19,19 +19,20 @@ Compilation options: -inpl -double -ftz 0 #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chEq #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chEq : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -45,23 +46,21 @@ class faust2chEq : public sfzFilterDsp { double fRec3[2]; double fRec4[2]; double fRec5[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -74,14 +73,12 @@ class faust2chEq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -94,90 +91,75 @@ class faust2chEq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); fConst3 = (2.1775860903036022 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fBandwidth = FAUSTFLOAT(1.0); fPkShGain = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chEq* clone() { return new faust2chEq(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::max(0.0, double(fCutoff)); double fSlow2 = (fConst2 * fSlow1); double fSlow3 = std::sin(fSlow2); @@ -194,12 +176,12 @@ class faust2chEq : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9); double fTemp2 = (fRec1[0] * fRec0[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10); fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2]))); double fTemp3 = (fRec1[0] * fRec5[1]); fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2]))); @@ -212,9 +194,7 @@ class faust2chEq : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec5[2] = fRec5[1]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHpf1p.cxx b/src/sfizz/gen/filters/sfz2chHpf1p.cxx index d5e2d06b..9040783f 100644 --- a/src/sfizz/gen/filters/sfz2chHpf1p.cxx +++ b/src/sfizz/gen/filters/sfz2chHpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf1p_H__ @@ -11,50 +11,49 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faust2chHpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -87,92 +84,78 @@ class faust2chHpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHpf1p* clone() { return new faust2chHpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); - fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); double fTemp2 = (fRec1[0] + 1.0); double fTemp3 = (0.0 - (0.5 * fTemp2)); output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3))); - fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1); + fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1])); output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1]))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHpf2p.cxx b/src/sfizz/gen/filters/sfz2chHpf2p.cxx index 4b7d152b..8e736886 100644 --- a/src/sfizz/gen/filters/sfz2chHpf2p.cxx +++ b/src/sfizz/gen/filters/sfz2chHpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -42,23 +43,21 @@ class faust2chHpf2p : public sfzFilterDsp { double fRec1[3]; double fRec4[2]; double fRec5[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -71,14 +70,12 @@ class faust2chHpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -91,88 +88,73 @@ class faust2chHpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec3[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHpf2p* clone() { return new faust2chHpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -185,11 +167,11 @@ class faust2chHpf2p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow7); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow7); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow8); fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2])))); fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2]))); output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2])))); @@ -201,9 +183,7 @@ class faust2chHpf2p : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec5[2] = fRec5[1]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHpf2pSv.cxx b/src/sfizz/gen/filters/sfz2chHpf2pSv.cxx index 40e6632a..4089b324 100644 --- a/src/sfizz/gen/filters/sfz2chHpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfz2chHpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faust2chHpf2pSv : public sfzFilterDsp { double fRec2[2]; double fRec7[2]; double fRec8[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,14 +71,12 @@ class faust2chHpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -92,102 +89,86 @@ class faust2chHpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec4[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec7[l5] = 0.0; - } for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHpf2pSv* clone() { return new faust2chHpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow2); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2); double fTemp2 = (fSlow3 + fRec4[0]); - fRec3[0] = ((fRec3[1] * fSlow0) + (fSlow1 / ((fRec4[0] * fTemp2) + 1.0))); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2)); + fRec3[0] = ((fSlow0 * fRec3[1]) + (fSlow1 / ((fRec4[0] * fTemp2) + 1.0))); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2)); double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fRec0 = (fRec3[0] * fTemp3); double fTemp4 = (fRec4[0] * fRec3[0]); @@ -212,9 +193,7 @@ class faust2chHpf2pSv : public sfzFilterDsp { fRec2[1] = fRec2[0]; fRec7[1] = fRec7[0]; fRec8[1] = fRec8[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHpf4p.cxx b/src/sfizz/gen/filters/sfz2chHpf4p.cxx index 21e30410..fe4145c4 100644 --- a/src/sfizz/gen/filters/sfz2chHpf4p.cxx +++ b/src/sfizz/gen/filters/sfz2chHpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -44,23 +45,21 @@ class faust2chHpf4p : public sfzFilterDsp { double fRec1[3]; double fRec7[3]; double fRec6[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -73,14 +72,12 @@ class faust2chHpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -93,96 +90,79 @@ class faust2chHpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec1[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec7[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec6[l7] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHpf4p* clone() { return new faust2chHpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -195,11 +175,11 @@ class faust2chHpf4p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow8); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2])))); fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2]))); @@ -217,9 +197,7 @@ class faust2chHpf4p : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHpf6p.cxx b/src/sfizz/gen/filters/sfz2chHpf6p.cxx index 36e9c9e5..9a309db1 100644 --- a/src/sfizz/gen/filters/sfz2chHpf6p.cxx +++ b/src/sfizz/gen/filters/sfz2chHpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf6p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -46,23 +47,21 @@ class faust2chHpf6p : public sfzFilterDsp { double fRec9[3]; double fRec8[3]; double fRec7[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -75,14 +74,12 @@ class faust2chHpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -95,104 +92,85 @@ class faust2chHpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec6[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec2[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec9[l7] = 0.0; - } for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) { fRec8[l8] = 0.0; - } for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) { fRec7[l9] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHpf6p* clone() { return new faust2chHpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -205,11 +183,11 @@ class faust2chHpf6p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow7); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow7); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow8); fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow9); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow9); fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2])))); @@ -233,9 +211,7 @@ class faust2chHpf6p : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[2] = fRec7[1]; fRec7[1] = fRec7[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chHsh.cxx b/src/sfizz/gen/filters/sfz2chHsh.cxx index a7ffb205..84d61a96 100644 --- a/src/sfizz/gen/filters/sfz2chHsh.cxx +++ b/src/sfizz/gen/filters/sfz2chHsh.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHsh_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chHsh #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chHsh : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fPkShGain; @@ -44,23 +45,21 @@ class faust2chHsh : public sfzFilterDsp { double fRec4[2]; double fRec5[2]; double fRec6[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -73,14 +72,12 @@ class faust2chHsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -93,116 +90,100 @@ class faust2chHsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fPkShGain = FAUSTFLOAT(0.0); fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec6[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chHsh* clone() { return new faust2chHsh(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); double fSlow2 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); - double fSlow6 = ((fSlow1 + -1.0) * fSlow3); + double fSlow6 = (fSlow3 * (fSlow1 + -1.0)); double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6)); double fSlow8 = (1.0 - fSlow0); double fSlow9 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8); - double fSlow10 = (((fSlow1 + (1.0 - (fSlow6 + fSlow5))) / fSlow7) * fSlow8); - double fSlow11 = (fSlow6 + fSlow1); - double fSlow12 = (((((fSlow11 + fSlow5) + 1.0) * fSlow1) / fSlow7) * fSlow8); - double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow4 + fSlow1) + -1.0)) / fSlow7) * fSlow8); - double fSlow14 = ((((fSlow11 + (1.0 - fSlow5)) * fSlow1) / fSlow7) * fSlow8); + double fSlow10 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8); + double fSlow11 = (fSlow1 + fSlow6); + double fSlow12 = (((fSlow1 * ((fSlow5 + fSlow11) + 1.0)) / fSlow7) * fSlow8); + double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8); + double fSlow14 = (((fSlow1 * (fSlow11 + (1.0 - fSlow5))) / fSlow7) * fSlow8); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10); fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2]))); output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2]))); @@ -215,9 +196,7 @@ class faust2chHsh : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLpf1p.cxx b/src/sfizz/gen/filters/sfz2chLpf1p.cxx index e83bcd27..a11d4fa6 100644 --- a/src/sfizz/gen/filters/sfz2chLpf1p.cxx +++ b/src/sfizz/gen/filters/sfz2chLpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf1p_H__ @@ -11,50 +11,49 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faust2chLpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -87,91 +84,77 @@ class faust2chLpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLpf1p* clone() { return new faust2chLpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); - fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); double fTemp2 = (1.0 - fRec1[0]); output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2)); - fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1); + fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1])); output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2)); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLpf2p.cxx b/src/sfizz/gen/filters/sfz2chLpf2p.cxx index 392e67ac..15b7418d 100644 --- a/src/sfizz/gen/filters/sfz2chLpf2p.cxx +++ b/src/sfizz/gen/filters/sfz2chLpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -42,23 +43,21 @@ class faust2chLpf2p : public sfzFilterDsp { double fRec1[3]; double fRec4[2]; double fRec5[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -71,14 +70,12 @@ class faust2chLpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -91,82 +88,67 @@ class faust2chLpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec3[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLpf2p* clone() { return new faust2chLpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; @@ -177,7 +159,7 @@ class faust2chLpf2p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -186,11 +168,11 @@ class faust2chLpf2p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec2[0] = ((fRec2[1] * fSlow5) + fSlow8); - fRec3[0] = ((fRec3[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec2[0] = ((fSlow5 * fRec2[1]) + fSlow8); + fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow9); fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow10); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow10); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2])))); fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2]))); output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2])))); @@ -202,9 +184,7 @@ class faust2chLpf2p : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec5[2] = fRec5[1]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLpf2pSv.cxx b/src/sfizz/gen/filters/sfz2chLpf2pSv.cxx index 51397800..2bc4fe1a 100644 --- a/src/sfizz/gen/filters/sfz2chLpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfz2chLpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faust2chLpf2pSv : public sfzFilterDsp { double fRec2[2]; double fRec7[2]; double fRec8[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,14 +71,12 @@ class faust2chLpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -92,103 +89,87 @@ class faust2chLpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec7[l5] = 0.0; - } for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLpf2pSv* clone() { return new faust2chLpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); double fTemp2 = (fSlow3 + fRec3[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0))); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0))); double fTemp3 = (fRec3[0] * fRec4[0]); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2)); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2)); double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fTemp5 = (fTemp3 * fTemp4); double fTemp6 = (fRec2[1] + (2.0 * fTemp5)); @@ -212,9 +193,7 @@ class faust2chLpf2pSv : public sfzFilterDsp { fRec2[1] = fRec2[0]; fRec7[1] = fRec7[0]; fRec8[1] = fRec8[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLpf4p.cxx b/src/sfizz/gen/filters/sfz2chLpf4p.cxx index 663b3cd7..78eee570 100644 --- a/src/sfizz/gen/filters/sfz2chLpf4p.cxx +++ b/src/sfizz/gen/filters/sfz2chLpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -44,23 +45,21 @@ class faust2chLpf4p : public sfzFilterDsp { double fRec1[3]; double fRec7[3]; double fRec6[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -73,14 +72,12 @@ class faust2chLpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -93,90 +90,73 @@ class faust2chLpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec1[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec7[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec6[l7] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLpf4p* clone() { return new faust2chLpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; @@ -187,7 +167,7 @@ class faust2chLpf4p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -196,11 +176,11 @@ class faust2chLpf4p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec3[0] = ((fRec3[1] * fSlow5) + fSlow8); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow8); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow9); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = ((fRec5[1] * fSlow5) + fSlow10); + fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow10); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2])))); fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2]))); @@ -218,9 +198,7 @@ class faust2chLpf4p : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLpf6p.cxx b/src/sfizz/gen/filters/sfz2chLpf6p.cxx index 2f253272..9e493826 100644 --- a/src/sfizz/gen/filters/sfz2chLpf6p.cxx +++ b/src/sfizz/gen/filters/sfz2chLpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf6p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -46,23 +47,21 @@ class faust2chLpf6p : public sfzFilterDsp { double fRec9[3]; double fRec8[3]; double fRec7[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -75,14 +74,12 @@ class faust2chLpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -95,98 +92,79 @@ class faust2chLpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec6[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec2[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec9[l7] = 0.0; - } for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) { fRec8[l8] = 0.0; - } for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) { fRec7[l9] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLpf6p* clone() { return new faust2chLpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; @@ -197,7 +175,7 @@ class faust2chLpf6p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -206,11 +184,11 @@ class faust2chLpf6p : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow8); - fRec5[0] = ((fRec5[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow8); + fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow9); fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); - fRec6[0] = ((fRec6[1] * fSlow5) + fSlow10); + fRec6[0] = ((fSlow5 * fRec6[1]) + fSlow10); fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2])))); @@ -234,9 +212,7 @@ class faust2chLpf6p : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[2] = fRec7[1]; fRec7[1] = fRec7[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chLsh.cxx b/src/sfizz/gen/filters/sfz2chLsh.cxx index 1c8a1696..38f8f4ff 100644 --- a/src/sfizz/gen/filters/sfz2chLsh.cxx +++ b/src/sfizz/gen/filters/sfz2chLsh.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLsh_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chLsh #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chLsh : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fPkShGain; @@ -44,23 +45,21 @@ class faust2chLsh : public sfzFilterDsp { double fRec4[2]; double fRec5[2]; double fRec6[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -73,14 +72,12 @@ class faust2chLsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -93,116 +90,100 @@ class faust2chLsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fPkShGain = FAUSTFLOAT(0.0); fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec6[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chLsh* clone() { return new faust2chLsh(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); double fSlow2 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = ((fSlow1 + 1.0) * fSlow3); - double fSlow5 = ((fSlow1 + -1.0) * fSlow3); - double fSlow6 = (fSlow5 + fSlow1); - double fSlow7 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); - double fSlow8 = ((fSlow6 + fSlow7) + 1.0); + double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); + double fSlow6 = (fSlow3 * (fSlow1 + -1.0)); + double fSlow7 = (fSlow1 + fSlow6); + double fSlow8 = ((fSlow5 + fSlow7) + 1.0); double fSlow9 = (1.0 - fSlow0); - double fSlow10 = (((0.0 - (2.0 * ((fSlow4 + fSlow1) + -1.0))) / fSlow8) * fSlow9); - double fSlow11 = (((fSlow6 + (1.0 - fSlow7)) / fSlow8) * fSlow9); - double fSlow12 = (((((fSlow1 + fSlow7) + (1.0 - fSlow5)) * fSlow1) / fSlow8) * fSlow9); - double fSlow13 = ((2.0 * (((fSlow1 + (-1.0 - fSlow4)) * fSlow1) / fSlow8)) * fSlow9); - double fSlow14 = ((((fSlow1 + (1.0 - (fSlow5 + fSlow7))) * fSlow1) / fSlow8) * fSlow9); + double fSlow10 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9); + double fSlow11 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9); + double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9); + double fSlow13 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9); + double fSlow14 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow10); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow11); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow10); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow11); fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2]))); output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2]))); @@ -215,9 +196,7 @@ class faust2chLsh : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec6[2] = fRec6[1]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chPeq.cxx b/src/sfizz/gen/filters/sfz2chPeq.cxx index 7f4db7dc..886f3771 100644 --- a/src/sfizz/gen/filters/sfz2chPeq.cxx +++ b/src/sfizz/gen/filters/sfz2chPeq.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chPeq_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chPeq #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faust2chPeq : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faust2chPeq : public sfzFilterDsp { double fRec3[2]; double fRec4[2]; double fRec5[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,14 +71,12 @@ class faust2chPeq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -92,89 +89,74 @@ class faust2chPeq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); fPkShGain = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faust2chPeq* clone() { return new faust2chPeq(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); @@ -190,12 +172,12 @@ class faust2chPeq : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow8); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow8); double fTemp2 = (fRec1[0] * fRec0[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow9); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow9); fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow11); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow12); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow12); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2]))); double fTemp3 = (fRec1[0] * fRec5[1]); fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2]))); @@ -208,9 +190,7 @@ class faust2chPeq : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec5[2] = fRec5[1]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfz2chPink.cxx b/src/sfizz/gen/filters/sfz2chPink.cxx index 507a8f63..09103050 100644 --- a/src/sfizz/gen/filters/sfz2chPink.cxx +++ b/src/sfizz/gen/filters/sfz2chPink.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chPink_H__ @@ -20,6 +20,7 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTCLASS #define FAUSTCLASS faust2chPink #endif + #ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 @@ -31,7 +32,7 @@ class faust2chPink : public sfzFilterDsp { double fRec0[4]; double fRec1[4]; - int fSamplingFreq; + int fSampleRate; public: @@ -40,15 +41,13 @@ class faust2chPink : public sfzFilterDsp { virtual int getNumInputs() { return 2; - } virtual int getNumOutputs() { return 2; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -61,14 +60,12 @@ class faust2chPink : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -81,44 +78,35 @@ class faust2chPink : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - static void classInit(int samplingFreq) { - + static void classInit(int sample_rate) { } - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; } virtual void instanceResetUserInterface() { - } virtual void instanceClear() { for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) { fRec1[l1] = 0.0; - } - } - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } @@ -128,12 +116,10 @@ class faust2chPink : public sfzFilterDsp { } virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } virtual void buildUserInterface(UI* ui_interface) { - } virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { @@ -144,21 +130,17 @@ class faust2chPink : public sfzFilterDsp { for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2])); + fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2])); output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3])))); - fRec1[0] = ((((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3])) + fTemp1) - (2.0172658750000001 * fRec1[2])); + fRec1[0] = ((fTemp1 + ((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3]))) - (2.0172658750000001 * fRec1[2])); output1[i] = FAUSTFLOAT((((0.049922034999999997 * fRec1[0]) + (0.050612698999999997 * fRec1[2])) - ((0.095993537000000004 * fRec1[1]) + (0.0044087859999999996 * fRec1[3])))); for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) { fRec0[j0] = fRec0[(j0 - 1)]; - } for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) { fRec1[j1] = fRec1[(j1 - 1)]; - } - } - } }; diff --git a/src/sfizz/gen/filters/sfzApf1p.cxx b/src/sfizz/gen/filters/sfzApf1p.cxx index 39652364..950129a6 100644 --- a/src/sfizz/gen/filters/sfzApf1p.cxx +++ b/src/sfizz/gen/filters/sfzApf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustApf1p_H__ @@ -11,49 +11,48 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustApf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustApf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -62,14 +61,12 @@ class faustApf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -78,80 +75,67 @@ class faustApf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (6.2831853071795862 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (6.2831853071795862 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustApf1p* clone() { return new faustApf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0]))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBpf1p.cxx b/src/sfizz/gen/filters/sfzBpf1p.cxx index 8cf0e6f7..0273c976 100644 --- a/src/sfizz/gen/filters/sfzBpf1p.cxx +++ b/src/sfizz/gen/filters/sfzBpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf1p_H__ @@ -11,50 +11,49 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec2[2]; double fRec1[2]; double fRec0[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -63,14 +62,12 @@ class faustBpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -79,87 +76,73 @@ class faustBpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec1[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBpf1p* clone() { return new faustBpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1); - fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0); + fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1])); fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1])); double fTemp1 = (fRec2[0] + 1.0); output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1))))); fRec2[1] = fRec2[0]; fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBpf2p.cxx b/src/sfizz/gen/filters/sfzBpf2p.cxx index 70150c2a..c609d628 100644 --- a/src/sfizz/gen/filters/sfzBpf2p.cxx +++ b/src/sfizz/gen/filters/sfzBpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -42,23 +43,21 @@ class faustBpf2p : public sfzFilterDsp { double fRec3[2]; double fRec4[2]; double fRec5[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faustBpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -83,86 +80,71 @@ class faustBpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBpf2p* clone() { return new faustBpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); @@ -171,17 +153,17 @@ class faustBpf2p : public sfzFilterDsp { double fSlow6 = (1.0 - fSlow0); double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6); double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6); - double fSlow9 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow9 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow10 = (fSlow9 * fSlow6); double fSlow11 = ((0.0 - fSlow9) * fSlow6); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow7); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow8); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow7); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow8); fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow10); - fRec4[0] = (fRec4[1] * fSlow0); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow11); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow10); + fRec4[0] = (fSlow0 * fRec4[1]); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow11); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; @@ -190,9 +172,7 @@ class faustBpf2p : public sfzFilterDsp { fRec3[1] = fRec3[0]; fRec4[1] = fRec4[0]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBpf2pSv.cxx b/src/sfizz/gen/filters/sfzBpf2pSv.cxx index ac6f9d39..00d33c90 100644 --- a/src/sfizz/gen/filters/sfzBpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfzBpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -42,23 +43,21 @@ class faustBpf2pSv : public sfzFilterDsp { double fRec1[2]; double fRec2[2]; double fRec6[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faustBpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -83,96 +80,81 @@ class faustBpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec6[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBpf2pSv* clone() { return new faustBpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); double fSlow4 = (fSlow3 * fSlow1); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); double fTemp1 = (fSlow3 + fRec3[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0))); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1)); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0))); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1)); double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2); double fTemp4 = (fRec2[1] + fTemp3); @@ -180,7 +162,7 @@ class faustBpf2pSv : public sfzFilterDsp { fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4))); double fTemp5 = (fRec2[1] + (2.0 * fTemp3)); fRec2[0] = fTemp5; - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow4); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow4); output0[i] = FAUSTFLOAT((fRec0 * fRec6[0])); fRec3[1] = fRec3[0]; fRec4[1] = fRec4[0]; @@ -188,9 +170,7 @@ class faustBpf2pSv : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; fRec6[1] = fRec6[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBpf4p.cxx b/src/sfizz/gen/filters/sfzBpf4p.cxx index 548341fa..2b3a8731 100644 --- a/src/sfizz/gen/filters/sfzBpf4p.cxx +++ b/src/sfizz/gen/filters/sfzBpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faustBpf4p : public sfzFilterDsp { double fRec5[2]; double fRec6[2]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -68,14 +67,12 @@ class faustBpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -84,96 +81,80 @@ class faustBpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec6[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBpf4p* clone() { return new faustBpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); - double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (fSlow6 * fSlow7); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7); @@ -181,12 +162,12 @@ class faustBpf4p : public sfzFilterDsp { double fSlow11 = ((0.0 - fSlow6) * fSlow7); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow9); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow10); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow9); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow10); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = (fRec5[1] * fSlow0); - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow11); + fRec5[0] = (fSlow0 * fRec5[1]); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow11); fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2]))); fRec0[1] = fRec0[0]; @@ -198,9 +179,7 @@ class faustBpf4p : public sfzFilterDsp { fRec6[1] = fRec6[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBpf6p.cxx b/src/sfizz/gen/filters/sfzBpf6p.cxx index b3d323a5..dff814f2 100644 --- a/src/sfizz/gen/filters/sfzBpf6p.cxx +++ b/src/sfizz/gen/filters/sfzBpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf6p_H__ @@ -11,56 +11,55 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; FAUSTFLOAT fCutoff; FAUSTFLOAT fQ; double fRec0[2]; - double fRec4[2]; + double fRec3[2]; double fRec5[2]; - double fRec3[3]; double fRec6[2]; + double fRec4[3]; double fRec7[2]; double fRec2[3]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -69,14 +68,12 @@ class faustBpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -85,100 +82,83 @@ class faustBpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { - fRec4[l1] = 0.0; - + fRec3[l1] = 0.0; } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } - for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { - fRec3[l3] = 0.0; - + for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { + fRec6[l3] = 0.0; } - for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { - fRec6[l4] = 0.0; - + for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) { + fRec4[l4] = 0.0; } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec7[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec2[l6] = 0.0; - } for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) { fRec1[l7] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBpf6p* clone() { return new faustBpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); - double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3))); + double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (fSlow6 * fSlow7); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7); @@ -186,29 +166,27 @@ class faustBpf6p : public sfzFilterDsp { double fSlow11 = ((0.0 - fSlow6) * fSlow7); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow10); - fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); - fRec6[0] = (fRec6[1] * fSlow0); - fRec7[0] = ((fRec7[1] * fSlow0) + fSlow11); - fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); - fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); - output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2]))); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8); + fRec3[0] = (fSlow0 * fRec3[1]); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow10); + fRec4[0] = (fTemp0 - ((fRec5[0] * fRec4[1]) + (fRec6[0] * fRec4[2]))); + fRec7[0] = ((fSlow0 * fRec7[1]) + fSlow11); + fRec2[0] = (((fRec3[0] * fRec4[1]) + ((fRec4[0] * fRec0[0]) + (fRec7[0] * fRec4[2]))) - ((fRec5[0] * fRec2[1]) + (fRec6[0] * fRec2[2]))); + fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec3[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec5[0] * fRec1[1]) + (fRec6[0] * fRec1[2]))); + output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec3[0] * fRec1[1])) + (fRec7[0] * fRec1[2]))); fRec0[1] = fRec0[0]; - fRec4[1] = fRec4[0]; - fRec5[1] = fRec5[0]; - fRec3[2] = fRec3[1]; fRec3[1] = fRec3[0]; + fRec5[1] = fRec5[0]; fRec6[1] = fRec6[0]; + fRec4[2] = fRec4[1]; + fRec4[1] = fRec4[0]; fRec7[1] = fRec7[0]; fRec2[2] = fRec2[1]; fRec2[1] = fRec2[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBrf1p.cxx b/src/sfizz/gen/filters/sfzBrf1p.cxx index 2300a7a6..88eaa643 100644 --- a/src/sfizz/gen/filters/sfzBrf1p.cxx +++ b/src/sfizz/gen/filters/sfzBrf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf1p_H__ @@ -11,50 +11,49 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBrf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBrf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec2[2]; double fRec1[2]; double fRec0[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -63,14 +62,12 @@ class faustBrf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -79,86 +76,72 @@ class faustBrf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (6.2831853071795862 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (6.2831853071795862 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec1[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBrf1p* clone() { return new faustBrf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1); + fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1])); fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1]))); - output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0)); + output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0])))); fRec2[1] = fRec2[0]; fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBrf2p.cxx b/src/sfizz/gen/filters/sfzBrf2p.cxx index ad02048c..9705729c 100644 --- a/src/sfizz/gen/filters/sfzBrf2p.cxx +++ b/src/sfizz/gen/filters/sfzBrf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBrf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBrf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -40,23 +41,21 @@ class faustBrf2p : public sfzFilterDsp { double fRec2[2]; double fRec1[3]; double fRec3[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -65,14 +64,12 @@ class faustBrf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -81,78 +78,65 @@ class faustBrf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec1[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBrf2p* clone() { return new faustBrf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); @@ -162,20 +146,18 @@ class faustBrf2p : public sfzFilterDsp { double fSlow7 = ((1.0 / fSlow3) * fSlow4); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow5); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow5); double fTemp1 = (fRec0[0] * fRec1[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow6); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow6); fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7); output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2])))); fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; fRec3[1] = fRec3[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzBrf2pSv.cxx b/src/sfizz/gen/filters/sfzBrf2pSv.cxx index 2390844c..dc10acf0 100644 --- a/src/sfizz/gen/filters/sfzBrf2pSv.cxx +++ b/src/sfizz/gen/filters/sfzBrf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustBrf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustBrf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -41,23 +42,21 @@ class faustBrf2pSv : public sfzFilterDsp { double fRec6[2]; double fRec2[2]; double fRec3[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -66,14 +65,12 @@ class faustBrf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -82,91 +79,77 @@ class faustBrf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec5[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec6[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustBrf2pSv* clone() { return new faustBrf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow2); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2); double fTemp1 = (fSlow3 + fRec5[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec5[0] * fTemp1) + 1.0))); - fRec6[0] = ((fRec6[1] * fSlow0) + (fSlow1 * fTemp1)); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec5[0] * fTemp1) + 1.0))); + fRec6[0] = ((fSlow0 * fRec6[1]) + (fSlow1 * fTemp1)); double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1]))); double fRec0 = (fRec4[0] * fTemp2); double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2); @@ -181,9 +164,7 @@ class faustBrf2pSv : public sfzFilterDsp { fRec6[1] = fRec6[0]; fRec2[1] = fRec2[0]; fRec3[1] = fRec3[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzEq.cxx b/src/sfizz/gen/filters/sfzEq.cxx index be5b7015..c0de8618 100644 --- a/src/sfizz/gen/filters/sfzEq.cxx +++ b/src/sfizz/gen/filters/sfzEq.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustEq_H__ @@ -11,7 +11,7 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif /* link with : "" */ #include @@ -19,19 +19,20 @@ Compilation options: -inpl -double -ftz 0 #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustEq #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustEq : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -44,23 +45,21 @@ class faustEq : public sfzFilterDsp { double fRec0[3]; double fRec3[2]; double fRec4[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -69,14 +68,12 @@ class faustEq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -85,84 +82,70 @@ class faustEq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); fConst3 = (2.1775860903036022 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fBandwidth = FAUSTFLOAT(1.0); fPkShGain = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustEq* clone() { return new faustEq(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::max(0.0, double(fCutoff)); double fSlow2 = (fConst2 * fSlow1); double fSlow3 = std::sin(fSlow2); @@ -178,12 +161,12 @@ class faustEq : public sfzFilterDsp { double fSlow13 = (((1.0 - fSlow11) / fSlow7) * fSlow8); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9); double fTemp1 = (fRec1[0] * fRec0[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10); fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2]))); fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; @@ -191,9 +174,7 @@ class faustEq : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec3[1] = fRec3[0]; fRec4[1] = fRec4[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHpf1p.cxx b/src/sfizz/gen/filters/sfzHpf1p.cxx index 34582e9d..4e0cf748 100644 --- a/src/sfizz/gen/filters/sfzHpf1p.cxx +++ b/src/sfizz/gen/filters/sfzHpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf1p_H__ @@ -11,49 +11,48 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -62,14 +61,12 @@ class faustHpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -78,81 +75,68 @@ class faustHpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHpf1p* clone() { return new faustHpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); - fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); double fTemp1 = (fRec1[0] + 1.0); output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1))))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHpf2p.cxx b/src/sfizz/gen/filters/sfzHpf2p.cxx index dbef6747..2a77dc90 100644 --- a/src/sfizz/gen/filters/sfzHpf2p.cxx +++ b/src/sfizz/gen/filters/sfzHpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -41,23 +42,21 @@ class faustHpf2p : public sfzFilterDsp { double fRec3[2]; double fRec1[3]; double fRec4[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -66,14 +65,12 @@ class faustHpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -82,82 +79,68 @@ class faustHpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec3[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHpf2p* clone() { return new faustHpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -169,11 +152,11 @@ class faustHpf2p : public sfzFilterDsp { double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow7); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow7); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow8); fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2])))); fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; @@ -181,9 +164,7 @@ class faustHpf2p : public sfzFilterDsp { fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; fRec4[1] = fRec4[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHpf2pSv.cxx b/src/sfizz/gen/filters/sfzHpf2pSv.cxx index 4cbcc019..12fa8259 100644 --- a/src/sfizz/gen/filters/sfzHpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfzHpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -41,23 +42,21 @@ class faustHpf2pSv : public sfzFilterDsp { double fRec5[2]; double fRec1[2]; double fRec2[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -66,14 +65,12 @@ class faustHpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -82,91 +79,77 @@ class faustHpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec4[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHpf2pSv* clone() { return new faustHpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow2); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2); double fTemp1 = (fSlow3 + fRec4[0]); - fRec3[0] = ((fRec3[1] * fSlow0) + (fSlow1 / ((fRec4[0] * fTemp1) + 1.0))); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1)); + fRec3[0] = ((fSlow0 * fRec3[1]) + (fSlow1 / ((fRec4[0] * fTemp1) + 1.0))); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1)); double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fRec0 = (fRec3[0] * fTemp2); double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2); @@ -180,9 +163,7 @@ class faustHpf2pSv : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHpf4p.cxx b/src/sfizz/gen/filters/sfzHpf4p.cxx index 6d6f0142..3dbc1707 100644 --- a/src/sfizz/gen/filters/sfzHpf4p.cxx +++ b/src/sfizz/gen/filters/sfzHpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -42,23 +43,21 @@ class faustHpf4p : public sfzFilterDsp { double fRec2[3]; double fRec5[2]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faustHpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -83,86 +80,71 @@ class faustHpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec1[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHpf4p* clone() { return new faustHpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -174,11 +156,11 @@ class faustHpf4p : public sfzFilterDsp { double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow8); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2])))); fRec0[1] = fRec0[0]; @@ -189,9 +171,7 @@ class faustHpf4p : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHpf6p.cxx b/src/sfizz/gen/filters/sfzHpf6p.cxx index ae0da302..54879eb6 100644 --- a/src/sfizz/gen/filters/sfzHpf6p.cxx +++ b/src/sfizz/gen/filters/sfzHpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf6p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -43,23 +44,21 @@ class faustHpf6p : public sfzFilterDsp { double fRec6[2]; double fRec2[3]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -68,14 +67,12 @@ class faustHpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -84,90 +81,74 @@ class faustHpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec6[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec2[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHpf6p* clone() { return new faustHpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::cos(fSlow1); double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); @@ -179,11 +160,11 @@ class faustHpf6p : public sfzFilterDsp { double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow7); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow8); + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow7); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow8); fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); - fRec6[0] = ((fRec6[1] * fSlow0) + fSlow9); + fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow9); fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2])))); @@ -197,9 +178,7 @@ class faustHpf6p : public sfzFilterDsp { fRec2[1] = fRec2[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzHsh.cxx b/src/sfizz/gen/filters/sfzHsh.cxx index e4806d23..e7b34a5b 100644 --- a/src/sfizz/gen/filters/sfzHsh.cxx +++ b/src/sfizz/gen/filters/sfzHsh.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHsh_H__ @@ -11,55 +11,54 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustHsh #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustHsh : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fPkShGain; double fConst2; FAUSTFLOAT fCutoff; FAUSTFLOAT fQ; - double fRec1[2]; + double fRec0[2]; double fRec2[2]; - double fRec0[3]; double fRec3[2]; + double fRec1[3]; double fRec4[2]; double fRec5[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -68,14 +67,12 @@ class faustHsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -84,120 +81,103 @@ class faustHsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fPkShGain = FAUSTFLOAT(0.0); fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { - fRec1[l0] = 0.0; - + fRec0[l0] = 0.0; } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } - for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { - fRec0[l2] = 0.0; - + for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { + fRec3[l2] = 0.0; } - for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fRec3[l3] = 0.0; - + for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { + fRec1[l3] = 0.0; } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustHsh* clone() { return new faustHsh(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); double fSlow2 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); - double fSlow6 = ((fSlow1 + -1.0) * fSlow3); + double fSlow6 = (fSlow3 * (fSlow1 + -1.0)); double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6)); double fSlow8 = (1.0 - fSlow0); - double fSlow9 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8); - double fSlow10 = (((fSlow1 + (1.0 - (fSlow6 + fSlow5))) / fSlow7) * fSlow8); - double fSlow11 = (fSlow6 + fSlow1); - double fSlow12 = (((((fSlow11 + fSlow5) + 1.0) * fSlow1) / fSlow7) * fSlow8); - double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow4 + fSlow1) + -1.0)) / fSlow7) * fSlow8); - double fSlow14 = ((((fSlow11 + (1.0 - fSlow5)) * fSlow1) / fSlow7) * fSlow8); + double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8); + double fSlow10 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8); + double fSlow11 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8); + double fSlow12 = (fSlow1 + fSlow6); + double fSlow13 = (((fSlow1 * ((fSlow5 + fSlow12) + 1.0)) / fSlow7) * fSlow8); + double fSlow14 = (((fSlow1 * (fSlow12 + (1.0 - fSlow5))) / fSlow7) * fSlow8); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10); - fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14); - output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); - fRec1[1] = fRec1[0]; - fRec2[1] = fRec2[0]; - fRec0[2] = fRec0[1]; + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow9); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11); + fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14); + output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + ((fRec1[0] * fRec4[0]) + (fRec5[0] * fRec1[2])))); fRec0[1] = fRec0[0]; + fRec2[1] = fRec2[0]; fRec3[1] = fRec3[0]; + fRec1[2] = fRec1[1]; + fRec1[1] = fRec1[0]; fRec4[1] = fRec4[0]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLpf1p.cxx b/src/sfizz/gen/filters/sfzLpf1p.cxx index 37a9e786..fb9093cc 100644 --- a/src/sfizz/gen/filters/sfzLpf1p.cxx +++ b/src/sfizz/gen/filters/sfzLpf1p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf1p_H__ @@ -11,49 +11,48 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLpf1p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLpf1p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; - double fConst2; FAUSTFLOAT fCutoff; + double fConst2; double fRec1[2]; double fRec0[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -62,14 +61,12 @@ class faustLpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -78,80 +75,67 @@ class faustLpf1p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); - fConst1 = std::exp((0.0 - (1000.0 / fConst0))); - fConst2 = (1.0 / fConst0); - + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst1 = (1.0 / fConst0); + fConst2 = std::exp((0.0 - (1000.0 / fConst0))); } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec0[l1] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLpf1p* clone() { return new faustLpf1p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); - double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); + double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1); - fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0); + fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0]))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLpf2p.cxx b/src/sfizz/gen/filters/sfzLpf2p.cxx index c4e0af95..b168cd62 100644 --- a/src/sfizz/gen/filters/sfzLpf2p.cxx +++ b/src/sfizz/gen/filters/sfzLpf2p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf2p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLpf2p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLpf2p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -41,23 +42,21 @@ class faustLpf2p : public sfzFilterDsp { double fRec3[2]; double fRec1[3]; double fRec4[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -66,14 +65,12 @@ class faustLpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -82,78 +79,64 @@ class faustLpf2p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec3[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLpf2p* clone() { return new faustLpf2p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; @@ -162,7 +145,7 @@ class faustLpf2p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -170,11 +153,11 @@ class faustLpf2p : public sfzFilterDsp { double fSlow10 = ((0.5 * fSlow4) * fSlow6); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec2[0] = ((fRec2[1] * fSlow5) + fSlow8); - fRec3[0] = ((fRec3[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec2[0] = ((fSlow5 * fRec2[1]) + fSlow8); + fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow9); fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow10); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow10); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2])))); fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; @@ -182,9 +165,7 @@ class faustLpf2p : public sfzFilterDsp { fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; fRec4[1] = fRec4[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLpf2pSv.cxx b/src/sfizz/gen/filters/sfzLpf2pSv.cxx index ad5f3330..d70bcafc 100644 --- a/src/sfizz/gen/filters/sfzLpf2pSv.cxx +++ b/src/sfizz/gen/filters/sfzLpf2pSv.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf2pSv_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLpf2pSv #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLpf2pSv : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -41,23 +42,21 @@ class faustLpf2pSv : public sfzFilterDsp { double fRec5[2]; double fRec1[2]; double fRec2[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -66,14 +65,12 @@ class faustLpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -82,91 +79,77 @@ class faustLpf2pSv : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec1[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLpf2pSv* clone() { return new faustLpf2pSv(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (1.0 - fSlow0); double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1); double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); double fTemp1 = (fSlow3 + fRec3[0]); - fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0))); - fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1)); + fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0))); + fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1)); double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1]))); double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2); double fTemp4 = (fRec2[1] + (2.0 * fTemp3)); @@ -180,9 +163,7 @@ class faustLpf2pSv : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLpf4p.cxx b/src/sfizz/gen/filters/sfzLpf4p.cxx index 3b1b8293..1ee1d952 100644 --- a/src/sfizz/gen/filters/sfzLpf4p.cxx +++ b/src/sfizz/gen/filters/sfzLpf4p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf4p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLpf4p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLpf4p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -42,23 +43,21 @@ class faustLpf4p : public sfzFilterDsp { double fRec2[3]; double fRec5[2]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faustLpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -83,82 +80,67 @@ class faustLpf4p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec3[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec4[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec2[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec5[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec1[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLpf4p* clone() { return new faustLpf4p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; @@ -167,7 +149,7 @@ class faustLpf4p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -175,11 +157,11 @@ class faustLpf4p : public sfzFilterDsp { double fSlow10 = ((0.5 * fSlow4) * fSlow6); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec3[0] = ((fRec3[1] * fSlow5) + fSlow8); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow8); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow9); fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2]))); - fRec5[0] = ((fRec5[1] * fSlow5) + fSlow10); + fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow10); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2])))); fRec0[1] = fRec0[0]; @@ -190,9 +172,7 @@ class faustLpf4p : public sfzFilterDsp { fRec5[1] = fRec5[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLpf6p.cxx b/src/sfizz/gen/filters/sfzLpf6p.cxx index 15998090..61a1a377 100644 --- a/src/sfizz/gen/filters/sfzLpf6p.cxx +++ b/src/sfizz/gen/filters/sfzLpf6p.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf6p_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLpf6p #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLpf6p : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fCutoff; @@ -43,23 +44,21 @@ class faustLpf6p : public sfzFilterDsp { double fRec6[2]; double fRec2[3]; double fRec1[3]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -68,14 +67,12 @@ class faustLpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -84,86 +81,70 @@ class faustLpf6p : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec4[l1] = 0.0; - } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec5[l2] = 0.0; - } for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec6[l4] = 0.0; - } for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) { fRec2[l5] = 0.0; - } for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) { fRec1[l6] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLpf6p* clone() { return new faustLpf6p(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; @@ -172,7 +153,7 @@ class faustLpf6p : public sfzFilterDsp { double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); - double fSlow5 = (fSmoothEnable?fConst2:0.0); + double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); double fSlow6 = (1.0 - fSlow5); double fSlow7 = (fSlow4 * fSlow6); double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6); @@ -180,11 +161,11 @@ class faustLpf6p : public sfzFilterDsp { double fSlow10 = ((0.5 * fSlow4) * fSlow6); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5)); - fRec4[0] = ((fRec4[1] * fSlow5) + fSlow8); - fRec5[0] = ((fRec5[1] * fSlow5) + fSlow9); + fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1])); + fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow8); + fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow9); fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2]))); - fRec6[0] = ((fRec6[1] * fSlow5) + fSlow10); + fRec6[0] = ((fSlow5 * fRec6[1]) + fSlow10); fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2]))); fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2]))); output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2])))); @@ -198,9 +179,7 @@ class faustLpf6p : public sfzFilterDsp { fRec2[1] = fRec2[0]; fRec1[2] = fRec1[1]; fRec1[1] = fRec1[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzLsh.cxx b/src/sfizz/gen/filters/sfzLsh.cxx index 9239b340..12f10f8e 100644 --- a/src/sfizz/gen/filters/sfzLsh.cxx +++ b/src/sfizz/gen/filters/sfzLsh.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLsh_H__ @@ -11,55 +11,54 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustLsh #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustLsh : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; FAUSTFLOAT fPkShGain; double fConst2; FAUSTFLOAT fCutoff; FAUSTFLOAT fQ; - double fRec1[2]; + double fRec0[2]; double fRec2[2]; - double fRec0[3]; double fRec3[2]; + double fRec1[3]; double fRec4[2]; double fRec5[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -68,14 +67,12 @@ class faustLsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -84,120 +81,103 @@ class faustLsh : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fPkShGain = FAUSTFLOAT(0.0); fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { - fRec1[l0] = 0.0; - + fRec0[l0] = 0.0; } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } - for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { - fRec0[l2] = 0.0; - + for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { + fRec3[l2] = 0.0; } - for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fRec3[l3] = 0.0; - + for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) { + fRec1[l3] = 0.0; } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec5[l5] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustLsh* clone() { return new faustLsh(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); double fSlow2 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = ((fSlow1 + 1.0) * fSlow3); - double fSlow5 = ((fSlow1 + -1.0) * fSlow3); - double fSlow6 = (fSlow5 + fSlow1); - double fSlow7 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); - double fSlow8 = ((fSlow6 + fSlow7) + 1.0); + double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))); + double fSlow6 = (fSlow3 * (fSlow1 + -1.0)); + double fSlow7 = (fSlow1 + fSlow6); + double fSlow8 = ((fSlow5 + fSlow7) + 1.0); double fSlow9 = (1.0 - fSlow0); - double fSlow10 = (((0.0 - (2.0 * ((fSlow4 + fSlow1) + -1.0))) / fSlow8) * fSlow9); - double fSlow11 = (((fSlow6 + (1.0 - fSlow7)) / fSlow8) * fSlow9); - double fSlow12 = (((((fSlow1 + fSlow7) + (1.0 - fSlow5)) * fSlow1) / fSlow8) * fSlow9); - double fSlow13 = ((2.0 * (((fSlow1 + (-1.0 - fSlow4)) * fSlow1) / fSlow8)) * fSlow9); - double fSlow14 = ((((fSlow1 + (1.0 - (fSlow5 + fSlow7))) * fSlow1) / fSlow8) * fSlow9); + double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9); + double fSlow11 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9); + double fSlow12 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9); + double fSlow13 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9); + double fSlow14 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow10); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow11); - fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13); - fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14); - output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2]))); - fRec1[1] = fRec1[0]; - fRec2[1] = fRec2[0]; - fRec0[2] = fRec0[1]; + fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow10); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow11); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12); + fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2]))); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13); + fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14); + output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + ((fRec1[0] * fRec4[0]) + (fRec5[0] * fRec1[2])))); fRec0[1] = fRec0[0]; + fRec2[1] = fRec2[0]; fRec3[1] = fRec3[0]; + fRec1[2] = fRec1[1]; + fRec1[1] = fRec1[0]; fRec4[1] = fRec4[0]; fRec5[1] = fRec5[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzPeq.cxx b/src/sfizz/gen/filters/sfzPeq.cxx index 33b486e0..38bc2d9b 100644 --- a/src/sfizz/gen/filters/sfzPeq.cxx +++ b/src/sfizz/gen/filters/sfzPeq.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustPeq_H__ @@ -11,26 +11,27 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustPeq #endif -#ifdef __APPLE__ + +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustPeq : public sfzFilterDsp { - + public: - - int fSamplingFreq; + + int fSampleRate; double fConst0; double fConst1; double fConst2; @@ -42,23 +43,21 @@ class faustPeq : public sfzFilterDsp { double fRec0[3]; double fRec3[2]; double fRec4[2]; - + public: - - void metadata(Meta* m) { + + void metadata(Meta* m) { } virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -67,14 +66,12 @@ class faustPeq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -83,83 +80,69 @@ class faustPeq : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - - static void classInit(int samplingFreq) { - + + static void classInit(int sample_rate) { } - - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - fConst0 = std::min(192000.0, std::max(1.0, double(fSamplingFreq))); + + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; + fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); - } - + virtual void instanceResetUserInterface() { fCutoff = FAUSTFLOAT(440.0); fQ = FAUSTFLOAT(0.0); fPkShGain = FAUSTFLOAT(0.0); - } - + virtual void instanceClear() { for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; - } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { fRec2[l1] = 0.0; - } for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) { fRec0[l2] = 0.0; - } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { fRec3[l3] = 0.0; - } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec4[l4] = 0.0; - } - } - - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } - + virtual faustPeq* clone() { return new faustPeq(); } - + virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } - + virtual void buildUserInterface(UI* ui_interface) { - } - + virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { FAUSTFLOAT* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable?fConst1:0.0); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); double fSlow2 = std::sin(fSlow1); double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); @@ -174,12 +157,12 @@ class faustPeq : public sfzFilterDsp { double fSlow12 = (((1.0 - fSlow10) / fSlow6) * fSlow7); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = ((fRec1[1] * fSlow0) + fSlow8); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow8); double fTemp1 = (fRec1[0] * fRec0[1]); - fRec2[0] = ((fRec2[1] * fSlow0) + fSlow9); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow9); fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2]))); - fRec3[0] = ((fRec3[1] * fSlow0) + fSlow11); - fRec4[0] = ((fRec4[1] * fSlow0) + fSlow12); + fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11); + fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow12); output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2]))); fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; @@ -187,9 +170,7 @@ class faustPeq : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec3[1] = fRec3[0]; fRec4[1] = fRec4[0]; - } - } }; diff --git a/src/sfizz/gen/filters/sfzPink.cxx b/src/sfizz/gen/filters/sfzPink.cxx index 9917fe28..3546af26 100644 --- a/src/sfizz/gen/filters/sfzPink.cxx +++ b/src/sfizz/gen/filters/sfzPink.cxx @@ -2,8 +2,8 @@ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.15.11 (https://faust.grame.fr) -Compilation options: -inpl -double -ftz 0 +Code generated with Faust 2.20.2 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustPink_H__ @@ -20,6 +20,7 @@ Compilation options: -inpl -double -ftz 0 #ifndef FAUSTCLASS #define FAUSTCLASS faustPink #endif + #ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 @@ -30,7 +31,7 @@ class faustPink : public sfzFilterDsp { public: double fRec0[4]; - int fSamplingFreq; + int fSampleRate; public: @@ -39,15 +40,13 @@ class faustPink : public sfzFilterDsp { virtual int getNumInputs() { return 1; - } virtual int getNumOutputs() { return 1; - } virtual int getInputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -56,14 +55,12 @@ class faustPink : public sfzFilterDsp { rate = -1; break; } - } return rate; - } virtual int getOutputRate(int channel) { int rate; - switch (channel) { + switch ((channel)) { case 0: { rate = 1; break; @@ -72,40 +69,32 @@ class faustPink : public sfzFilterDsp { rate = -1; break; } - } return rate; - } - static void classInit(int samplingFreq) { - + static void classInit(int sample_rate) { } - virtual void instanceConstants(int samplingFreq) { - fSamplingFreq = samplingFreq; - + virtual void instanceConstants(int sample_rate) { + fSampleRate = sample_rate; } virtual void instanceResetUserInterface() { - } virtual void instanceClear() { for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) { fRec0[l0] = 0.0; - } - } - virtual void init(int samplingFreq) { - classInit(samplingFreq); - instanceInit(samplingFreq); + virtual void init(int sample_rate) { + classInit(sample_rate); + instanceInit(sample_rate); } - - virtual void instanceInit(int samplingFreq) { - instanceConstants(samplingFreq); + virtual void instanceInit(int sample_rate) { + instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); } @@ -115,12 +104,10 @@ class faustPink : public sfzFilterDsp { } virtual int getSampleRate() { - return fSamplingFreq; - + return fSampleRate; } virtual void buildUserInterface(UI* ui_interface) { - } virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { @@ -128,15 +115,12 @@ class faustPink : public sfzFilterDsp { FAUSTFLOAT* output0 = outputs[0]; for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2])); + fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2])); output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3])))); for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) { fRec0[j0] = fRec0[(j0 - 1)]; - } - } - } };