From 58c7c38f2e1a4c0c912115032c5e4a9275beee48 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Thu, 25 Feb 2021 00:27:21 +0100 Subject: [PATCH] Add regenerated faust source --- src/sfizz/effects/gen/compressor.hxx | 166 +++-- src/sfizz/effects/gen/disto_stage.hxx | 149 ++--- src/sfizz/effects/gen/fverb.hxx | 797 ++++++++++++----------- src/sfizz/effects/gen/gate.hxx | 155 ++--- src/sfizz/effects/gen/limiter.hxx | 252 ++++--- src/sfizz/gen/filters/sfz2chApf1p.hxx | 151 ++--- src/sfizz/gen/filters/sfz2chBpf1p.hxx | 151 ++--- src/sfizz/gen/filters/sfz2chBpf2p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chBpf2pSv.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chBpf4p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chBpf6p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chBrf1p.hxx | 151 ++--- src/sfizz/gen/filters/sfz2chBrf2p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chBrf2pSv.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chEqHshelf.hxx | 165 +++-- src/sfizz/gen/filters/sfz2chEqLshelf.hxx | 165 +++-- src/sfizz/gen/filters/sfz2chEqPeak.hxx | 163 +++-- src/sfizz/gen/filters/sfz2chHpf1p.hxx | 151 ++--- src/sfizz/gen/filters/sfz2chHpf2p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chHpf2pSv.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chHpf4p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chHpf6p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chHsh.hxx | 173 +++-- src/sfizz/gen/filters/sfz2chLpf1p.hxx | 151 ++--- src/sfizz/gen/filters/sfz2chLpf2p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chLpf2pSv.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chLpf4p.hxx | 152 +++-- src/sfizz/gen/filters/sfz2chLpf6p.hxx | 176 +++-- src/sfizz/gen/filters/sfz2chLsh.hxx | 175 +++-- src/sfizz/gen/filters/sfz2chPeq.hxx | 163 +++-- src/sfizz/gen/filters/sfz2chPink.hxx | 132 ++-- src/sfizz/gen/filters/sfzApf1p.hxx | 141 ++-- src/sfizz/gen/filters/sfzBpf1p.hxx | 141 ++-- src/sfizz/gen/filters/sfzBpf2p.hxx | 142 ++-- src/sfizz/gen/filters/sfzBpf2pSv.hxx | 142 ++-- src/sfizz/gen/filters/sfzBpf4p.hxx | 142 ++-- src/sfizz/gen/filters/sfzBpf6p.hxx | 142 ++-- src/sfizz/gen/filters/sfzBrf1p.hxx | 141 ++-- src/sfizz/gen/filters/sfzBrf2p.hxx | 142 ++-- src/sfizz/gen/filters/sfzBrf2pSv.hxx | 142 ++-- src/sfizz/gen/filters/sfzEqHshelf.hxx | 155 ++--- src/sfizz/gen/filters/sfzEqLshelf.hxx | 155 ++--- src/sfizz/gen/filters/sfzEqPeak.hxx | 153 ++--- src/sfizz/gen/filters/sfzHpf1p.hxx | 141 ++-- src/sfizz/gen/filters/sfzHpf2p.hxx | 142 ++-- src/sfizz/gen/filters/sfzHpf2pSv.hxx | 142 ++-- src/sfizz/gen/filters/sfzHpf4p.hxx | 142 ++-- src/sfizz/gen/filters/sfzHpf6p.hxx | 142 ++-- src/sfizz/gen/filters/sfzHsh.hxx | 163 ++--- src/sfizz/gen/filters/sfzLpf1p.hxx | 141 ++-- src/sfizz/gen/filters/sfzLpf2p.hxx | 142 ++-- src/sfizz/gen/filters/sfzLpf2pSv.hxx | 142 ++-- src/sfizz/gen/filters/sfzLpf4p.hxx | 142 ++-- src/sfizz/gen/filters/sfzLpf6p.hxx | 142 ++-- src/sfizz/gen/filters/sfzLsh.hxx | 165 ++--- src/sfizz/gen/filters/sfzPeq.hxx | 153 ++--- src/sfizz/gen/filters/sfzPink.hxx | 122 ++-- 57 files changed, 4606 insertions(+), 4715 deletions(-) diff --git a/src/sfizz/effects/gen/compressor.hxx b/src/sfizz/effects/gen/compressor.hxx index ba19b870..39456bab 100644 --- a/src/sfizz/effects/gen/compressor.hxx +++ b/src/sfizz/effects/gen/compressor.hxx @@ -1,7 +1,11 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ name: "compressor" -Code generated with Faust 2.27.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -scal -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0 ------------------------------------------------------------ */ #ifndef __faustCompressor_H__ @@ -9,97 +13,73 @@ Compilation options: -lang cpp -inpl -scal -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustCompressor #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustCompressor { + //[Begin:class] - public: - - float fConst0; - float fConst1; + + private: + FAUSTFLOAT fHslider0; int fSampleRate; - float fConst2; + float fConst0; FAUSTFLOAT fHslider1; FAUSTFLOAT fHslider2; float fRec2[2]; float fRec1[2]; FAUSTFLOAT fHslider3; float fRec0[2]; - + public: + - void metadata() { - } - - int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { - (void)sample_rate; + //[Begin:classInit] + //[End:classInit] } - + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = float(_oversampling); - fConst1 = (0.5f * fConst0); - fConst2 = (1.0f / std::min(192000.0f, std::max(1.0f, float(fSampleRate)))); + fConst0 = (1.0f / float(fSampleRate)); + //[End:instanceConstants] } - + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] fHslider0 = FAUSTFLOAT(0.0f); fHslider1 = FAUSTFLOAT(1.0f); fHslider2 = FAUSTFLOAT(0.0f); fHslider3 = FAUSTFLOAT(0.0f); + //[End:instanceResetUserInterface] } - + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0f; } @@ -109,73 +89,81 @@ class faustCompressor { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0f; } + //[End:instanceClear] } - + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - faustCompressor* clone() { - return new faustCompressor(); - } - + + int getSampleRate() { return fSampleRate; } - - void buildUserInterface() { - } - - void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; float fSlow0 = float(fHslider0); - float fSlow1 = (fConst1 * fSlow0); + float fSlow1 = (0.5f * fSlow0); int iSlow2 = (std::fabs(fSlow1) < 1.1920929e-07f); - float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow2 ? 1.0f : fSlow1))))); - float fSlow4 = ((1.0f / std::max(1.00000001e-07f, float(fHslider1))) + -1.0f); - float fSlow5 = (fConst0 * fSlow0); - int iSlow6 = (std::fabs(fSlow5) < 1.1920929e-07f); - float fSlow7 = (iSlow6 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow6 ? 1.0f : fSlow5))))); - float fSlow8 = (fConst0 * float(fHslider2)); - int iSlow9 = (std::fabs(fSlow8) < 1.1920929e-07f); - float fSlow10 = (iSlow9 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow9 ? 1.0f : fSlow8))))); - float fSlow11 = float(fHslider3); - float fSlow12 = (1.0f - fSlow3); + float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow2 ? 1.0f : fSlow1))))); + float fSlow4 = ((1.0f / std::max(1.1920929e-07f, float(fHslider1))) + -1.0f); + int iSlow5 = (std::fabs(fSlow0) < 1.1920929e-07f); + float fSlow6 = (iSlow5 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow5 ? 1.0f : fSlow0))))); + float fSlow7 = float(fHslider2); + int iSlow8 = (std::fabs(fSlow7) < 1.1920929e-07f); + float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow8 ? 1.0f : fSlow7))))); + float fSlow10 = float(fHslider3); + float fSlow11 = (1.0f - fSlow3); for (int i = 0; (i < count); i = (i + 1)) { float fTemp0 = float(input0[i]); float fTemp1 = std::fabs(fTemp0); - float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow10 : fSlow7); + float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow9 : fSlow6); fRec2[0] = ((fRec2[1] * fTemp2) + (fTemp1 * (1.0f - fTemp2))); fRec1[0] = fRec2[0]; - fRec0[0] = ((fRec0[1] * fSlow3) + (fSlow4 * (std::max(((20.0f * std::log10(fRec1[0])) - fSlow11), 0.0f) * fSlow12))); + fRec0[0] = ((fSlow3 * fRec0[1]) + (fSlow4 * (std::max(((20.0f * std::log10(fRec1[0])) - fSlow10), 0.0f) * fSlow11))); output0[i] = FAUSTFLOAT(std::pow(10.0f, (0.0500000007f * fRec0[0]))); fRec2[1] = fRec2[0]; fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getRatio() const { return fHslider1; } + void setRatio(FAUSTFLOAT value) { fHslider1 = value; } + + FAUSTFLOAT getThreshold() const { return fHslider3; } + void setThreshold(FAUSTFLOAT value) { fHslider3 = value; } + + FAUSTFLOAT getAttack() const { return fHslider0; } + void setAttack(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getRelease() const { return fHslider2; } + void setRelease(FAUSTFLOAT value) { fHslider2 = value; } + + //[End:class] }; +//[After:class] -#ifdef FAUST_UIMACROS - - - - #define FAUST_LIST_ACTIVES(p) \ - p(HORIZONTALSLIDER, Ratio, "Ratio", fHslider1, 1.0f, 1.0f, 20.0f, 0.01f) \ - p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider3, 0.0f, -60.0f, 0.0f, 0.01f) \ - p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 0.5f, 0.001f) \ - p(HORIZONTALSLIDER, Release, "Release", fHslider2, 0.0f, 0.0f, 5.0f, 0.001f) \ - - #define FAUST_LIST_PASSIVES(p) \ #endif - +#if defined(__GNUC__) +#pragma GCC diagnostic pop #endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/effects/gen/disto_stage.hxx b/src/sfizz/effects/gen/disto_stage.hxx index e630bd68..1c16e2fb 100644 --- a/src/sfizz/effects/gen/disto_stage.hxx +++ b/src/sfizz/effects/gen/disto_stage.hxx @@ -1,7 +1,11 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ name: "disto_stage" -Code generated with Faust 2.27.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -scal -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0 ------------------------------------------------------------ */ #ifndef __faustDisto_H__ @@ -9,20 +13,24 @@ Compilation options: -lang cpp -inpl -scal -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include + +//[Before:class] class faustDistoSIG0 { + //[Begin:class] - public: - + + private: + int iRec3[2]; - + public: - + int getNumInputsfaustDistoSIG0() { return 0; } @@ -53,14 +61,13 @@ class faustDistoSIG0 { } return rate; } - + void instanceInitfaustDistoSIG0(int sample_rate) { - (void)sample_rate; for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { iRec3[l3] = 0; } } - + void fillfaustDistoSIG0(int count, float* table) { for (int i = 0; (i < count); i = (i + 1)) { iRec3[0] = (iRec3[1] + 1); @@ -77,19 +84,19 @@ static void deletefaustDistoSIG0(faustDistoSIG0* dsp) { delete dsp; } static float ftbl0faustDistoSIG0[256]; -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustDisto #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustDisto { - - public: - + + private: + float fVec0[2]; int fSampleRate; float fConst0; @@ -97,79 +104,52 @@ class faustDisto { float fConst2; float fConst3; float fConst4; - int iConst5; - float fConst6; + float fConst5; int iRec2[2]; - float fConst7; float fRec1[2]; FAUSTFLOAT fHslider0; float fVec1[2]; float fRec0[2]; - + public: + - void metadata() { - } - - int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] faustDistoSIG0* sig0 = newfaustDistoSIG0(); sig0->instanceInitfaustDistoSIG0(sample_rate); sig0->fillfaustDistoSIG0(256, ftbl0faustDistoSIG0); deletefaustDistoSIG0(sig0); + //[End:classInit] } - + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0f, std::max(1.0f, float(fSampleRate))); + fConst0 = float(fSampleRate); fConst1 = (15.707963f / fConst0); fConst2 = (1.0f / (fConst1 + 1.0f)); fConst3 = (1.0f - fConst1); - fConst4 = (0.00999999978f * float(_oversampling)); - iConst5 = (std::fabs(fConst4) < 1.1920929e-07f); - fConst6 = (iConst5 ? 0.0f : std::exp((0.0f - ((1.0f / fConst0) / (iConst5 ? 1.0f : fConst4))))); - fConst7 = (1.0f - fConst6); + fConst4 = std::exp((0.0f - (100.0f / fConst0))); + fConst5 = (1.0f - fConst4); + //[End:instanceConstants] } - + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] fHslider0 = FAUSTFLOAT(100.0f); + //[End:instanceResetUserInterface] } - + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fVec0[l0] = 0.0f; } @@ -185,38 +165,39 @@ class faustDisto { for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fRec0[l5] = 0.0f; } + //[End:instanceClear] } - + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - faustDisto* clone() { - return new faustDisto(); - } - + + int getSampleRate() { return fSampleRate; } - - void buildUserInterface() { - } - - void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; float fSlow0 = ((0.200000003f * float(fHslider0)) + 2.0f); for (int i = 0; (i < count); i = (i + 1)) { float fTemp0 = float(input0[i]); fVec0[0] = fTemp0; iRec2[0] = (((fTemp0 < fVec0[1]) & (fTemp0 < -0.25f)) ? 1 : (((fTemp0 > fVec0[1]) & (fTemp0 > 0.25f)) ? 0 : iRec2[1])); - fRec1[0] = ((fRec1[1] * fConst6) + (float(iRec2[0]) * fConst7)); + fRec1[0] = ((fConst4 * fRec1[1]) + (fConst5 * float(iRec2[0]))); float fTemp2 = std::max(0.0f, (12.75f * ((fSlow0 * fTemp0) + 10.0f))); int iTemp3 = int(fTemp2); float fTemp4 = ftbl0faustDistoSIG0[std::min(255, iTemp3)]; @@ -231,19 +212,21 @@ class faustDisto { fVec1[1] = fVec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getDepth() const { return fHslider0; } + void setDepth(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] -#ifdef FAUST_UIMACROS - - - - #define FAUST_LIST_ACTIVES(p) \ - p(HORIZONTALSLIDER, Depth, "Depth", fHslider0, 100.0f, 0.0f, 100.0f, 0.01f) \ - - #define FAUST_LIST_PASSIVES(p) \ #endif - +#if defined(__GNUC__) +#pragma GCC diagnostic pop #endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/effects/gen/fverb.hxx b/src/sfizz/effects/gen/fverb.hxx index 849c2485..cda9c189 100644 --- a/src/sfizz/effects/gen/fverb.hxx +++ b/src/sfizz/effects/gen/fverb.hxx @@ -1,10 +1,14 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "fverb" version: "0.5" -Code generated with Faust 2.27.1 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -scal -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0 ------------------------------------------------------------ */ #ifndef __faustFverb_H__ @@ -12,20 +16,24 @@ Compilation options: -lang cpp -inpl -scal -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include + +//[Before:class] class faustFverbSIG0 { + //[Begin:class] + + private: + + int iRec36[2]; + public: - - int iRec19[2]; - - public: - + int getNumInputsfaustFverbSIG0() { return 0; } @@ -56,19 +64,18 @@ class faustFverbSIG0 { } return rate; } - + void instanceInitfaustFverbSIG0(int sample_rate) { - (void)sample_rate; - for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { - iRec19[l4] = 0; + for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) { + iRec36[l23] = 0; } } - + void fillfaustFverbSIG0(int count, float* table) { for (int i = 0; (i < count); i = (i + 1)) { - iRec19[0] = (iRec19[1] + 1); - table[i] = std::sin((9.58738019e-05f * float((iRec19[0] + -1)))); - iRec19[1] = iRec19[0]; + iRec36[0] = (iRec36[1] + 1); + table[i] = std::sin((9.58738019e-05f * float((iRec36[0] + -1)))); + iRec36[1] = iRec36[0]; } } @@ -79,114 +86,114 @@ static void deletefaustFverbSIG0(faustFverbSIG0* dsp) { delete dsp; } static float ftbl0faustFverbSIG0[65536]; -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustFverb #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif class faustFverb { - - public: - + + private: + FAUSTFLOAT fHslider0; float fRec0[2]; FAUSTFLOAT fHslider1; float fRec1[2]; FAUSTFLOAT fHslider2; float fRec10[2]; - int fSampleRate; - float fConst0; FAUSTFLOAT fHslider3; - float fRec18[2]; - float fConst1; - FAUSTFLOAT fHslider4; - float fRec21[2]; - float fRec20[2]; - float fConst2; - float fConst3; - float fRec14[2]; - float fRec15[2]; - int iRec16[2]; - int iRec17[2]; - FAUSTFLOAT fHslider5; - float fRec32[2]; + float fRec24[2]; int IOTA; float fVec0[131072]; - FAUSTFLOAT fHslider6; - float fRec33[2]; - FAUSTFLOAT fHslider7; - float fRec34[2]; - float fRec31[2]; - FAUSTFLOAT fHslider8; - float fRec35[2]; - float fRec30[2]; - FAUSTFLOAT fHslider9; - float fRec36[2]; - float fVec1[1024]; - int iConst4; - float fRec28[2]; - float fVec2[1024]; - int iConst5; + int fSampleRate; + float fConst0; + FAUSTFLOAT fHslider4; + float fRec25[2]; + float fConst1; + FAUSTFLOAT fHslider5; float fRec26[2]; - FAUSTFLOAT fHslider10; - float fRec37[2]; - float fVec3[4096]; - int iConst6; - float fRec24[2]; - float fVec4[2048]; - int iConst7; + float fRec23[2]; + FAUSTFLOAT fHslider6; + float fRec27[2]; float fRec22[2]; - int iConst8; + FAUSTFLOAT fHslider7; + float fRec28[2]; + float fVec1[131072]; + int iConst2; + float fRec20[2]; + float fVec2[131072]; + int iConst3; + float fRec18[2]; + FAUSTFLOAT fHslider8; + float fRec29[2]; + float fVec3[131072]; + int iConst4; + float fRec16[2]; + float fVec4[131072]; + int iConst5; + float fRec14[2]; + int iConst6; + FAUSTFLOAT fHslider9; + float fRec30[2]; + float fVec5[131072]; + FAUSTFLOAT fHslider10; + float fRec35[2]; FAUSTFLOAT fHslider11; float fRec38[2]; - float fVec5[131072]; + float fRec37[2]; + float fConst7; + float fConst8; + float fRec31[2]; + float fRec32[2]; + int iRec33[2]; + int iRec34[2]; float fRec12[2]; - float fVec6[32768]; + float fVec6[131072]; int iConst9; FAUSTFLOAT fHslider12; float fRec39[2]; float fRec11[2]; - float fVec7[32768]; + float fVec7[131072]; int iConst10; float fRec8[2]; - float fRec2[32768]; - float fRec3[16384]; - float fRec4[32768]; - float fRec45[2]; - float fRec46[2]; - int iRec47[2]; - int iRec48[2]; + float fRec2[131072]; + float fRec3[131072]; + float fRec4[131072]; float fVec8[131072]; - float fRec58[2]; - float fRec57[2]; - float fVec9[1024]; - int iConst11; - float fRec55[2]; - float fVec10[1024]; - int iConst12; + float fRec54[2]; float fRec53[2]; - float fVec11[4096]; - int iConst13; + float fVec9[131072]; + int iConst11; float fRec51[2]; - float fVec12[2048]; - int iConst14; + float fVec10[131072]; + int iConst12; float fRec49[2]; + float fVec11[131072]; + int iConst13; + float fRec47[2]; + float fVec12[131072]; + int iConst14; + float fRec45[2]; int iConst15; float fVec13[131072]; + float fRec55[2]; + float fRec56[2]; + int iRec57[2]; + int iRec58[2]; float fRec43[2]; - float fVec14[32768]; + float fVec14[131072]; int iConst16; float fRec42[2]; - float fVec15[16384]; + float fVec15[131072]; int iConst17; float fRec40[2]; - float fRec5[32768]; - float fRec6[8192]; - float fRec7[32768]; + float fRec5[131072]; + float fRec6[131072]; + float fRec7[131072]; int iConst18; int iConst19; int iConst20; @@ -201,73 +208,38 @@ class faustFverb { int iConst29; int iConst30; int iConst31; - + public: + - void metadata() { - } - - int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] faustFverbSIG0* sig0 = newfaustFverbSIG0(); sig0->instanceInitfaustFverbSIG0(sample_rate); sig0->fillfaustFverbSIG0(65536, ftbl0faustFverbSIG0); deletefaustFverbSIG0(sig0); + //[End:classInit] } - + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0f, std::max(1.0f, float(fSampleRate))); + fConst0 = float(fSampleRate); fConst1 = (1.0f / fConst0); - fConst2 = (1.0f / float(int((0.00999999978f * fConst0)))); - fConst3 = (0.0f - fConst2); - iConst4 = std::min(65536, std::max(0, (int((0.00462820474f * fConst0)) + -1))); - iConst5 = std::min(65536, std::max(0, (int((0.00370316859f * fConst0)) + -1))); - iConst6 = std::min(65536, std::max(0, (int((0.013116831f * fConst0)) + -1))); - iConst7 = std::min(65536, std::max(0, (int((0.00902825873f * fConst0)) + -1))); - iConst8 = (std::min(65536, std::max(0, int((0.106280029f * fConst0)))) + 1); + iConst2 = std::min(65536, std::max(0, (int((0.00462820474f * fConst0)) + -1))); + iConst3 = std::min(65536, std::max(0, (int((0.00370316859f * fConst0)) + -1))); + iConst4 = std::min(65536, std::max(0, (int((0.013116831f * fConst0)) + -1))); + iConst5 = std::min(65536, std::max(0, (int((0.00902825873f * fConst0)) + -1))); + iConst6 = (std::min(65536, std::max(0, int((0.106280029f * fConst0)))) + 1); + fConst7 = (1.0f / float(int((0.00999999978f * fConst0)))); + fConst8 = (0.0f - fConst7); iConst9 = std::min(65536, std::max(0, int((0.141695514f * fConst0)))); iConst10 = std::min(65536, std::max(0, (int((0.0892443135f * fConst0)) + -1))); iConst11 = std::min(65536, std::max(0, (int((0.00491448538f * fConst0)) + -1))); @@ -291,25 +263,29 @@ class faustFverb { iConst29 = std::min(65536, std::max(0, int((0.070931755f * fConst0)))); iConst30 = std::min(65536, std::max(0, int((0.0112563418f * fConst0)))); iConst31 = std::min(65536, std::max(0, int((0.00406572362f * fConst0)))); + //[End:instanceConstants] } - + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] fHslider0 = FAUSTFLOAT(100.0f); fHslider1 = FAUSTFLOAT(50.0f); fHslider2 = FAUSTFLOAT(50.0f); - fHslider3 = FAUSTFLOAT(0.5f); - fHslider4 = FAUSTFLOAT(1.0f); - fHslider5 = FAUSTFLOAT(100.0f); - fHslider6 = FAUSTFLOAT(0.0f); - fHslider7 = FAUSTFLOAT(10000.0f); - fHslider8 = FAUSTFLOAT(100.0f); - fHslider9 = FAUSTFLOAT(75.0f); - fHslider10 = FAUSTFLOAT(62.5f); - fHslider11 = FAUSTFLOAT(70.0f); + fHslider3 = FAUSTFLOAT(100.0f); + fHslider4 = FAUSTFLOAT(0.0f); + fHslider5 = FAUSTFLOAT(10000.0f); + fHslider6 = FAUSTFLOAT(100.0f); + fHslider7 = FAUSTFLOAT(75.0f); + fHslider8 = FAUSTFLOAT(62.5f); + fHslider9 = FAUSTFLOAT(70.0f); + fHslider10 = FAUSTFLOAT(0.5f); + fHslider11 = FAUSTFLOAT(1.0f); fHslider12 = FAUSTFLOAT(5500.0f); + //[End:instanceResetUserInterface] } - + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec0[l0] = 0.0f; } @@ -320,88 +296,88 @@ class faustFverb { fRec10[l2] = 0.0f; } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fRec18[l3] = 0.0f; - } - for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { - fRec21[l5] = 0.0f; - } - for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { - fRec20[l6] = 0.0f; - } - for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) { - fRec14[l7] = 0.0f; - } - for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { - fRec15[l8] = 0.0f; - } - for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { - iRec16[l9] = 0; - } - for (int l10 = 0; (l10 < 2); l10 = (l10 + 1)) { - iRec17[l10] = 0; - } - for (int l11 = 0; (l11 < 2); l11 = (l11 + 1)) { - fRec32[l11] = 0.0f; + fRec24[l3] = 0.0f; } IOTA = 0; - for (int l12 = 0; (l12 < 131072); l12 = (l12 + 1)) { - fVec0[l12] = 0.0f; + for (int l4 = 0; (l4 < 131072); l4 = (l4 + 1)) { + fVec0[l4] = 0.0f; } - for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { - fRec33[l13] = 0.0f; + for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { + fRec25[l5] = 0.0f; + } + for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { + fRec26[l6] = 0.0f; + } + for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) { + fRec23[l7] = 0.0f; + } + for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { + fRec27[l8] = 0.0f; + } + for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { + fRec22[l9] = 0.0f; + } + for (int l10 = 0; (l10 < 2); l10 = (l10 + 1)) { + fRec28[l10] = 0.0f; + } + for (int l11 = 0; (l11 < 131072); l11 = (l11 + 1)) { + fVec1[l11] = 0.0f; + } + for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) { + fRec20[l12] = 0.0f; + } + for (int l13 = 0; (l13 < 131072); l13 = (l13 + 1)) { + fVec2[l13] = 0.0f; } for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { - fRec34[l14] = 0.0f; + fRec18[l14] = 0.0f; } for (int l15 = 0; (l15 < 2); l15 = (l15 + 1)) { - fRec31[l15] = 0.0f; + fRec29[l15] = 0.0f; } - for (int l16 = 0; (l16 < 2); l16 = (l16 + 1)) { - fRec35[l16] = 0.0f; + for (int l16 = 0; (l16 < 131072); l16 = (l16 + 1)) { + fVec3[l16] = 0.0f; } for (int l17 = 0; (l17 < 2); l17 = (l17 + 1)) { - fRec30[l17] = 0.0f; + fRec16[l17] = 0.0f; } - for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) { - fRec36[l18] = 0.0f; + for (int l18 = 0; (l18 < 131072); l18 = (l18 + 1)) { + fVec4[l18] = 0.0f; } - for (int l19 = 0; (l19 < 1024); l19 = (l19 + 1)) { - fVec1[l19] = 0.0f; + for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) { + fRec14[l19] = 0.0f; } for (int l20 = 0; (l20 < 2); l20 = (l20 + 1)) { - fRec28[l20] = 0.0f; + fRec30[l20] = 0.0f; } - for (int l21 = 0; (l21 < 1024); l21 = (l21 + 1)) { - fVec2[l21] = 0.0f; + for (int l21 = 0; (l21 < 131072); l21 = (l21 + 1)) { + fVec5[l21] = 0.0f; } for (int l22 = 0; (l22 < 2); l22 = (l22 + 1)) { - fRec26[l22] = 0.0f; + fRec35[l22] = 0.0f; } - for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) { - fRec37[l23] = 0.0f; - } - for (int l24 = 0; (l24 < 4096); l24 = (l24 + 1)) { - fVec3[l24] = 0.0f; + for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) { + fRec38[l24] = 0.0f; } for (int l25 = 0; (l25 < 2); l25 = (l25 + 1)) { - fRec24[l25] = 0.0f; + fRec37[l25] = 0.0f; } - for (int l26 = 0; (l26 < 2048); l26 = (l26 + 1)) { - fVec4[l26] = 0.0f; + for (int l26 = 0; (l26 < 2); l26 = (l26 + 1)) { + fRec31[l26] = 0.0f; } for (int l27 = 0; (l27 < 2); l27 = (l27 + 1)) { - fRec22[l27] = 0.0f; + fRec32[l27] = 0.0f; } for (int l28 = 0; (l28 < 2); l28 = (l28 + 1)) { - fRec38[l28] = 0.0f; + iRec33[l28] = 0; } - for (int l29 = 0; (l29 < 131072); l29 = (l29 + 1)) { - fVec5[l29] = 0.0f; + for (int l29 = 0; (l29 < 2); l29 = (l29 + 1)) { + iRec34[l29] = 0; } for (int l30 = 0; (l30 < 2); l30 = (l30 + 1)) { fRec12[l30] = 0.0f; } - for (int l31 = 0; (l31 < 32768); l31 = (l31 + 1)) { + for (int l31 = 0; (l31 < 131072); l31 = (l31 + 1)) { fVec6[l31] = 0.0f; } for (int l32 = 0; (l32 < 2); l32 = (l32 + 1)) { @@ -410,133 +386,134 @@ class faustFverb { for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) { fRec11[l33] = 0.0f; } - for (int l34 = 0; (l34 < 32768); l34 = (l34 + 1)) { + for (int l34 = 0; (l34 < 131072); l34 = (l34 + 1)) { fVec7[l34] = 0.0f; } for (int l35 = 0; (l35 < 2); l35 = (l35 + 1)) { fRec8[l35] = 0.0f; } - for (int l36 = 0; (l36 < 32768); l36 = (l36 + 1)) { + for (int l36 = 0; (l36 < 131072); l36 = (l36 + 1)) { fRec2[l36] = 0.0f; } - for (int l37 = 0; (l37 < 16384); l37 = (l37 + 1)) { + for (int l37 = 0; (l37 < 131072); l37 = (l37 + 1)) { fRec3[l37] = 0.0f; } - for (int l38 = 0; (l38 < 32768); l38 = (l38 + 1)) { + for (int l38 = 0; (l38 < 131072); l38 = (l38 + 1)) { fRec4[l38] = 0.0f; } - for (int l39 = 0; (l39 < 2); l39 = (l39 + 1)) { - fRec45[l39] = 0.0f; + for (int l39 = 0; (l39 < 131072); l39 = (l39 + 1)) { + fVec8[l39] = 0.0f; } for (int l40 = 0; (l40 < 2); l40 = (l40 + 1)) { - fRec46[l40] = 0.0f; + fRec54[l40] = 0.0f; } for (int l41 = 0; (l41 < 2); l41 = (l41 + 1)) { - iRec47[l41] = 0; + fRec53[l41] = 0.0f; } - for (int l42 = 0; (l42 < 2); l42 = (l42 + 1)) { - iRec48[l42] = 0; + for (int l42 = 0; (l42 < 131072); l42 = (l42 + 1)) { + fVec9[l42] = 0.0f; } - for (int l43 = 0; (l43 < 131072); l43 = (l43 + 1)) { - fVec8[l43] = 0.0f; + for (int l43 = 0; (l43 < 2); l43 = (l43 + 1)) { + fRec51[l43] = 0.0f; } - for (int l44 = 0; (l44 < 2); l44 = (l44 + 1)) { - fRec58[l44] = 0.0f; + for (int l44 = 0; (l44 < 131072); l44 = (l44 + 1)) { + fVec10[l44] = 0.0f; } for (int l45 = 0; (l45 < 2); l45 = (l45 + 1)) { - fRec57[l45] = 0.0f; + fRec49[l45] = 0.0f; } - for (int l46 = 0; (l46 < 1024); l46 = (l46 + 1)) { - fVec9[l46] = 0.0f; + for (int l46 = 0; (l46 < 131072); l46 = (l46 + 1)) { + fVec11[l46] = 0.0f; } for (int l47 = 0; (l47 < 2); l47 = (l47 + 1)) { - fRec55[l47] = 0.0f; + fRec47[l47] = 0.0f; } - for (int l48 = 0; (l48 < 1024); l48 = (l48 + 1)) { - fVec10[l48] = 0.0f; + for (int l48 = 0; (l48 < 131072); l48 = (l48 + 1)) { + fVec12[l48] = 0.0f; } for (int l49 = 0; (l49 < 2); l49 = (l49 + 1)) { - fRec53[l49] = 0.0f; + fRec45[l49] = 0.0f; } - for (int l50 = 0; (l50 < 4096); l50 = (l50 + 1)) { - fVec11[l50] = 0.0f; + for (int l50 = 0; (l50 < 131072); l50 = (l50 + 1)) { + fVec13[l50] = 0.0f; } for (int l51 = 0; (l51 < 2); l51 = (l51 + 1)) { - fRec51[l51] = 0.0f; + fRec55[l51] = 0.0f; } - for (int l52 = 0; (l52 < 2048); l52 = (l52 + 1)) { - fVec12[l52] = 0.0f; + for (int l52 = 0; (l52 < 2); l52 = (l52 + 1)) { + fRec56[l52] = 0.0f; } for (int l53 = 0; (l53 < 2); l53 = (l53 + 1)) { - fRec49[l53] = 0.0f; + iRec57[l53] = 0; } - for (int l54 = 0; (l54 < 131072); l54 = (l54 + 1)) { - fVec13[l54] = 0.0f; + for (int l54 = 0; (l54 < 2); l54 = (l54 + 1)) { + iRec58[l54] = 0; } for (int l55 = 0; (l55 < 2); l55 = (l55 + 1)) { fRec43[l55] = 0.0f; } - for (int l56 = 0; (l56 < 32768); l56 = (l56 + 1)) { + for (int l56 = 0; (l56 < 131072); l56 = (l56 + 1)) { fVec14[l56] = 0.0f; } for (int l57 = 0; (l57 < 2); l57 = (l57 + 1)) { fRec42[l57] = 0.0f; } - for (int l58 = 0; (l58 < 16384); l58 = (l58 + 1)) { + for (int l58 = 0; (l58 < 131072); l58 = (l58 + 1)) { fVec15[l58] = 0.0f; } for (int l59 = 0; (l59 < 2); l59 = (l59 + 1)) { fRec40[l59] = 0.0f; } - for (int l60 = 0; (l60 < 32768); l60 = (l60 + 1)) { + for (int l60 = 0; (l60 < 131072); l60 = (l60 + 1)) { fRec5[l60] = 0.0f; } - for (int l61 = 0; (l61 < 8192); l61 = (l61 + 1)) { + for (int l61 = 0; (l61 < 131072); l61 = (l61 + 1)) { fRec6[l61] = 0.0f; } - for (int l62 = 0; (l62 < 32768); l62 = (l62 + 1)) { + for (int l62 = 0; (l62 < 131072); l62 = (l62 + 1)) { fRec7[l62] = 0.0f; } + //[End:instanceClear] } - + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - faustFverb* clone() { - return new faustFverb(); - } - + + int getSampleRate() { return fSampleRate; } - - void buildUserInterface() { - } - - void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; - FAUSTFLOAT* input1 = inputs[1]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; float fSlow0 = (9.99999975e-06f * float(fHslider0)); float fSlow1 = (9.99999975e-06f * float(fHslider1)); float fSlow2 = (9.99999975e-06f * float(fHslider2)); - float fSlow3 = (9.99999997e-07f * float(fHslider3)); - float fSlow4 = (0.00100000005f * float(fHslider4)); - float fSlow5 = (9.99999975e-06f * float(fHslider5)); - float fSlow6 = (9.99999997e-07f * float(fHslider6)); - float fSlow7 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider7)))))); - float fSlow8 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider8)))))); + float fSlow3 = (9.99999975e-06f * float(fHslider3)); + float fSlow4 = (9.99999997e-07f * float(fHslider4)); + float fSlow5 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider5)))))); + float fSlow6 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider6)))))); + float fSlow7 = (9.99999975e-06f * float(fHslider7)); + float fSlow8 = (9.99999975e-06f * float(fHslider8)); float fSlow9 = (9.99999975e-06f * float(fHslider9)); - float fSlow10 = (9.99999975e-06f * float(fHslider10)); - float fSlow11 = (9.99999975e-06f * float(fHslider11)); + float fSlow10 = (9.99999997e-07f * float(fHslider10)); + float fSlow11 = (0.00100000005f * float(fHslider11)); float fSlow12 = (0.00100000005f * std::exp((fConst1 * (0.0f - (6.28318548f * float(fHslider12)))))); for (int i = 0; (i < count); i = (i + 1)) { float fTemp0 = float(input0[i]); @@ -545,170 +522,198 @@ class faustFverb { fRec1[0] = (fSlow1 + (0.999000013f * fRec1[1])); fRec10[0] = (fSlow2 + (0.999000013f * fRec10[1])); float fTemp2 = std::min(0.5f, std::max(0.25f, (fRec10[0] + 0.150000006f))); - fRec18[0] = (fSlow3 + (0.999000013f * fRec18[1])); - fRec21[0] = (fSlow4 + (0.999000013f * fRec21[1])); - float fTemp3 = (fRec20[1] + (fConst1 * fRec21[0])); - fRec20[0] = (fTemp3 - float(int(fTemp3))); - int iTemp4 = (int((fConst0 * ((fRec18[0] * ftbl0faustFverbSIG0[int((65536.0f * (fRec20[0] + (0.25f - float(int((fRec20[0] + 0.25f)))))))]) + 0.0305097271f))) + -1); - float fTemp5 = ((fRec14[1] != 0.0f) ? (((fRec15[1] > 0.0f) & (fRec15[1] < 1.0f)) ? fRec14[1] : 0.0f) : (((fRec15[1] == 0.0f) & (iTemp4 != iRec16[1])) ? fConst2 : (((fRec15[1] == 1.0f) & (iTemp4 != iRec17[1])) ? fConst3 : 0.0f))); - fRec14[0] = fTemp5; - fRec15[0] = std::max(0.0f, std::min(1.0f, (fRec15[1] + fTemp5))); - iRec16[0] = (((fRec15[1] >= 1.0f) & (iRec17[1] != iTemp4)) ? iTemp4 : iRec16[1]); - iRec17[0] = (((fRec15[1] <= 0.0f) & (iRec16[1] != iTemp4)) ? iTemp4 : iRec17[1]); - fRec32[0] = (fSlow5 + (0.999000013f * fRec32[1])); - fVec0[(IOTA & 131071)] = (fTemp1 * fRec32[0]); - fRec33[0] = (fSlow6 + (0.999000013f * fRec33[1])); - int iTemp6 = std::min(65536, std::max(0, int((fConst0 * fRec33[0])))); - fRec34[0] = (fSlow7 + (0.999000013f * fRec34[1])); - fRec31[0] = (fVec0[((IOTA - iTemp6) & 131071)] + (fRec34[0] * fRec31[1])); - float fTemp7 = (1.0f - fRec34[0]); - fRec35[0] = (fSlow8 + (0.999000013f * fRec35[1])); - fRec30[0] = ((fRec31[0] * fTemp7) + (fRec35[0] * fRec30[1])); - float fTemp8 = (fRec35[0] + 1.0f); - float fTemp9 = (0.0f - (0.5f * fTemp8)); - fRec36[0] = (fSlow9 + (0.999000013f * fRec36[1])); - float fTemp10 = (((0.5f * (fRec30[0] * fTemp8)) + (fRec30[1] * fTemp9)) - (fRec36[0] * fRec28[1])); - fVec1[(IOTA & 1023)] = fTemp10; - fRec28[0] = fVec1[((IOTA - iConst4) & 1023)]; - float fRec29 = (fRec36[0] * fTemp10); - float fTemp11 = ((fRec29 + fRec28[1]) - (fRec36[0] * fRec26[1])); - fVec2[(IOTA & 1023)] = fTemp11; - fRec26[0] = fVec2[((IOTA - iConst5) & 1023)]; - float fRec27 = (fRec36[0] * fTemp11); - fRec37[0] = (fSlow10 + (0.999000013f * fRec37[1])); - float fTemp12 = ((fRec27 + fRec26[1]) - (fRec37[0] * fRec24[1])); - fVec3[(IOTA & 4095)] = fTemp12; - fRec24[0] = fVec3[((IOTA - iConst6) & 4095)]; - float fRec25 = (fRec37[0] * fTemp12); - float fTemp13 = ((fRec25 + fRec24[1]) - (fRec37[0] * fRec22[1])); - fVec4[(IOTA & 2047)] = fTemp13; - fRec22[0] = fVec4[((IOTA - iConst7) & 2047)]; - float fRec23 = (fRec37[0] * fTemp13); + fRec24[0] = (fSlow3 + (0.999000013f * fRec24[1])); + fVec0[(IOTA & 131071)] = (fTemp1 * fRec24[0]); + fRec25[0] = (fSlow4 + (0.999000013f * fRec25[1])); + int iTemp3 = std::min(65536, std::max(0, int((fConst0 * fRec25[0])))); + fRec26[0] = (fSlow5 + (0.999000013f * fRec26[1])); + fRec23[0] = (fVec0[((IOTA - iTemp3) & 131071)] + (fRec26[0] * fRec23[1])); + float fTemp4 = (1.0f - fRec26[0]); + fRec27[0] = (fSlow6 + (0.999000013f * fRec27[1])); + fRec22[0] = ((fRec23[0] * fTemp4) + (fRec27[0] * fRec22[1])); + float fTemp5 = (fRec27[0] + 1.0f); + float fTemp6 = (0.0f - (0.5f * fTemp5)); + fRec28[0] = (fSlow7 + (0.999000013f * fRec28[1])); + float fTemp7 = (((0.5f * (fRec22[0] * fTemp5)) + (fRec22[1] * fTemp6)) - (fRec28[0] * fRec20[1])); + fVec1[(IOTA & 131071)] = fTemp7; + fRec20[0] = fVec1[((IOTA - iConst2) & 131071)]; + float fRec21 = (fRec28[0] * fTemp7); + float fTemp8 = ((fRec21 + fRec20[1]) - (fRec28[0] * fRec18[1])); + fVec2[(IOTA & 131071)] = fTemp8; + fRec18[0] = fVec2[((IOTA - iConst3) & 131071)]; + float fRec19 = (fRec28[0] * fTemp8); + fRec29[0] = (fSlow8 + (0.999000013f * fRec29[1])); + float fTemp9 = ((fRec19 + fRec18[1]) - (fRec29[0] * fRec16[1])); + fVec3[(IOTA & 131071)] = fTemp9; + fRec16[0] = fVec3[((IOTA - iConst4) & 131071)]; + float fRec17 = (fRec29[0] * fTemp9); + float fTemp10 = ((fRec17 + fRec16[1]) - (fRec29[0] * fRec14[1])); + fVec4[(IOTA & 131071)] = fTemp10; + fRec14[0] = fVec4[((IOTA - iConst5) & 131071)]; + float fRec15 = (fRec29[0] * fTemp10); + fRec30[0] = (fSlow9 + (0.999000013f * fRec30[1])); + float fTemp11 = (fRec14[1] + ((fRec10[0] * fRec5[((IOTA - iConst6) & 131071)]) + (fRec15 + (fRec30[0] * fRec12[1])))); + fVec5[(IOTA & 131071)] = fTemp11; + fRec35[0] = (fSlow10 + (0.999000013f * fRec35[1])); fRec38[0] = (fSlow11 + (0.999000013f * fRec38[1])); - float fTemp14 = (fRec22[1] + ((fRec10[0] * fRec5[((IOTA - iConst8) & 32767)]) + (fRec23 + (fRec38[0] * fRec12[1])))); - fVec5[(IOTA & 131071)] = fTemp14; - fRec12[0] = (((1.0f - fRec15[0]) * fVec5[((IOTA - std::min(65536, std::max(0, iRec16[0]))) & 131071)]) + (fRec15[0] * fVec5[((IOTA - std::min(65536, std::max(0, iRec17[0]))) & 131071)])); - float fRec13 = (0.0f - (fRec38[0] * fTemp14)); - float fTemp15 = (fRec13 + fRec12[1]); - fVec6[(IOTA & 32767)] = fTemp15; + float fTemp12 = (fRec37[1] + (fConst1 * fRec38[0])); + fRec37[0] = (fTemp12 - float(int(fTemp12))); + int iTemp13 = (int((fConst0 * ((fRec35[0] * ftbl0faustFverbSIG0[int((65536.0f * (fRec37[0] + (0.25f - float(int((fRec37[0] + 0.25f)))))))]) + 0.0305097271f))) + -1); + float fTemp14 = ((fRec31[1] != 0.0f) ? (((fRec32[1] > 0.0f) & (fRec32[1] < 1.0f)) ? fRec31[1] : 0.0f) : (((fRec32[1] == 0.0f) & (iTemp13 != iRec33[1])) ? fConst7 : (((fRec32[1] == 1.0f) & (iTemp13 != iRec34[1])) ? fConst8 : 0.0f))); + fRec31[0] = fTemp14; + fRec32[0] = std::max(0.0f, std::min(1.0f, (fRec32[1] + fTemp14))); + iRec33[0] = (((fRec32[1] >= 1.0f) & (iRec34[1] != iTemp13)) ? iTemp13 : iRec33[1]); + iRec34[0] = (((fRec32[1] <= 0.0f) & (iRec33[1] != iTemp13)) ? iTemp13 : iRec34[1]); + float fTemp15 = fVec5[((IOTA - std::min(65536, std::max(0, iRec33[0]))) & 131071)]; + fRec12[0] = (fTemp15 + (fRec32[0] * (fVec5[((IOTA - std::min(65536, std::max(0, iRec34[0]))) & 131071)] - fTemp15))); + float fRec13 = (0.0f - (fRec30[0] * fTemp11)); + float fTemp16 = (fRec13 + fRec12[1]); + fVec6[(IOTA & 131071)] = fTemp16; fRec39[0] = (fSlow12 + (0.999000013f * fRec39[1])); - fRec11[0] = (fVec6[((IOTA - iConst9) & 32767)] + (fRec39[0] * fRec11[1])); - float fTemp16 = (1.0f - fRec39[0]); - float fTemp17 = ((fTemp2 * fRec8[1]) + ((fRec10[0] * fRec11[0]) * fTemp16)); - fVec7[(IOTA & 32767)] = fTemp17; - fRec8[0] = fVec7[((IOTA - iConst10) & 32767)]; - float fRec9 = (0.0f - (fTemp2 * fTemp17)); - fRec2[(IOTA & 32767)] = (fRec9 + fRec8[1]); - fRec3[(IOTA & 16383)] = (fRec11[0] * fTemp16); - fRec4[(IOTA & 32767)] = fTemp15; - int iTemp18 = (int((fConst0 * ((fRec18[0] * ftbl0faustFverbSIG0[int((65536.0f * fRec20[0]))]) + 0.025603978f))) + -1); - float fTemp19 = ((fRec45[1] != 0.0f) ? (((fRec46[1] > 0.0f) & (fRec46[1] < 1.0f)) ? fRec45[1] : 0.0f) : (((fRec46[1] == 0.0f) & (iTemp18 != iRec47[1])) ? fConst2 : (((fRec46[1] == 1.0f) & (iTemp18 != iRec48[1])) ? fConst3 : 0.0f))); - fRec45[0] = fTemp19; - fRec46[0] = std::max(0.0f, std::min(1.0f, (fRec46[1] + fTemp19))); - iRec47[0] = (((fRec46[1] >= 1.0f) & (iRec48[1] != iTemp18)) ? iTemp18 : iRec47[1]); - iRec48[0] = (((fRec46[1] <= 0.0f) & (iRec47[1] != iTemp18)) ? iTemp18 : iRec48[1]); - fVec8[(IOTA & 131071)] = (fTemp0 * fRec32[0]); - fRec58[0] = (fVec8[((IOTA - iTemp6) & 131071)] + (fRec34[0] * fRec58[1])); - fRec57[0] = ((fTemp7 * fRec58[0]) + (fRec35[0] * fRec57[1])); - float fTemp20 = (((0.5f * (fRec57[0] * fTemp8)) + (fTemp9 * fRec57[1])) - (fRec36[0] * fRec55[1])); - fVec9[(IOTA & 1023)] = fTemp20; - fRec55[0] = fVec9[((IOTA - iConst11) & 1023)]; - float fRec56 = (fRec36[0] * fTemp20); - float fTemp21 = ((fRec56 + fRec55[1]) - (fRec36[0] * fRec53[1])); - fVec10[(IOTA & 1023)] = fTemp21; - fRec53[0] = fVec10[((IOTA - iConst12) & 1023)]; - float fRec54 = (fRec36[0] * fTemp21); - float fTemp22 = ((fRec54 + fRec53[1]) - (fRec37[0] * fRec51[1])); - fVec11[(IOTA & 4095)] = fTemp22; - fRec51[0] = fVec11[((IOTA - iConst13) & 4095)]; - float fRec52 = (fRec37[0] * fTemp22); - float fTemp23 = ((fRec52 + fRec51[1]) - (fRec37[0] * fRec49[1])); - fVec12[(IOTA & 2047)] = fTemp23; - fRec49[0] = fVec12[((IOTA - iConst14) & 2047)]; - float fRec50 = (fRec37[0] * fTemp23); - float fTemp24 = (fRec49[1] + ((fRec10[0] * fRec2[((IOTA - iConst15) & 32767)]) + (fRec50 + (fRec38[0] * fRec43[1])))); - fVec13[(IOTA & 131071)] = fTemp24; - fRec43[0] = (((1.0f - fRec46[0]) * fVec13[((IOTA - std::min(65536, std::max(0, iRec47[0]))) & 131071)]) + (fRec46[0] * fVec13[((IOTA - std::min(65536, std::max(0, iRec48[0]))) & 131071)])); - float fRec44 = (0.0f - (fRec38[0] * fTemp24)); - float fTemp25 = (fRec44 + fRec43[1]); - fVec14[(IOTA & 32767)] = fTemp25; - fRec42[0] = (fVec14[((IOTA - iConst16) & 32767)] + (fRec39[0] * fRec42[1])); - float fTemp26 = ((fTemp2 * fRec40[1]) + ((fRec10[0] * fTemp16) * fRec42[0])); - fVec15[(IOTA & 16383)] = fTemp26; - fRec40[0] = fVec15[((IOTA - iConst17) & 16383)]; - float fRec41 = (0.0f - (fTemp2 * fTemp26)); - fRec5[(IOTA & 32767)] = (fRec41 + fRec40[1]); - fRec6[(IOTA & 8191)] = (fTemp16 * fRec42[0]); - fRec7[(IOTA & 32767)] = fTemp25; - output0[i] = FAUSTFLOAT(((fTemp0 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec4[((IOTA - iConst18) & 32767)] + fRec4[((IOTA - iConst19) & 32767)]) + fRec2[((IOTA - iConst20) & 32767)]) - (((fRec3[((IOTA - iConst21) & 16383)] + fRec7[((IOTA - iConst22) & 32767)]) + fRec6[((IOTA - iConst23) & 8191)]) + fRec5[((IOTA - iConst24) & 32767)])))))); - output1[i] = FAUSTFLOAT(((fTemp1 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec7[((IOTA - iConst25) & 32767)] + fRec7[((IOTA - iConst26) & 32767)]) + fRec5[((IOTA - iConst27) & 32767)]) - (((fRec6[((IOTA - iConst28) & 8191)] + fRec4[((IOTA - iConst29) & 32767)]) + fRec3[((IOTA - iConst30) & 16383)]) + fRec2[((IOTA - iConst31) & 32767)])))))); + fRec11[0] = (fVec6[((IOTA - iConst9) & 131071)] + (fRec39[0] * fRec11[1])); + float fTemp17 = (1.0f - fRec39[0]); + float fTemp18 = ((fTemp2 * fRec8[1]) + ((fRec10[0] * fRec11[0]) * fTemp17)); + fVec7[(IOTA & 131071)] = fTemp18; + fRec8[0] = fVec7[((IOTA - iConst10) & 131071)]; + float fRec9 = (0.0f - (fTemp2 * fTemp18)); + fRec2[(IOTA & 131071)] = (fRec9 + fRec8[1]); + fRec3[(IOTA & 131071)] = (fRec11[0] * fTemp17); + fRec4[(IOTA & 131071)] = fTemp16; + fVec8[(IOTA & 131071)] = (fTemp0 * fRec24[0]); + fRec54[0] = (fVec8[((IOTA - iTemp3) & 131071)] + (fRec26[0] * fRec54[1])); + fRec53[0] = ((fTemp4 * fRec54[0]) + (fRec27[0] * fRec53[1])); + float fTemp19 = (((0.5f * (fRec53[0] * fTemp5)) + (fTemp6 * fRec53[1])) - (fRec28[0] * fRec51[1])); + fVec9[(IOTA & 131071)] = fTemp19; + fRec51[0] = fVec9[((IOTA - iConst11) & 131071)]; + float fRec52 = (fRec28[0] * fTemp19); + float fTemp20 = ((fRec52 + fRec51[1]) - (fRec28[0] * fRec49[1])); + fVec10[(IOTA & 131071)] = fTemp20; + fRec49[0] = fVec10[((IOTA - iConst12) & 131071)]; + float fRec50 = (fRec28[0] * fTemp20); + float fTemp21 = ((fRec50 + fRec49[1]) - (fRec29[0] * fRec47[1])); + fVec11[(IOTA & 131071)] = fTemp21; + fRec47[0] = fVec11[((IOTA - iConst13) & 131071)]; + float fRec48 = (fRec29[0] * fTemp21); + float fTemp22 = ((fRec48 + fRec47[1]) - (fRec29[0] * fRec45[1])); + fVec12[(IOTA & 131071)] = fTemp22; + fRec45[0] = fVec12[((IOTA - iConst14) & 131071)]; + float fRec46 = (fRec29[0] * fTemp22); + float fTemp23 = (fRec45[1] + ((fRec10[0] * fRec2[((IOTA - iConst15) & 131071)]) + (fRec46 + (fRec30[0] * fRec43[1])))); + fVec13[(IOTA & 131071)] = fTemp23; + int iTemp24 = (int((fConst0 * ((fRec35[0] * ftbl0faustFverbSIG0[int((65536.0f * fRec37[0]))]) + 0.025603978f))) + -1); + float fTemp25 = ((fRec55[1] != 0.0f) ? (((fRec56[1] > 0.0f) & (fRec56[1] < 1.0f)) ? fRec55[1] : 0.0f) : (((fRec56[1] == 0.0f) & (iTemp24 != iRec57[1])) ? fConst7 : (((fRec56[1] == 1.0f) & (iTemp24 != iRec58[1])) ? fConst8 : 0.0f))); + fRec55[0] = fTemp25; + fRec56[0] = std::max(0.0f, std::min(1.0f, (fRec56[1] + fTemp25))); + iRec57[0] = (((fRec56[1] >= 1.0f) & (iRec58[1] != iTemp24)) ? iTemp24 : iRec57[1]); + iRec58[0] = (((fRec56[1] <= 0.0f) & (iRec57[1] != iTemp24)) ? iTemp24 : iRec58[1]); + float fTemp26 = fVec13[((IOTA - std::min(65536, std::max(0, iRec57[0]))) & 131071)]; + fRec43[0] = (fTemp26 + (fRec56[0] * (fVec13[((IOTA - std::min(65536, std::max(0, iRec58[0]))) & 131071)] - fTemp26))); + float fRec44 = (0.0f - (fRec30[0] * fTemp23)); + float fTemp27 = (fRec44 + fRec43[1]); + fVec14[(IOTA & 131071)] = fTemp27; + fRec42[0] = (fVec14[((IOTA - iConst16) & 131071)] + (fRec39[0] * fRec42[1])); + float fTemp28 = ((fTemp2 * fRec40[1]) + ((fRec10[0] * fTemp17) * fRec42[0])); + fVec15[(IOTA & 131071)] = fTemp28; + fRec40[0] = fVec15[((IOTA - iConst17) & 131071)]; + float fRec41 = (0.0f - (fTemp2 * fTemp28)); + fRec5[(IOTA & 131071)] = (fRec41 + fRec40[1]); + fRec6[(IOTA & 131071)] = (fTemp17 * fRec42[0]); + fRec7[(IOTA & 131071)] = fTemp27; + output0[i] = FAUSTFLOAT(((fTemp0 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec4[((IOTA - iConst18) & 131071)] + fRec4[((IOTA - iConst19) & 131071)]) + fRec2[((IOTA - iConst20) & 131071)]) - (((fRec3[((IOTA - iConst21) & 131071)] + fRec7[((IOTA - iConst22) & 131071)]) + fRec6[((IOTA - iConst23) & 131071)]) + fRec5[((IOTA - iConst24) & 131071)])))))); + output1[i] = FAUSTFLOAT(((fTemp1 * fRec0[0]) + (0.600000024f * (fRec1[0] * (((fRec7[((IOTA - iConst25) & 131071)] + fRec7[((IOTA - iConst26) & 131071)]) + fRec5[((IOTA - iConst27) & 131071)]) - (((fRec6[((IOTA - iConst28) & 131071)] + fRec4[((IOTA - iConst29) & 131071)]) + fRec3[((IOTA - iConst30) & 131071)]) + fRec2[((IOTA - iConst31) & 131071)])))))); fRec0[1] = fRec0[0]; fRec1[1] = fRec1[0]; fRec10[1] = fRec10[0]; - fRec18[1] = fRec18[0]; - fRec21[1] = fRec21[0]; - fRec20[1] = fRec20[0]; - fRec14[1] = fRec14[0]; - fRec15[1] = fRec15[0]; - iRec16[1] = iRec16[0]; - iRec17[1] = iRec17[0]; - fRec32[1] = fRec32[0]; - IOTA = (IOTA + 1); - fRec33[1] = fRec33[0]; - fRec34[1] = fRec34[0]; - fRec31[1] = fRec31[0]; - fRec35[1] = fRec35[0]; - fRec30[1] = fRec30[0]; - fRec36[1] = fRec36[0]; - fRec28[1] = fRec28[0]; - fRec26[1] = fRec26[0]; - fRec37[1] = fRec37[0]; fRec24[1] = fRec24[0]; + IOTA = (IOTA + 1); + fRec25[1] = fRec25[0]; + fRec26[1] = fRec26[0]; + fRec23[1] = fRec23[0]; + fRec27[1] = fRec27[0]; fRec22[1] = fRec22[0]; + fRec28[1] = fRec28[0]; + fRec20[1] = fRec20[0]; + fRec18[1] = fRec18[0]; + fRec29[1] = fRec29[0]; + fRec16[1] = fRec16[0]; + fRec14[1] = fRec14[0]; + fRec30[1] = fRec30[0]; + fRec35[1] = fRec35[0]; fRec38[1] = fRec38[0]; + fRec37[1] = fRec37[0]; + fRec31[1] = fRec31[0]; + fRec32[1] = fRec32[0]; + iRec33[1] = iRec33[0]; + iRec34[1] = iRec34[0]; fRec12[1] = fRec12[0]; fRec39[1] = fRec39[0]; fRec11[1] = fRec11[0]; fRec8[1] = fRec8[0]; - fRec45[1] = fRec45[0]; - fRec46[1] = fRec46[0]; - iRec47[1] = iRec47[0]; - iRec48[1] = iRec48[0]; - fRec58[1] = fRec58[0]; - fRec57[1] = fRec57[0]; - fRec55[1] = fRec55[0]; + fRec54[1] = fRec54[0]; fRec53[1] = fRec53[0]; fRec51[1] = fRec51[0]; fRec49[1] = fRec49[0]; + fRec47[1] = fRec47[0]; + fRec45[1] = fRec45[0]; + fRec55[1] = fRec55[0]; + fRec56[1] = fRec56[0]; + iRec57[1] = iRec57[0]; + iRec58[1] = iRec58[0]; fRec43[1] = fRec43[0]; fRec42[1] = fRec42[0]; fRec40[1] = fRec40[0]; } + //[End:compute] } + + FAUSTFLOAT getPredelay() const { return fHslider4; } + void setPredelay(FAUSTFLOAT value) { fHslider4 = value; } + + FAUSTFLOAT getInputAmount() const { return fHslider3; } + void setInputAmount(FAUSTFLOAT value) { fHslider3 = value; } + + FAUSTFLOAT getInputLowPassCutoff() const { return fHslider5; } + void setInputLowPassCutoff(FAUSTFLOAT value) { fHslider5 = value; } + + FAUSTFLOAT getInputHighPassCutoff() const { return fHslider6; } + void setInputHighPassCutoff(FAUSTFLOAT value) { fHslider6 = value; } + + FAUSTFLOAT getInputDiffusion1() const { return fHslider7; } + void setInputDiffusion1(FAUSTFLOAT value) { fHslider7 = value; } + + FAUSTFLOAT getInputDiffusion2() const { return fHslider8; } + void setInputDiffusion2(FAUSTFLOAT value) { fHslider8 = value; } + + FAUSTFLOAT getTailDensity() const { return fHslider9; } + void setTailDensity(FAUSTFLOAT value) { fHslider9 = value; } + + FAUSTFLOAT getDecay() const { return fHslider2; } + void setDecay(FAUSTFLOAT value) { fHslider2 = value; } + + FAUSTFLOAT getDamping() const { return fHslider12; } + void setDamping(FAUSTFLOAT value) { fHslider12 = value; } + + FAUSTFLOAT getModulatorFrequency() const { return fHslider11; } + void setModulatorFrequency(FAUSTFLOAT value) { fHslider11 = value; } + + FAUSTFLOAT getModulatorDepth() const { return fHslider10; } + void setModulatorDepth(FAUSTFLOAT value) { fHslider10 = value; } + + FAUSTFLOAT getDry() const { return fHslider0; } + void setDry(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getWet() const { return fHslider1; } + void setWet(FAUSTFLOAT value) { fHslider1 = value; } + + //[End:class] }; +//[After:class] -#ifdef FAUST_UIMACROS - - - - #define FAUST_LIST_ACTIVES(p) \ - p(HORIZONTALSLIDER, Predelay, "Predelay", fHslider6, 0.0f, 0.0f, 300.0f, 1.0f) \ - p(HORIZONTALSLIDER, Input_amount, "Input amount", fHslider5, 100.0f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Input_low_pass_cutoff, "Input low pass cutoff", fHslider7, 10000.0f, 1.0f, 20000.0f, 1.0f) \ - p(HORIZONTALSLIDER, Input_high_pass_cutoff, "Input high pass cutoff", fHslider8, 100.0f, 1.0f, 1000.0f, 1.0f) \ - p(HORIZONTALSLIDER, Input_diffusion_1, "Input diffusion 1", fHslider9, 75.0f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Input_diffusion_2, "Input diffusion 2", fHslider10, 62.5f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Tail_density, "Tail density", fHslider11, 70.0f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Decay, "Decay", fHslider2, 50.0f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Damping, "Damping", fHslider12, 5500.0f, 10.0f, 20000.0f, 1.0f) \ - p(HORIZONTALSLIDER, Modulator_frequency, "Modulator frequency", fHslider4, 1.0f, 0.01f, 4.0f, 0.01f) \ - p(HORIZONTALSLIDER, Modulator_depth, "Modulator depth", fHslider3, 0.5f, 0.0f, 10.0f, 0.10000000000000001f) \ - p(HORIZONTALSLIDER, Dry, "Dry", fHslider0, 100.0f, 0.0f, 100.0f, 0.01f) \ - p(HORIZONTALSLIDER, Wet, "Wet", fHslider1, 50.0f, 0.0f, 100.0f, 0.01f) \ - - #define FAUST_LIST_PASSIVES(p) \ #endif - +#if defined(__GNUC__) +#pragma GCC diagnostic pop #endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/effects/gen/gate.hxx b/src/sfizz/effects/gen/gate.hxx index 93da987b..f1da8235 100644 --- a/src/sfizz/effects/gen/gate.hxx +++ b/src/sfizz/effects/gen/gate.hxx @@ -1,7 +1,11 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ name: "gate" -Code generated with Faust 2.27.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -scal -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0 ------------------------------------------------------------ */ #ifndef __faustGate_H__ @@ -9,101 +13,77 @@ Compilation options: -lang cpp -inpl -scal -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustGate #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustGate { + //[Begin:class] - public: - - float fConst0; + + private: + FAUSTFLOAT fHslider0; FAUSTFLOAT fHslider1; int fSampleRate; + float fConst0; float fConst1; - float fConst2; float fRec3[2]; FAUSTFLOAT fHslider2; int iVec0[2]; - float fConst3; FAUSTFLOAT fHslider3; int iRec4[2]; float fRec1[2]; float fRec0[2]; - + public: + - void metadata() { - } - - int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { - (void)sample_rate; + //[Begin:classInit] + //[End:classInit] } - + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = float(_oversampling); - fConst1 = std::min(192000.0f, std::max(1.0f, float(fSampleRate))); - fConst2 = (1.0f / fConst1); - fConst3 = (fConst1 * fConst0); + fConst0 = float(fSampleRate); + fConst1 = (1.0f / fConst0); + //[End:instanceConstants] } - + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] fHslider0 = FAUSTFLOAT(0.0f); fHslider1 = FAUSTFLOAT(0.0f); fHslider2 = FAUSTFLOAT(0.0f); fHslider3 = FAUSTFLOAT(0.0f); + //[End:instanceResetUserInterface] } - + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0f; } @@ -119,44 +99,45 @@ class faustGate { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec0[l4] = 0.0f; } + //[End:instanceClear] } - + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - faustGate* clone() { - return new faustGate(); - } - + + int getSampleRate() { return fSampleRate; } - - void buildUserInterface() { - } - - void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - float fSlow0 = (fConst0 * float(fHslider0)); - float fSlow1 = (fConst0 * float(fHslider1)); + float fSlow0 = float(fHslider0); + float fSlow1 = float(fHslider1); float fSlow2 = std::min(fSlow0, fSlow1); int iSlow3 = (std::fabs(fSlow2) < 1.1920929e-07f); - float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow3 ? 1.0f : fSlow2))))); + float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow3 ? 1.0f : fSlow2))))); float fSlow5 = (1.0f - fSlow4); float fSlow6 = std::pow(10.0f, (0.0500000007f * float(fHslider2))); - int iSlow7 = int((fConst3 * float(fHslider3))); + int iSlow7 = int((fConst0 * float(fHslider3))); int iSlow8 = (std::fabs(fSlow0) < 1.1920929e-07f); - float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow8 ? 1.0f : fSlow0))))); + float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow8 ? 1.0f : fSlow0))))); int iSlow10 = (std::fabs(fSlow1) < 1.1920929e-07f); - float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow10 ? 1.0f : fSlow1))))); + float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow10 ? 1.0f : fSlow1))))); for (int i = 0; (i < count); i = (i + 1)) { float fTemp0 = float(input0[i]); fRec3[0] = ((fRec3[1] * fSlow4) + (std::fabs(fTemp0) * fSlow5)); @@ -175,22 +156,30 @@ class faustGate { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getThreshold() const { return fHslider2; } + void setThreshold(FAUSTFLOAT value) { fHslider2 = value; } + + FAUSTFLOAT getAttack() const { return fHslider0; } + void setAttack(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getHold() const { return fHslider3; } + void setHold(FAUSTFLOAT value) { fHslider3 = value; } + + FAUSTFLOAT getRelease() const { return fHslider1; } + void setRelease(FAUSTFLOAT value) { fHslider1 = value; } + + //[End:class] }; +//[After:class] -#ifdef FAUST_UIMACROS - - - - #define FAUST_LIST_ACTIVES(p) \ - p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider2, 0.0f, -60.0f, 0.0f, 0.01f) \ - p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 10.0f, 0.001f) \ - p(HORIZONTALSLIDER, Hold, "Hold", fHslider3, 0.0f, 0.0f, 10.0f, 0.001f) \ - p(HORIZONTALSLIDER, Release, "Release", fHslider1, 0.0f, 0.0f, 5.0f, 0.001f) \ - - #define FAUST_LIST_PASSIVES(p) \ #endif - +#if defined(__GNUC__) +#pragma GCC diagnostic pop #endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/effects/gen/limiter.hxx b/src/sfizz/effects/gen/limiter.hxx index 420f6728..0963f670 100644 --- a/src/sfizz/effects/gen/limiter.hxx +++ b/src/sfizz/effects/gen/limiter.hxx @@ -1,135 +1,171 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ name: "limiter" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -scal -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0 ------------------------------------------------------------ */ -#ifndef __faustLimiter_H__ -#define __faustLimiter_H__ +#ifndef __faustLimiter_H__ +#define __faustLimiter_H__ #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include #include -#ifndef FAUSTCLASS + +#ifndef FAUSTCLASS #define FAUSTCLASS faustLimiter #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustLimiter { + //[Begin:class] -private: - int fSampleRate; - float fConst0; - float fConst1; - float fConst2; - float fConst3; - float fConst4; - float fConst5; - float fConst6; - float fRec2[2]; - float fRec1[2]; - float fRec0[2]; - float fRec5[2]; - float fRec4[2]; - float fRec3[2]; + + private: + + int fSampleRate; + float fConst0; + float fConst1; + float fConst2; + float fConst3; + float fConst4; + float fConst5; + float fConst6; + float fRec2[2]; + float fRec1[2]; + float fRec0[2]; + float fRec5[2]; + float fRec4[2]; + float fRec3[2]; + + public: + -public: - static void classInit(int sample_rate) - { - (void)sample_rate; - } + static constexpr int getNumInputs() { + return 2; + } + static constexpr int getNumOutputs() { + return 2; + } + + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] + } + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] + fSampleRate = sample_rate; + fConst0 = float(fSampleRate); + fConst1 = std::exp((0.0f - (2500.0f / fConst0))); + fConst2 = (1.0f - fConst1); + fConst3 = std::exp((0.0f - (1250.0f / fConst0))); + fConst4 = (1.0f - fConst3); + fConst5 = std::exp((0.0f - (2.0f / fConst0))); + fConst6 = (1.0f - fConst5); + //[End:instanceConstants] + } + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + //[End:instanceResetUserInterface] + } + + void instanceClear() { + //[Begin:instanceClear] + for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { + fRec2[l0] = 0.0f; + } + for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { + fRec1[l1] = 0.0f; + } + for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { + fRec0[l2] = 0.0f; + } + for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { + fRec5[l3] = 0.0f; + } + for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { + fRec4[l4] = 0.0f; + } + for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { + fRec3[l5] = 0.0f; + } + //[End:instanceClear] + } + + void init(int sample_rate) { + //[Begin:init] + classInit(sample_rate); + instanceInit(sample_rate); + //[End:init] + } + void instanceInit(int sample_rate) { + //[Begin:instanceInit] + instanceConstants(sample_rate); + instanceResetUserInterface(); + instanceClear(); + //[End:instanceInit] + } + + + int getSampleRate() { + return fSampleRate; + } + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; + FAUSTFLOAT* output0 = outputs[0]; + FAUSTFLOAT* output1 = outputs[1]; + for (int i = 0; (i < count); i = (i + 1)) { + float fTemp0 = float(input0[i]); + float fTemp1 = float(input1[i]); + float fTemp2 = std::fabs(fTemp0); + fRec2[0] = std::max(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2))); + fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0])); + fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f))); + output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0])); + float fTemp3 = std::fabs(fTemp1); + fRec5[0] = std::max(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3))); + fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0])); + fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f))); + output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0])); + fRec2[1] = fRec2[0]; + fRec1[1] = fRec1[0]; + fRec0[1] = fRec0[0]; + fRec5[1] = fRec5[0]; + fRec4[1] = fRec4[0]; + fRec3[1] = fRec3[0]; + } + //[End:compute] + } - void instanceConstants(int sample_rate) - { - fSampleRate = sample_rate; - fConst0 = (std::min(192000.0f, std::max(1.0f, float(fSampleRate))) * float(_oversampling)); - fConst1 = std::exp((0.0f - (2500.0f / fConst0))); - fConst2 = (1.0f - fConst1); - fConst3 = std::exp((0.0f - (1250.0f / fConst0))); - fConst4 = (1.0f - fConst3); - fConst5 = std::exp((0.0f - (2.0f / fConst0))); - fConst6 = (1.0f - fConst5); - } - void instanceResetUserInterface() - { - } - - void instanceClear() - { - for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { - fRec2[l0] = 0.0f; - } - for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { - fRec1[l1] = 0.0f; - } - for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { - fRec0[l2] = 0.0f; - } - for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fRec5[l3] = 0.0f; - } - for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { - fRec4[l4] = 0.0f; - } - for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { - fRec3[l5] = 0.0f; - } - } - - void init(int sample_rate) - { - classInit(sample_rate); - instanceInit(sample_rate); - } - void instanceInit(int sample_rate) - { - instanceConstants(sample_rate); - instanceResetUserInterface(); - instanceClear(); - } - - int getSampleRate() - { - return fSampleRate; - } - - void compute(int count, const FAUSTFLOAT* const* inputs, FAUSTFLOAT* const* outputs) - { - const FAUSTFLOAT* input0 = inputs[0]; - const FAUSTFLOAT* input1 = inputs[1]; - FAUSTFLOAT* output0 = outputs[0]; - FAUSTFLOAT* output1 = outputs[1]; - for (int i = 0; (i < count); i = (i + 1)) { - float fTemp0 = float(input0[i]); - float fTemp1 = float(input1[i]); - float fTemp2 = std::fabs(fTemp0); - fRec2[0] = std::max(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2))); - fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0])); - fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f))); - output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0])); - float fTemp3 = std::fabs(fTemp1); - fRec5[0] = std::max(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3))); - fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0])); - fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f))); - output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0])); - fRec2[1] = fRec2[0]; - fRec1[1] = fRec1[0]; - fRec0[1] = fRec0[0]; - fRec5[1] = fRec5[0]; - fRec4[1] = fRec4[0]; - fRec3[1] = fRec3[0]; - } - } + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chApf1p.hxx b/src/sfizz/gen/filters/sfz2chApf1p.hxx index 08c62853..33ccbcfe 100644 --- a/src/sfizz/gen/filters/sfz2chApf1p.hxx +++ b/src/sfizz/gen/filters/sfz2chApf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chApf1p_H__ @@ -11,98 +15,71 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chApf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; } @@ -112,40 +89,41 @@ class faust2chApf1p : public sfzFilterDsp { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chApf1p* clone() { - return new faust2chApf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (((fConst2 * double(fHslider0)) + -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] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0]))); fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1])); @@ -154,8 +132,21 @@ class faust2chApf1p : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBpf1p.hxx b/src/sfizz/gen/filters/sfz2chBpf1p.hxx index 9aa4ab02..6145ed42 100644 --- a/src/sfizz/gen/filters/sfz2chBpf1p.hxx +++ b/src/sfizz/gen/filters/sfz2chBpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf1p_H__ @@ -11,100 +15,73 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec2[2]; double fRec1[2]; double fRec0[2]; double fRec4[2]; double fRec3[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -120,40 +97,41 @@ class faust2chBpf1p : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBpf1p* clone() { - return new faust2chBpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1); fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1])); double fTemp2 = (1.0 - fRec2[0]); fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1])); @@ -169,8 +147,21 @@ class faust2chBpf1p : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec3[1] = fRec3[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBpf2p.hxx b/src/sfizz/gen/filters/sfz2chBpf2p.hxx index 011f0d3d..4ebc2083 100644 --- a/src/sfizz/gen/filters/sfz2chBpf2p.hxx +++ b/src/sfizz/gen/filters/sfz2chBpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf2p_H__ @@ -11,34 +15,38 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fRec2[2]; double fVec0[2]; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec3[2]; double fRec4[2]; double fVec1[2]; @@ -52,71 +60,40 @@ class faust2chBpf2p : public sfzFilterDsp { double fVec5[2]; double fRec8[2]; double fRec7[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -162,38 +139,39 @@ class faust2chBpf2p : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec7[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBpf2p* clone() { - return new faust2chBpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -238,8 +216,24 @@ class faust2chBpf2p : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[1] = fRec7[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBpf2pSv.hxx b/src/sfizz/gen/filters/sfz2chBpf2pSv.hxx index f85094dd..2719a4d8 100644 --- a/src/sfizz/gen/filters/sfz2chBpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfz2chBpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf2pSv_H__ @@ -11,104 +15,77 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec3[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; double fRec7[2]; double fRec8[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; } @@ -130,38 +107,39 @@ class faust2chBpf2pSv : public sfzFilterDsp { for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBpf2pSv* clone() { - return new faust2chBpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); @@ -194,8 +172,24 @@ class faust2chBpf2pSv : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec8[1] = fRec8[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBpf4p.hxx b/src/sfizz/gen/filters/sfz2chBpf4p.hxx index cf9d5cb5..84fe9ac1 100644 --- a/src/sfizz/gen/filters/sfz2chBpf4p.hxx +++ b/src/sfizz/gen/filters/sfz2chBpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf4p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fRec5[2]; double fVec0[2]; @@ -62,71 +70,40 @@ class faust2chBpf4p : public sfzFilterDsp { double fVec11[2]; double fRec10[2]; double fRec9[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -202,38 +179,39 @@ class faust2chBpf4p : public sfzFilterDsp { for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) { fRec9[l24] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBpf4p* clone() { - return new faust2chBpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -298,8 +276,24 @@ class faust2chBpf4p : public sfzFilterDsp { fRec10[1] = fRec10[0]; fRec9[1] = fRec9[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBpf6p.hxx b/src/sfizz/gen/filters/sfz2chBpf6p.hxx index 2e8808c6..473690f6 100644 --- a/src/sfizz/gen/filters/sfz2chBpf6p.hxx +++ b/src/sfizz/gen/filters/sfz2chBpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBpf6p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fRec7[2]; double fVec0[2]; @@ -72,71 +80,40 @@ class faust2chBpf6p : public sfzFilterDsp { double fVec17[2]; double fRec12[2]; double fRec11[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -242,38 +219,39 @@ class faust2chBpf6p : public sfzFilterDsp { for (int l34 = 0; (l34 < 2); l34 = (l34 + 1)) { fRec11[l34] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBpf6p* clone() { - return new faust2chBpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -358,8 +336,24 @@ class faust2chBpf6p : public sfzFilterDsp { fRec12[1] = fRec12[0]; fRec11[1] = fRec11[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBrf1p.hxx b/src/sfizz/gen/filters/sfz2chBrf1p.hxx index 99b3bd51..4817a6fc 100644 --- a/src/sfizz/gen/filters/sfz2chBrf1p.hxx +++ b/src/sfizz/gen/filters/sfz2chBrf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf1p_H__ @@ -11,100 +15,73 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBrf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec2[2]; double fRec1[2]; double fRec0[2]; double fRec4[2]; double fRec3[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -120,40 +97,41 @@ class faust2chBrf1p : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBrf1p* clone() { - return new faust2chBrf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (((fConst2 * double(fHslider0)) + -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] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1); fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1])); fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1]))); output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0])))); @@ -166,8 +144,21 @@ class faust2chBrf1p : public sfzFilterDsp { fRec4[1] = fRec4[0]; fRec3[1] = fRec3[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBrf2p.hxx b/src/sfizz/gen/filters/sfz2chBrf2p.hxx index 91e28d07..2c4a25af 100644 --- a/src/sfizz/gen/filters/sfz2chBrf2p.hxx +++ b/src/sfizz/gen/filters/sfz2chBrf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf2p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBrf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -50,71 +58,40 @@ class faust2chBrf2p : public sfzFilterDsp { double fVec5[2]; double fRec6[2]; double fRec5[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -154,37 +131,38 @@ class faust2chBrf2p : public sfzFilterDsp { for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) { fRec5[l12] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBrf2p* clone() { - return new faust2chBrf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); + double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = (1.0 - fSlow0); double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4); @@ -224,8 +202,24 @@ class faust2chBrf2p : public sfzFilterDsp { fRec6[1] = fRec6[0]; fRec5[1] = fRec5[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chBrf2pSv.hxx b/src/sfizz/gen/filters/sfz2chBrf2pSv.hxx index 773f7fd7..020f13b0 100644 --- a/src/sfizz/gen/filters/sfz2chBrf2pSv.hxx +++ b/src/sfizz/gen/filters/sfz2chBrf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chBrf2pSv_H__ @@ -11,104 +15,77 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chBrf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec5[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec6[2]; double fRec2[2]; double fRec3[2]; double fRec9[2]; double fRec10[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec5[l0] = 0.0; } @@ -130,38 +107,39 @@ class faust2chBrf2pSv : public sfzFilterDsp { for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec10[l6] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chBrf2pSv* clone() { - return new faust2chBrf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); @@ -196,8 +174,24 @@ class faust2chBrf2pSv : public sfzFilterDsp { fRec9[1] = fRec9[0]; fRec10[1] = fRec10[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chEqHshelf.hxx b/src/sfizz/gen/filters/sfz2chEqHshelf.hxx index 85c9ea93..62447f2b 100644 --- a/src/sfizz/gen/filters/sfz2chEqHshelf.hxx +++ b/src/sfizz/gen/filters/sfz2chEqHshelf.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chEqHshelf_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include @@ -21,26 +25,30 @@ static double faust2chEqHshelf_faustpower2_f(double value) { return (value * value); } -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chEqHshelf #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faust2chEqHshelf : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fBandwidth; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -56,72 +64,41 @@ class faust2chEqHshelf : public sfzFilterDsp { double fVec5[2]; double fRec8[2]; double fRec7[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -167,44 +144,45 @@ class faust2chEqHshelf : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec7[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chEqHshelf* clone() { - return new faust2chEqHshelf(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow4 = ((fSlow1 + 1.0) * fSlow3); double fSlow5 = (faust2chEqHshelf_faustpower2_f(fSlow1) + 1.0); double fSlow6 = (fSlow1 + -1.0); double fSlow7 = faust2chEqHshelf_faustpower2_f(fSlow6); - double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow5 / fSlow7) + -0.01), std::max(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0))))); - double fSlow9 = (fSlow3 * fSlow6); + double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow5 / fSlow7) + -0.01), std::max(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0))))); + double fSlow9 = (fSlow6 * fSlow3); double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9)); double fSlow11 = (1.0 - fSlow0); double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11); @@ -249,8 +227,27 @@ class faust2chEqHshelf : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[1] = fRec7[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chEqLshelf.hxx b/src/sfizz/gen/filters/sfz2chEqLshelf.hxx index 42569770..5859b454 100644 --- a/src/sfizz/gen/filters/sfz2chEqLshelf.hxx +++ b/src/sfizz/gen/filters/sfz2chEqLshelf.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chEqLshelf_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include @@ -21,26 +25,30 @@ static double faust2chEqLshelf_faustpower2_f(double value) { return (value * value); } -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chEqLshelf #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faust2chEqLshelf : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fBandwidth; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -56,72 +64,41 @@ class faust2chEqLshelf : public sfzFilterDsp { double fVec5[2]; double fRec8[2]; double fRec7[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -167,44 +144,45 @@ class faust2chEqLshelf : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec7[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chEqLshelf* clone() { - return new faust2chEqLshelf(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow4 = ((fSlow1 + 1.0) * fSlow3); double fSlow5 = (fSlow1 + -1.0); - double fSlow6 = (fSlow3 * fSlow5); + double fSlow6 = (fSlow5 * fSlow3); double fSlow7 = (faust2chEqLshelf_faustpower2_f(fSlow1) + 1.0); double fSlow8 = faust2chEqLshelf_faustpower2_f(fSlow5); - double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow7 / fSlow8) + -0.01), std::max(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0))))); + double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow7 / fSlow8) + -0.01), std::max(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0))))); double fSlow10 = (fSlow6 + fSlow9); double fSlow11 = ((fSlow1 + fSlow10) + 1.0); double fSlow12 = (1.0 - fSlow0); @@ -249,8 +227,27 @@ class faust2chEqLshelf : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[1] = fRec7[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chEqPeak.hxx b/src/sfizz/gen/filters/sfz2chEqPeak.hxx index 9a3e28a3..1849c94f 100644 --- a/src/sfizz/gen/filters/sfz2chEqPeak.hxx +++ b/src/sfizz/gen/filters/sfz2chEqPeak.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chEqPeak_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif /* link with : "" */ #include @@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chEqPeak #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faust2chEqPeak : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst3; - FAUSTFLOAT fBandwidth; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -54,73 +62,42 @@ class faust2chEqPeak : public sfzFilterDsp { double fVec5[2]; double fRec7[2]; double fRec6[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); fConst3 = (2.1775860903036022 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); - fPkShGain = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -163,45 +140,46 @@ class faust2chEqPeak : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec6[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chEqPeak* clone() { - return new faust2chEqPeak(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = std::max(0.0, double(fCutoff)); + double fSlow1 = std::max(0.0, double(fHslider0)); double fSlow2 = (fConst2 * fSlow1); double fSlow3 = std::sin(fSlow2); - double fSlow4 = std::max(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3))))))); - double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); + double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow5 = std::max(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3))))))); double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5))); double fSlow7 = (fSlow6 + 1.0); double fSlow8 = (1.0 - fSlow0); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8); - double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4)); + double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5)); double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8); double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8); double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8); @@ -239,8 +217,27 @@ class faust2chEqPeak : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[1] = fRec6[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHpf1p.hxx b/src/sfizz/gen/filters/sfz2chHpf1p.hxx index 9040783f..57ca9c51 100644 --- a/src/sfizz/gen/filters/sfz2chHpf1p.hxx +++ b/src/sfizz/gen/filters/sfz2chHpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf1p_H__ @@ -11,98 +15,71 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; } @@ -112,40 +89,41 @@ class faust2chHpf1p : public sfzFilterDsp { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHpf1p* clone() { - return new faust2chHpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); double fTemp2 = (fRec1[0] + 1.0); double fTemp3 = (0.0 - (0.5 * fTemp2)); @@ -156,8 +134,21 @@ class faust2chHpf1p : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHpf2p.hxx b/src/sfizz/gen/filters/sfz2chHpf2p.hxx index 0906a3b1..99967081 100644 --- a/src/sfizz/gen/filters/sfz2chHpf2p.hxx +++ b/src/sfizz/gen/filters/sfz2chHpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf2p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -51,71 +59,40 @@ class faust2chHpf2p : public sfzFilterDsp { double fVec5[2]; double fRec7[2]; double fRec6[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -158,38 +135,39 @@ class faust2chHpf2p : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec6[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHpf2p* clone() { - return new faust2chHpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -232,8 +210,24 @@ class faust2chHpf2p : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[1] = fRec6[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHpf2pSv.hxx b/src/sfizz/gen/filters/sfz2chHpf2pSv.hxx index 4089b324..6ff0bb53 100644 --- a/src/sfizz/gen/filters/sfz2chHpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfz2chHpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf2pSv_H__ @@ -11,104 +15,77 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec4[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec3[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; double fRec7[2]; double fRec8[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec4[l0] = 0.0; } @@ -130,38 +107,39 @@ class faust2chHpf2pSv : public sfzFilterDsp { for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHpf2pSv* clone() { - return new faust2chHpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); @@ -194,8 +172,24 @@ class faust2chHpf2pSv : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec8[1] = fRec8[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHpf4p.hxx b/src/sfizz/gen/filters/sfz2chHpf4p.hxx index 87cf14ee..d6e829be 100644 --- a/src/sfizz/gen/filters/sfz2chHpf4p.hxx +++ b/src/sfizz/gen/filters/sfz2chHpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf4p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec5[2]; @@ -61,71 +69,40 @@ class faust2chHpf4p : public sfzFilterDsp { double fVec11[2]; double fRec9[2]; double fRec8[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -198,38 +175,39 @@ class faust2chHpf4p : public sfzFilterDsp { for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) { fRec8[l23] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHpf4p* clone() { - return new faust2chHpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -294,8 +272,24 @@ class faust2chHpf4p : public sfzFilterDsp { fRec9[1] = fRec9[0]; fRec8[1] = fRec8[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHpf6p.hxx b/src/sfizz/gen/filters/sfz2chHpf6p.hxx index dcdd4ffb..b2fdbd97 100644 --- a/src/sfizz/gen/filters/sfz2chHpf6p.hxx +++ b/src/sfizz/gen/filters/sfz2chHpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHpf6p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec7[2]; @@ -71,71 +79,40 @@ class faust2chHpf6p : public sfzFilterDsp { double fVec17[2]; double fRec11[2]; double fRec10[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -238,38 +215,39 @@ class faust2chHpf6p : public sfzFilterDsp { for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) { fRec10[l33] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHpf6p* clone() { - return new faust2chHpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -356,8 +334,24 @@ class faust2chHpf6p : public sfzFilterDsp { fRec11[1] = fRec11[0]; fRec10[1] = fRec10[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chHsh.hxx b/src/sfizz/gen/filters/sfz2chHsh.hxx index f58b9574..7f7240d1 100644 --- a/src/sfizz/gen/filters/sfz2chHsh.hxx +++ b/src/sfizz/gen/filters/sfz2chHsh.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chHsh_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chHsh : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -53,72 +61,41 @@ class faust2chHsh : public sfzFilterDsp { double fVec5[2]; double fRec8[2]; double fRec7[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -164,48 +141,49 @@ class faust2chHsh : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec7[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chHsh* clone() { - return new faust2chHsh(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - 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 fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1))))); + double fSlow6 = ((fSlow1 + -1.0) * fSlow3); double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6)); double fSlow8 = (1.0 - fSlow0); double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8); - double fSlow10 = (fSlow1 + fSlow6); - double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8); - double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8); - double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8); + double fSlow10 = (fSlow6 + fSlow5); + double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8); + double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8); + double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8); double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); @@ -243,8 +221,27 @@ class faust2chHsh : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[1] = fRec7[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider1; } + void setResonance(FAUSTFLOAT value) { fVslider1 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLpf1p.hxx b/src/sfizz/gen/filters/sfz2chLpf1p.hxx index a11d4fa6..83819344 100644 --- a/src/sfizz/gen/filters/sfz2chLpf1p.hxx +++ b/src/sfizz/gen/filters/sfz2chLpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf1p_H__ @@ -11,98 +15,71 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec1[l0] = 0.0; } @@ -112,40 +89,41 @@ class faust2chLpf1p : public sfzFilterDsp { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec2[l2] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLpf1p* clone() { - return new faust2chLpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); - fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); double fTemp2 = (1.0 - fRec1[0]); output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2)); @@ -155,8 +133,21 @@ class faust2chLpf1p : public sfzFilterDsp { fRec0[1] = fRec0[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLpf2p.hxx b/src/sfizz/gen/filters/sfz2chLpf2p.hxx index 9b6d4dc1..b120b92a 100644 --- a/src/sfizz/gen/filters/sfz2chLpf2p.hxx +++ b/src/sfizz/gen/filters/sfz2chLpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf2p_H__ @@ -11,31 +15,35 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; double fVec0[2]; @@ -51,71 +59,40 @@ class faust2chLpf2p : public sfzFilterDsp { double fVec5[2]; double fRec7[2]; double fRec6[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -158,37 +135,38 @@ class faust2chLpf2p : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec6[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLpf2p* clone() { - return new faust2chLpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -233,8 +211,24 @@ class faust2chLpf2p : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[1] = fRec6[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLpf2pSv.hxx b/src/sfizz/gen/filters/sfz2chLpf2pSv.hxx index 2bc4fe1a..75c2243b 100644 --- a/src/sfizz/gen/filters/sfz2chLpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfz2chLpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf2pSv_H__ @@ -11,104 +15,77 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec3[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; double fRec7[2]; double fRec8[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; } @@ -130,38 +107,39 @@ class faust2chLpf2pSv : public sfzFilterDsp { for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) { fRec8[l6] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLpf2pSv* clone() { - return new faust2chLpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); @@ -194,8 +172,24 @@ class faust2chLpf2pSv : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec8[1] = fRec8[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLpf4p.hxx b/src/sfizz/gen/filters/sfz2chLpf4p.hxx index f0a22427..448704b2 100644 --- a/src/sfizz/gen/filters/sfz2chLpf4p.hxx +++ b/src/sfizz/gen/filters/sfz2chLpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf4p_H__ @@ -11,31 +15,35 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; double fVec0[2]; @@ -61,71 +69,40 @@ class faust2chLpf4p : public sfzFilterDsp { double fVec11[2]; double fRec9[2]; double fRec8[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -198,37 +175,38 @@ class faust2chLpf4p : public sfzFilterDsp { for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) { fRec8[l23] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLpf4p* clone() { - return new faust2chLpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -295,8 +273,24 @@ class faust2chLpf4p : public sfzFilterDsp { fRec9[1] = fRec9[0]; fRec8[1] = fRec8[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLpf6p.hxx b/src/sfizz/gen/filters/sfz2chLpf6p.hxx index c09feb80..0d3ce7f2 100644 --- a/src/sfizz/gen/filters/sfz2chLpf6p.hxx +++ b/src/sfizz/gen/filters/sfz2chLpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLpf6p_H__ @@ -11,37 +15,41 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; - double fVec0[2]; double fRec7[2]; - double fVec1[2]; + double fVec0[2]; double fRec8[2]; + double fVec1[2]; double fVec2[2]; double fRec9[2]; double fRec6[2]; @@ -71,85 +79,54 @@ class faust2chLpf6p : public sfzFilterDsp { double fVec17[2]; double fRec11[2]; double fRec10[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) { - fVec0[l1] = 0.0; + fRec7[l1] = 0.0; } for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { - fRec7[l2] = 0.0; + fVec0[l2] = 0.0; } for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) { - fVec1[l3] = 0.0; + fRec8[l3] = 0.0; } for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { - fRec8[l4] = 0.0; + fVec1[l4] = 0.0; } for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) { fVec2[l5] = 0.0; @@ -238,37 +215,38 @@ class faust2chLpf6p : public sfzFilterDsp { for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) { fRec10[l33] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLpf6p* clone() { - return new faust2chLpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -281,14 +259,14 @@ class faust2chLpf6p : public sfzFilterDsp { double fTemp0 = double(input0[i]); double fTemp1 = double(input1[i]); fRec2[0] = (fSlow7 + (fSlow5 * fRec2[1])); - fVec0[0] = (fTemp0 * fRec2[0]); fRec7[0] = ((fSlow5 * fRec7[1]) + fSlow8); double fTemp2 = (fTemp0 * fRec7[0]); - fVec1[0] = fTemp2; + fVec0[0] = fTemp2; fRec8[0] = ((fSlow5 * fRec8[1]) + fSlow9); - fVec2[0] = (fVec1[1] - (fRec8[0] * fRec5[1])); + fVec1[0] = (fVec0[1] - (fRec8[0] * fRec5[1])); + fVec2[0] = (fTemp0 * fRec2[0]); fRec9[0] = ((fSlow5 * fRec9[1]) + fSlow10); - fRec6[0] = ((fVec0[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1])); + fRec6[0] = ((fVec1[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1])); fRec5[0] = fRec6[0]; fVec3[0] = (fRec2[0] * fRec5[0]); double fTemp3 = (fRec7[0] * fRec5[0]); @@ -323,10 +301,10 @@ class faust2chLpf6p : public sfzFilterDsp { fRec10[0] = fRec11[0]; output1[i] = FAUSTFLOAT(fRec10[0]); fRec2[1] = fRec2[0]; - fVec0[1] = fVec0[0]; fRec7[1] = fRec7[0]; - fVec1[1] = fVec1[0]; + fVec0[1] = fVec0[0]; fRec8[1] = fRec8[0]; + fVec1[1] = fVec1[0]; fVec2[1] = fVec2[0]; fRec9[1] = fRec9[0]; fRec6[1] = fRec6[0]; @@ -357,8 +335,24 @@ class faust2chLpf6p : public sfzFilterDsp { fRec11[1] = fRec11[0]; fRec10[1] = fRec10[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chLsh.hxx b/src/sfizz/gen/filters/sfz2chLsh.hxx index ba8105de..41d5f8a3 100644 --- a/src/sfizz/gen/filters/sfz2chLsh.hxx +++ b/src/sfizz/gen/filters/sfz2chLsh.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chLsh_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chLsh : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -53,72 +61,41 @@ class faust2chLsh : public sfzFilterDsp { double fVec5[2]; double fRec8[2]; double fRec7[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -164,48 +141,49 @@ class faust2chLsh : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec7[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chLsh* clone() { - return new faust2chLsh(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; 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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - 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 fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow5 = ((fSlow1 + -1.0) * fSlow3); + double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1))))); + double fSlow7 = (fSlow5 + fSlow6); + double fSlow8 = ((fSlow1 + fSlow7) + 1.0); double fSlow9 = (1.0 - fSlow0); double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9); - double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9); - double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9); - double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9); + double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9); + double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9); + double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9); double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); @@ -243,8 +221,27 @@ class faust2chLsh : public sfzFilterDsp { fRec8[1] = fRec8[0]; fRec7[1] = fRec7[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider1; } + void setResonance(FAUSTFLOAT value) { fVslider1 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chPeq.hxx b/src/sfizz/gen/filters/sfz2chPeq.hxx index 482b2933..c23009d1 100644 --- a/src/sfizz/gen/filters/sfz2chPeq.hxx +++ b/src/sfizz/gen/filters/sfz2chPeq.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chPeq_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faust2chPeq : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -52,72 +60,41 @@ class faust2chPeq : public sfzFilterDsp { double fVec5[2]; double fRec7[2]; double fRec6[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); - fPkShGain = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -160,44 +137,45 @@ class faust2chPeq : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec6[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chPeq* clone() { - return new faust2chPeq(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); - double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); + double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1))); double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4))); double fSlow6 = (fSlow5 + 1.0); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7); - double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3)); + double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3)); double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7); double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7); double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7); @@ -235,8 +213,27 @@ class faust2chPeq : public sfzFilterDsp { fRec7[1] = fRec7[0]; fRec6[1] = fRec6[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider1; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfz2chPink.hxx b/src/sfizz/gen/filters/sfz2chPink.hxx index c04cbcec..f1aca819 100644 --- a/src/sfizz/gen/filters/sfz2chPink.hxx +++ b/src/sfizz/gen/filters/sfz2chPink.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faust2chPink_H__ @@ -11,120 +15,94 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faust2chPink #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faust2chPink : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + double fRec0[4]; double fRec1[4]; int fSampleRate; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 2; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 2; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - case 1: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin: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; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faust2chPink* clone() { - return new faust2chPink(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { 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]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; + FAUSTFLOAT const* input1 = inputs[1]; FAUSTFLOAT* output0 = outputs[0]; FAUSTFLOAT* output1 = outputs[1]; for (int i = 0; (i < count); i = (i + 1)) { @@ -141,8 +119,18 @@ class faust2chPink : public sfzFilterDsp { fRec1[j1] = fRec1[(j1 - 1)]; } } + //[End:compute] } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzApf1p.hxx b/src/sfizz/gen/filters/sfzApf1p.hxx index 950129a6..2e674295 100644 --- a/src/sfizz/gen/filters/sfzApf1p.hxx +++ b/src/sfizz/gen/filters/sfzApf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustApf1p_H__ @@ -11,133 +15,128 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustApf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin: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; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustApf1p* clone() { - return new faustApf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0]))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBpf1p.hxx b/src/sfizz/gen/filters/sfzBpf1p.hxx index 0273c976..e714e436 100644 --- a/src/sfizz/gen/filters/sfzBpf1p.hxx +++ b/src/sfizz/gen/filters/sfzBpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf1p_H__ @@ -11,90 +15,71 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec2[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -104,37 +89,38 @@ class faustBpf1p : public sfzFilterDsp { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBpf1p* clone() { - return new faustBpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1); 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); @@ -143,8 +129,21 @@ class faustBpf1p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBpf2p.hxx b/src/sfizz/gen/filters/sfzBpf2p.hxx index 5068871c..fea43873 100644 --- a/src/sfizz/gen/filters/sfzBpf2p.hxx +++ b/src/sfizz/gen/filters/sfzBpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf2p_H__ @@ -11,34 +15,38 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fRec2[2]; double fVec0[2]; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec3[2]; double fRec4[2]; double fVec1[2]; @@ -47,63 +55,40 @@ class faustBpf2p : public sfzFilterDsp { double fRec6[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -134,36 +119,37 @@ class faustBpf2p : public sfzFilterDsp { for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { fRec0[l9] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBpf2p* clone() { - return new faustBpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -196,8 +182,24 @@ class faustBpf2p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBpf2pSv.hxx b/src/sfizz/gen/filters/sfzBpf2pSv.hxx index 8a81bb74..19389f89 100644 --- a/src/sfizz/gen/filters/sfzBpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfzBpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf2pSv_H__ @@ -11,94 +15,75 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec3[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; } @@ -114,36 +99,37 @@ class faustBpf2pSv : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBpf2pSv* clone() { - return new faustBpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); @@ -164,8 +150,24 @@ class faustBpf2pSv : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBpf4p.hxx b/src/sfizz/gen/filters/sfzBpf4p.hxx index 33af5534..1342d920 100644 --- a/src/sfizz/gen/filters/sfzBpf4p.hxx +++ b/src/sfizz/gen/filters/sfzBpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf4p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fRec5[2]; double fVec0[2]; @@ -52,63 +60,40 @@ class faustBpf4p : public sfzFilterDsp { double fVec5[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -154,36 +139,37 @@ class faustBpf4p : public sfzFilterDsp { for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) { fRec0[l14] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBpf4p* clone() { - return new faustBpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -226,8 +212,24 @@ class faustBpf4p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBpf6p.hxx b/src/sfizz/gen/filters/sfzBpf6p.hxx index 0888d48b..f595a458 100644 --- a/src/sfizz/gen/filters/sfzBpf6p.hxx +++ b/src/sfizz/gen/filters/sfzBpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBpf6p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fRec7[2]; double fVec0[2]; @@ -57,63 +65,40 @@ class faustBpf6p : public sfzFilterDsp { double fVec8[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -174,36 +159,37 @@ class faustBpf6p : public sfzFilterDsp { for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) { fRec0[l19] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBpf6p* clone() { - return new faustBpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); double fSlow4 = (0.5 * (fSlow2 / fSlow3)); double fSlow5 = (fSlow4 + 1.0); double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5))); @@ -256,8 +242,24 @@ class faustBpf6p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBrf1p.hxx b/src/sfizz/gen/filters/sfzBrf1p.hxx index 88eaa643..4630be05 100644 --- a/src/sfizz/gen/filters/sfzBrf1p.hxx +++ b/src/sfizz/gen/filters/sfzBrf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf1p_H__ @@ -11,90 +15,71 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBrf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec2[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -104,37 +89,38 @@ class faustBrf1p : public sfzFilterDsp { for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) { fRec0[l2] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBrf1p* clone() { - return new faustBrf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1])); + fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1); fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1])); fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1]))); output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0])))); @@ -142,8 +128,21 @@ class faustBrf1p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBrf2p.hxx b/src/sfizz/gen/filters/sfzBrf2p.hxx index 70838f48..8e0635d1 100644 --- a/src/sfizz/gen/filters/sfzBrf2p.hxx +++ b/src/sfizz/gen/filters/sfzBrf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf2p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBrf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -45,63 +53,40 @@ class faustBrf2p : public sfzFilterDsp { double fVec2[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -126,35 +111,36 @@ class faustBrf2p : public sfzFilterDsp { for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) { fRec0[l7] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBrf2p* clone() { - return new faustBrf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); + double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = (1.0 - fSlow0); double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4); @@ -181,8 +167,24 @@ class faustBrf2p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzBrf2pSv.hxx b/src/sfizz/gen/filters/sfzBrf2pSv.hxx index dc10acf0..70ccbdc6 100644 --- a/src/sfizz/gen/filters/sfzBrf2pSv.hxx +++ b/src/sfizz/gen/filters/sfzBrf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustBrf2pSv_H__ @@ -11,94 +15,75 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustBrf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec5[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec6[2]; double fRec2[2]; double fRec3[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec5[l0] = 0.0; } @@ -114,36 +99,37 @@ class faustBrf2pSv : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec3[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustBrf2pSv* clone() { - return new faustBrf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2); @@ -165,8 +151,24 @@ class faustBrf2pSv : public sfzFilterDsp { fRec2[1] = fRec2[0]; fRec3[1] = fRec3[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzEqHshelf.hxx b/src/sfizz/gen/filters/sfzEqHshelf.hxx index 43d9ac0a..e09cd941 100644 --- a/src/sfizz/gen/filters/sfzEqHshelf.hxx +++ b/src/sfizz/gen/filters/sfzEqHshelf.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustEqHshelf_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include @@ -21,26 +25,30 @@ static double faustEqHshelf_faustpower2_f(double value) { return (value * value); } -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustEqHshelf #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustEqHshelf : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fBandwidth; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -51,64 +59,41 @@ class faustEqHshelf : public sfzFilterDsp { double fRec6[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -139,42 +124,43 @@ class faustEqHshelf : public sfzFilterDsp { for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { fRec0[l9] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustEqHshelf* clone() { - return new faustEqHshelf(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow4 = ((fSlow1 + 1.0) * fSlow3); double fSlow5 = (faustEqHshelf_faustpower2_f(fSlow1) + 1.0); double fSlow6 = (fSlow1 + -1.0); double fSlow7 = faustEqHshelf_faustpower2_f(fSlow6); - double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow5 / fSlow7) + -0.01), std::max(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0))))); - double fSlow9 = (fSlow3 * fSlow6); + double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow5 / fSlow7) + -0.01), std::max(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0))))); + double fSlow9 = (fSlow6 * fSlow3); double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9)); double fSlow11 = (1.0 - fSlow0); double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11); @@ -207,8 +193,27 @@ class faustEqHshelf : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzEqLshelf.hxx b/src/sfizz/gen/filters/sfzEqLshelf.hxx index 89b93bb9..ac938e6b 100644 --- a/src/sfizz/gen/filters/sfzEqLshelf.hxx +++ b/src/sfizz/gen/filters/sfzEqLshelf.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustEqLshelf_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include @@ -21,26 +25,30 @@ static double faustEqLshelf_faustpower2_f(double value) { return (value * value); } -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustEqLshelf #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustEqLshelf : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fBandwidth; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -51,64 +59,41 @@ class faustEqLshelf : public sfzFilterDsp { double fRec6[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -139,42 +124,43 @@ class faustEqLshelf : public sfzFilterDsp { for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { fRec0[l9] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustEqLshelf* clone() { - return new faustEqLshelf(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - double fSlow4 = (fSlow3 * (fSlow1 + 1.0)); + double fSlow4 = ((fSlow1 + 1.0) * fSlow3); double fSlow5 = (fSlow1 + -1.0); - double fSlow6 = (fSlow3 * fSlow5); + double fSlow6 = (fSlow5 * fSlow3); double fSlow7 = (faustEqLshelf_faustpower2_f(fSlow1) + 1.0); double fSlow8 = faustEqLshelf_faustpower2_f(fSlow5); - double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow7 / fSlow8) + -0.01), std::max(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0))))); + double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min(((fSlow7 / fSlow8) + -0.01), std::max(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0))))); double fSlow10 = (fSlow6 + fSlow9); double fSlow11 = ((fSlow1 + fSlow10) + 1.0); double fSlow12 = (1.0 - fSlow0); @@ -207,8 +193,27 @@ class faustEqLshelf : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzEqPeak.hxx b/src/sfizz/gen/filters/sfzEqPeak.hxx index fb16a2d4..2d6f26e5 100644 --- a/src/sfizz/gen/filters/sfzEqPeak.hxx +++ b/src/sfizz/gen/filters/sfzEqPeak.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustEqPeak_H__ @@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif /* link with : "" */ #include @@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustEqPeak #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustEqPeak : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst3; - FAUSTFLOAT fBandwidth; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -49,65 +57,42 @@ class faustEqPeak : public sfzFilterDsp { double fVec2[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); fConst3 = (2.1775860903036022 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fBandwidth = FAUSTFLOAT(1.0); - fPkShGain = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + fVslider1 = FAUSTFLOAT(1.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -135,43 +120,44 @@ class faustEqPeak : public sfzFilterDsp { for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { fRec0[l8] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustEqPeak* clone() { - return new faustEqPeak(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = std::max(0.0, double(fCutoff)); + double fSlow1 = std::max(0.0, double(fHslider0)); double fSlow2 = (fConst2 * fSlow1); double fSlow3 = std::sin(fSlow2); - double fSlow4 = std::max(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3))))))); - double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); + double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow5 = std::max(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3))))))); double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5))); double fSlow7 = (fSlow6 + 1.0); double fSlow8 = (1.0 - fSlow0); double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8); - double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4)); + double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5)); double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8); double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8); double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8); @@ -197,8 +183,27 @@ class faustEqPeak : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getBandwidth() const { return fVslider1; } + void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHpf1p.hxx b/src/sfizz/gen/filters/sfzHpf1p.hxx index 4e0cf748..dce88d8d 100644 --- a/src/sfizz/gen/filters/sfzHpf1p.hxx +++ b/src/sfizz/gen/filters/sfzHpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf1p_H__ @@ -11,134 +15,129 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin: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; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHpf1p* clone() { - return new faustHpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); 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]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHpf2p.hxx b/src/sfizz/gen/filters/sfzHpf2p.hxx index bfca60e8..3b065b2e 100644 --- a/src/sfizz/gen/filters/sfzHpf2p.hxx +++ b/src/sfizz/gen/filters/sfzHpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf2p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -46,63 +54,40 @@ class faustHpf2p : public sfzFilterDsp { double fRec5[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -130,36 +115,37 @@ class faustHpf2p : public sfzFilterDsp { for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { fRec0[l8] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHpf2p* clone() { - return new faustHpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -189,8 +175,24 @@ class faustHpf2p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHpf2pSv.hxx b/src/sfizz/gen/filters/sfzHpf2pSv.hxx index 12fa8259..65e1008f 100644 --- a/src/sfizz/gen/filters/sfzHpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfzHpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf2pSv_H__ @@ -11,94 +15,75 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec4[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec3[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec4[l0] = 0.0; } @@ -114,36 +99,37 @@ class faustHpf2pSv : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHpf2pSv* clone() { - return new faustHpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2); @@ -164,8 +150,24 @@ class faustHpf2pSv : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHpf4p.hxx b/src/sfizz/gen/filters/sfzHpf4p.hxx index 6ae2cf55..0a4e8660 100644 --- a/src/sfizz/gen/filters/sfzHpf4p.hxx +++ b/src/sfizz/gen/filters/sfzHpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf4p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec5[2]; @@ -51,63 +59,40 @@ class faustHpf4p : public sfzFilterDsp { double fVec5[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -150,36 +135,37 @@ class faustHpf4p : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec0[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHpf4p* clone() { - return new faustHpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -220,8 +206,24 @@ class faustHpf4p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHpf6p.hxx b/src/sfizz/gen/filters/sfzHpf6p.hxx index 32a72cd6..8c66173e 100644 --- a/src/sfizz/gen/filters/sfzHpf6p.hxx +++ b/src/sfizz/gen/filters/sfzHpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHpf6p_H__ @@ -11,32 +15,36 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fRec2[2]; double fVec0[2]; double fRec7[2]; @@ -56,63 +64,40 @@ class faustHpf6p : public sfzFilterDsp { double fVec8[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -170,36 +155,37 @@ class faustHpf6p : public sfzFilterDsp { for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) { fRec0[l18] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHpf6p* clone() { - return new faustHpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::cos(fSlow1); - double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow4 = (fSlow3 + 1.0); double fSlow5 = (1.0 - fSlow0); double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5); @@ -251,8 +237,24 @@ class faustHpf6p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzHsh.hxx b/src/sfizz/gen/filters/sfzHsh.hxx index 6934d8f5..5570875b 100644 --- a/src/sfizz/gen/filters/sfzHsh.hxx +++ b/src/sfizz/gen/filters/sfzHsh.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustHsh_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustHsh : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -48,64 +56,41 @@ class faustHsh : public sfzFilterDsp { double fRec6[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -136,46 +121,47 @@ class faustHsh : public sfzFilterDsp { for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { fRec0[l9] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustHsh* clone() { - return new faustHsh(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - 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 fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1))))); + double fSlow6 = ((fSlow1 + -1.0) * fSlow3); double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6)); double fSlow8 = (1.0 - fSlow0); double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8); - double fSlow10 = (fSlow1 + fSlow6); - double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8); - double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8); - double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8); + double fSlow10 = (fSlow6 + fSlow5); + double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8); + double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8); + double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8); double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); @@ -201,8 +187,27 @@ class faustHsh : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider1; } + void setResonance(FAUSTFLOAT value) { fVslider1 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLpf1p.hxx b/src/sfizz/gen/filters/sfzLpf1p.hxx index fb9093cc..bbec0a8a 100644 --- a/src/sfizz/gen/filters/sfzLpf1p.hxx +++ b/src/sfizz/gen/filters/sfzLpf1p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf1p_H__ @@ -11,133 +15,128 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLpf1p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; double fConst2; + FAUSTFLOAT fHslider0; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] 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))); + fConst0 = double(fSampleRate); + fConst1 = std::exp((0.0 - (1000.0 / fConst0))); + fConst2 = (1.0 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin: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; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLpf1p* clone() { - return new faustLpf1p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fSmoothEnable ? fConst2 : 0.0); - double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0)); + double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); + double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0)); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); - fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1])); + fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1); fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1])); output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0]))); fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLpf2p.hxx b/src/sfizz/gen/filters/sfzLpf2p.hxx index 7f2044a2..105fd66f 100644 --- a/src/sfizz/gen/filters/sfzLpf2p.hxx +++ b/src/sfizz/gen/filters/sfzLpf2p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf2p_H__ @@ -11,31 +15,35 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLpf2p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; double fVec0[2]; @@ -46,63 +54,40 @@ class faustLpf2p : public sfzFilterDsp { double fRec5[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -130,35 +115,36 @@ class faustLpf2p : public sfzFilterDsp { for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { fRec0[l8] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLpf2p* clone() { - return new faustLpf2p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -190,8 +176,24 @@ class faustLpf2p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLpf2pSv.hxx b/src/sfizz/gen/filters/sfzLpf2pSv.hxx index d70bcafc..a1af4a96 100644 --- a/src/sfizz/gen/filters/sfzLpf2pSv.hxx +++ b/src/sfizz/gen/filters/sfzLpf2pSv.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf2pSv_H__ @@ -11,94 +15,75 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLpf2pSv : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; + FAUSTFLOAT fHslider0; double fRec3[2]; - FAUSTFLOAT fQ; + FAUSTFLOAT fVslider0; double fRec4[2]; double fRec5[2]; double fRec1[2]; double fRec2[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (3.1415926535897931 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec3[l0] = 0.0; } @@ -114,36 +99,37 @@ class faustLpf2pSv : public sfzFilterDsp { for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) { fRec2[l4] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLpf2pSv* clone() { - return new faustLpf2pSv(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1); + double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2); @@ -164,8 +150,24 @@ class faustLpf2pSv : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec2[1] = fRec2[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLpf4p.hxx b/src/sfizz/gen/filters/sfzLpf4p.hxx index 087bac79..f7fe60f9 100644 --- a/src/sfizz/gen/filters/sfzLpf4p.hxx +++ b/src/sfizz/gen/filters/sfzLpf4p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf4p_H__ @@ -11,31 +15,35 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLpf4p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; double fVec0[2]; @@ -51,63 +59,40 @@ class faustLpf4p : public sfzFilterDsp { double fVec5[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -150,35 +135,36 @@ class faustLpf4p : public sfzFilterDsp { for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) { fRec0[l13] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLpf4p* clone() { - return new faustLpf4p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -221,8 +207,24 @@ class faustLpf4p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLpf6p.hxx b/src/sfizz/gen/filters/sfzLpf6p.hxx index a0c1dd24..263f1683 100644 --- a/src/sfizz/gen/filters/sfzLpf6p.hxx +++ b/src/sfizz/gen/filters/sfzLpf6p.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLpf6p_H__ @@ -11,31 +15,35 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLpf6p : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; double fConst2; double fRec2[2]; double fVec0[2]; @@ -56,63 +64,40 @@ class faustLpf6p : public sfzFilterDsp { double fVec8[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = (6.2831853071795862 / fConst0); fConst2 = std::exp((0.0 - (1000.0 / fConst0))); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -170,35 +155,36 @@ class faustLpf6p : public sfzFilterDsp { for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) { fRec0[l18] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLpf6p* clone() { - return new faustLpf6p(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; - double fSlow0 = (fConst1 * std::max(0.0, double(fCutoff))); + double fSlow0 = (fConst1 * std::max(0.0, double(fHslider0))); double fSlow1 = std::cos(fSlow0); - double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))))); + double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))))); double fSlow3 = (fSlow2 + 1.0); double fSlow4 = ((1.0 - fSlow1) / fSlow3); double fSlow5 = (fSmoothEnable ? fConst2 : 0.0); @@ -252,8 +238,24 @@ class faustLpf6p : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzLsh.hxx b/src/sfizz/gen/filters/sfzLsh.hxx index 8ff05ae5..55d27bbc 100644 --- a/src/sfizz/gen/filters/sfzLsh.hxx +++ b/src/sfizz/gen/filters/sfzLsh.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustLsh_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustLsh : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fVslider0; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -48,64 +56,41 @@ class faustLsh : public sfzFilterDsp { double fRec6[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fPkShGain = FAUSTFLOAT(0.0); - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fVslider0 = FAUSTFLOAT(0.0); + fHslider0 = FAUSTFLOAT(440.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -136,46 +121,47 @@ class faustLsh : public sfzFilterDsp { for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) { fRec0[l9] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustLsh* clone() { - return new faustLsh(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[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 fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0))); + double fSlow2 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow3 = std::cos(fSlow2); - 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 fSlow4 = ((fSlow1 + 1.0) * fSlow3); + double fSlow5 = ((fSlow1 + -1.0) * fSlow3); + double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1))))); + double fSlow7 = (fSlow5 + fSlow6); + double fSlow8 = ((fSlow1 + fSlow7) + 1.0); double fSlow9 = (1.0 - fSlow0); double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9); - double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9); - double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9); - double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9); + double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9); + double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9); + double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9); double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9); for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); @@ -201,8 +187,27 @@ class faustLsh : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider1; } + void setResonance(FAUSTFLOAT value) { fVslider1 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider0; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzPeq.hxx b/src/sfizz/gen/filters/sfzPeq.hxx index 0603c45f..a0e6eee5 100644 --- a/src/sfizz/gen/filters/sfzPeq.hxx +++ b/src/sfizz/gen/filters/sfzPeq.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustPeq_H__ @@ -11,33 +15,37 @@ Compilation options: -lang cpp -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 + +//[Before:class] class faustPeq : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + int fSampleRate; double fConst0; double fConst1; double fConst2; - FAUSTFLOAT fCutoff; - FAUSTFLOAT fQ; - FAUSTFLOAT fPkShGain; + FAUSTFLOAT fHslider0; + FAUSTFLOAT fVslider0; + FAUSTFLOAT fVslider1; double fRec2[2]; double fVec0[2]; double fRec3[2]; @@ -47,64 +55,41 @@ class faustPeq : public sfzFilterDsp { double fVec2[2]; double fRec1[2]; double fRec0[2]; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; - fConst0 = std::min(192000.0, std::max(1.0, double(fSampleRate))); + fConst0 = double(fSampleRate); fConst1 = std::exp((0.0 - (1000.0 / fConst0))); fConst2 = (6.2831853071795862 / fConst0); + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { - fCutoff = FAUSTFLOAT(440.0); - fQ = FAUSTFLOAT(0.0); - fPkShGain = FAUSTFLOAT(0.0); + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + fHslider0 = FAUSTFLOAT(440.0); + fVslider0 = FAUSTFLOAT(0.0); + fVslider1 = FAUSTFLOAT(0.0); + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) { fRec2[l0] = 0.0; } @@ -132,42 +117,43 @@ class faustPeq : public sfzFilterDsp { for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) { fRec0[l8] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustPeq* clone() { - return new faustPeq(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; double fSlow0 = (fSmoothEnable ? fConst1 : 0.0); - double fSlow1 = (fConst2 * std::max(0.0, double(fCutoff))); + double fSlow1 = (fConst2 * std::max(0.0, double(fHslider0))); double fSlow2 = std::sin(fSlow1); - double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))); - double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain))); + double fSlow3 = std::max(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0)))); + double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1))); double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4))); double fSlow6 = (fSlow5 + 1.0); double fSlow7 = (1.0 - fSlow0); double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7); - double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3)); + double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3)); double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7); double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7); double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7); @@ -193,8 +179,27 @@ class faustPeq : public sfzFilterDsp { fRec1[1] = fRec1[0]; fRec0[1] = fRec0[0]; } + //[End:compute] } + + FAUSTFLOAT getCutoff() const { return fHslider0; } + void setCutoff(FAUSTFLOAT value) { fHslider0 = value; } + + FAUSTFLOAT getResonance() const { return fVslider0; } + void setResonance(FAUSTFLOAT value) { fVslider0 = value; } + + FAUSTFLOAT getPeakShelfGain() const { return fVslider1; } + void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS diff --git a/src/sfizz/gen/filters/sfzPink.hxx b/src/sfizz/gen/filters/sfzPink.hxx index 31b1f1c5..58205df2 100644 --- a/src/sfizz/gen/filters/sfzPink.hxx +++ b/src/sfizz/gen/filters/sfzPink.hxx @@ -1,9 +1,13 @@ +#if defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif /* ------------------------------------------------------------ author: "Jean Pierre Cimalando" license: "BSD-2-Clause" name: "sfz_filters" -Code generated with Faust 2.20.2 (https://faust.grame.fr) -Compilation options: -lang cpp -inpl -double -ftz 0 +Code generated with Faust 2.30.5 (https://faust.grame.fr) +Compilation options: -lang cpp -inpl -es 1 -double -ftz 0 ------------------------------------------------------------ */ #ifndef __faustPink_H__ @@ -11,107 +15,89 @@ Compilation options: -lang cpp -inpl -double -ftz 0 #ifndef FAUSTFLOAT #define FAUSTFLOAT float -#endif +#endif #include #include -#ifndef FAUSTCLASS +#ifndef FAUSTCLASS #define FAUSTCLASS faustPink #endif -#ifdef __APPLE__ +#ifdef __APPLE__ #define exp10f __exp10f #define exp10 __exp10 #endif + +//[Before:class] class faustPink : public sfzFilterDsp { + //[Begin:class] - public: - + + private: + double fRec0[4]; int fSampleRate; - + public: + - void metadata(Meta* m) { - } - - virtual int getNumInputs() { + static constexpr int getNumInputs() { return 1; } - virtual int getNumOutputs() { + static constexpr int getNumOutputs() { return 1; } - virtual int getInputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - virtual int getOutputRate(int channel) { - int rate; - switch ((channel)) { - case 0: { - rate = 1; - break; - } - default: { - rate = -1; - break; - } - } - return rate; - } - + static void classInit(int sample_rate) { + //[Begin:classInit] + //[End:classInit] } - - virtual void instanceConstants(int sample_rate) { + + void instanceConstants(int sample_rate) { + //[Begin:instanceConstants] fSampleRate = sample_rate; + //[End:instanceConstants] } - - virtual void instanceResetUserInterface() { + + void instanceResetUserInterface() { + //[Begin:instanceResetUserInterface] + //[End:instanceResetUserInterface] } - - virtual void instanceClear() { + + void instanceClear() { + //[Begin:instanceClear] for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) { fRec0[l0] = 0.0; } + //[End:instanceClear] } - - virtual void init(int sample_rate) { + + void init(int sample_rate) { + //[Begin:init] classInit(sample_rate); instanceInit(sample_rate); + //[End:init] } - virtual void instanceInit(int sample_rate) { + void instanceInit(int sample_rate) { + //[Begin:instanceInit] instanceConstants(sample_rate); instanceResetUserInterface(); instanceClear(); + //[End:instanceInit] } - - virtual faustPink* clone() { - return new faustPink(); - } - - virtual int getSampleRate() { + + + int getSampleRate() { return fSampleRate; } - - virtual void buildUserInterface(UI* ui_interface) { - } - - virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) { - FAUSTFLOAT* input0 = inputs[0]; + + + void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) { + //[Begin:compute] + FAUSTFLOAT const* input0 = inputs[0]; FAUSTFLOAT* output0 = outputs[0]; for (int i = 0; (i < count); i = (i + 1)) { double fTemp0 = double(input0[i]); @@ -121,8 +107,18 @@ class faustPink : public sfzFilterDsp { fRec0[j0] = fRec0[(j0 - 1)]; } } + //[End:compute] } + + //[End:class] }; +//[After:class] + #endif +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif +#undef FAUSTFLOAT +#undef FAUSTCLASS