Apply a shorter smoothing on filters

This commit is contained in:
Paul Ferrand 2020-02-16 18:22:11 +01:00
parent e6850a3be9
commit 3073a5db98
50 changed files with 2428 additions and 1153 deletions

View file

@ -66,7 +66,8 @@ ap1Smooth(s,f) = fi.iir((a,1.),(a)) with {
//------------------------------------------------------------------------------
// Example
//------------------------------------------------------------------------------
// process = rbjLpfSmooth(si.smoo, cutoff, 0.0, resonance : ba.db2linear) with {
// cutoff = hslider("[1] Cutoff [unit:Hz] [scale:log]", 440.0, 50.0, 10000.0, 1.0);
// resonance = hslider("[2] Resonance [unit:dB]", 0.0, 0.0, 40.0, 0.1);
// };
process = rbjPeakingEqSmooth(si.smooth(ba.tau2pole(0.001)), cutoff, gain, resonance) with {
cutoff = hslider("[1] Cutoff [unit:Hz] [scale:log]", 50.0, 50.0, 10000.0, 1.0);
resonance = hslider("[2] Resonance [unit:dB]", 1.0, 0.0, 40.0, 0.1);
gain = hslider("[2] gain [unit:dB]", 1.0, -80.0, 80.0, 0.1);
};

View file

@ -133,4 +133,14 @@ pkShGain = vslider("[03] Peak/shelf gain [unit:dB]", 0.0, 0.0, 40.0, 0.1);
bandwidth = vslider("[04] Bandwidth [unit:octave]", 1.0, 0.1, 10.0, 0.01);
// smoothing function to prevent fast changes of filter coefficients
smoothCoefs = si.smoo; // TODO check if this is appropriate otherwise replace
// The basic si.smoo is a bit longish and creates strange modulation sounds
// The smoothing coefficients seem to start at 0, and thus there's a small
// time where the coefficients go e.g. from 0 to cutoff.
// smoothCoefs = si.smoo;
// The below line uses no smoothing at all. This could require smoothing in code
// done on the filter parameters rather than directly on the biquad's coefficients.
// smoothCoefs = _ ; // No smoothing applied at all
// This applies a quicker smoothing but which may render the filter unstable
smoothCoefs = si.smooth(ba.tau2pole(0.001)) ; // time constant = 1ms

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chApf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chApf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chApf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -45,13 +47,15 @@ class faust2chApf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +68,14 @@ class faust2chApf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -82,40 +88,53 @@ class faust2chApf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec2[l2] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -125,10 +144,12 @@ class faust2chApf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -136,11 +157,11 @@ class faust2chApf1p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
double fSlow0 = (fConst2 * ((fConst3 * double(fCutoff)) + -1.0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
@ -148,7 +169,9 @@ class faust2chApf1p : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chBpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec2[2];
double fRec1[2];
@ -47,13 +49,15 @@ class faust2chBpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -66,12 +70,14 @@ class faust2chBpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -84,46 +90,61 @@ class faust2chBpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec4[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -133,10 +154,12 @@ class faust2chBpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -144,18 +167,18 @@ class faust2chBpf1p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
fRec2[0] = (fSlow0 + (fConst1 * fRec2[1]));
fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0);
double fTemp2 = (1.0 - fRec2[0]);
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
double fTemp3 = (fRec2[0] + 1.0);
double fTemp4 = (0.0 - (0.5 * fTemp3));
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4)));
fRec4[0] = (fTemp1 + (fRec2[0] * fRec4[1]));
fRec4[0] = ((fRec2[0] * fRec4[1]) + fTemp1);
fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1]));
output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1])));
fRec2[1] = fRec2[0];
@ -163,7 +186,9 @@ class faust2chBpf1p : public sfzFilterDsp {
fRec0[1] = fRec0[0];
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,13 +30,17 @@ class faust2chBpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
double fRec2[2];
double fRec0[3];
double fConst4;
double fRec3[2];
double fRec4[2];
double fRec5[2];
@ -50,13 +53,15 @@ class faust2chBpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,12 +74,14 @@ class faust2chBpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -87,53 +94,71 @@ class faust2chBpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec6[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -143,10 +168,12 @@ class faust2chBpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -154,25 +181,25 @@ class faust2chBpf2p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow8 = (0.00050000000000000044 * fSlow7);
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow6 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow7 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow8 = (fConst4 * fSlow7);
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow7)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
fRec1[0] = (fSlow5 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow6 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
fRec4[0] = (0.999 * fRec4[1]);
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
fRec3[0] = (fSlow8 + (fConst1 * fRec3[1]));
fRec4[0] = (fConst1 * fRec4[1]);
fRec5[0] = (fSlow9 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
@ -185,7 +212,9 @@ class faust2chBpf2p : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec6[2] = fRec6[1];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chBpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec3[2];
FAUSTFLOAT fQ;
@ -51,13 +53,15 @@ class faust2chBpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -70,12 +74,14 @@ class faust2chBpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -88,56 +94,74 @@ class faust2chBpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec6[l5] = 0.0;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
fRec9[l7] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -147,10 +171,12 @@ class faust2chBpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -158,18 +184,18 @@ class faust2chBpf2pSv : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
double fSlow2 = (1.0 / fSlow1);
double fSlow3 = (0.0010000000000000009 / fSlow1);
double fSlow3 = (fConst2 / fSlow1);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow0 + (fConst1 * fRec3[1]));
double fTemp2 = (fSlow2 + fRec3[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
fRec4[0] = ((fConst1 * fRec4[1]) + (fConst2 / ((fRec3[0] * fTemp2) + 1.0)));
double fTemp3 = (fRec3[0] * fRec4[0]);
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp2));
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fTemp5 = (fTemp3 * fTemp4);
double fTemp6 = (fRec2[1] + fTemp5);
@ -177,7 +203,7 @@ class faust2chBpf2pSv : public sfzFilterDsp {
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6)));
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
fRec2[0] = fTemp7;
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow3 + (fConst1 * fRec6[1]));
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1])));
double fTemp9 = (fTemp3 * fTemp8);
@ -195,7 +221,9 @@ class faust2chBpf2pSv : public sfzFilterDsp {
fRec6[1] = fRec6[0];
fRec8[1] = fRec8[0];
fRec9[1] = fRec9[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,12 @@ class faust2chBpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
double fConst4;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -52,13 +55,15 @@ class faust2chBpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -71,12 +76,14 @@ class faust2chBpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -89,59 +96,79 @@ class faust2chBpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (0.5 * fConst2);
fConst4 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec6[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec8[l7] = 0.0;
}
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
fRec7[l8] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -151,10 +178,12 @@ class faust2chBpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -162,25 +191,25 @@ class faust2chBpf4p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst4 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow6 = (0.00050000000000000044 * fSlow5);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
double fSlow5 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow6 = (fConst3 * fSlow5);
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow5)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow6 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow7 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow8 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (0.999 * fRec5[1]);
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
fRec5[0] = (fConst1 * fRec5[1]);
fRec6[0] = (fSlow9 + (fConst1 * fRec6[1]));
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
fRec8[0] = (fTemp1 - ((fRec3[0] * fRec8[1]) + (fRec4[0] * fRec8[2])));
@ -199,7 +228,9 @@ class faust2chBpf4p : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[2] = fRec7[1];
fRec7[1] = fRec7[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,12 @@ class faust2chBpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
double fConst4;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -54,13 +57,15 @@ class faust2chBpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -73,12 +78,14 @@ class faust2chBpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -91,65 +98,87 @@ class faust2chBpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (0.5 * fConst2);
fConst4 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec7[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec2[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec1[l7] = 0.0;
}
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
fRec10[l8] = 0.0;
}
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
fRec9[l9] = 0.0;
}
for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) {
fRec8[l10] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -159,10 +188,12 @@ class faust2chBpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -170,25 +201,25 @@ class faust2chBpf6p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst4 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow6 = (0.00050000000000000044 * fSlow5);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
double fSlow5 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow6 = (fConst3 * fSlow5);
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow5)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow6 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow8 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (0.999 * fRec6[1]);
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
fRec6[0] = (fConst1 * fRec6[1]);
fRec7[0] = (fSlow9 + (fConst1 * fRec7[1]));
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
@ -213,7 +244,9 @@ class faust2chBpf6p : public sfzFilterDsp {
fRec9[1] = fRec9[0];
fRec8[2] = fRec8[1];
fRec8[1] = fRec8[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chBrf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec2[2];
double fRec1[2];
@ -47,13 +49,15 @@ class faust2chBrf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -66,12 +70,14 @@ class faust2chBrf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -84,46 +90,61 @@ class faust2chBrf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec4[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -133,10 +154,12 @@ class faust2chBrf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -144,23 +167,25 @@ class faust2chBrf1p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
double fSlow0 = (fConst2 * ((fConst3 * double(fCutoff)) + -1.0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow0 + (fConst1 * fRec2[1]));
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]))));
output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0));
fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1]));
fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1])));
output1[i] = FAUSTFLOAT((fTemp1 + (fRec3[1] + (fRec2[0] * fRec3[0]))));
output1[i] = FAUSTFLOAT(((fRec3[1] + (fRec2[0] * fRec3[0])) + fTemp1));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec4[1] = fRec4[0];
fRec3[1] = fRec3[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chBrf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -48,13 +50,15 @@ class faust2chBrf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -67,12 +71,14 @@ class faust2chBrf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -85,47 +91,62 @@ class faust2chBrf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec1[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -135,10 +156,12 @@ class faust2chBrf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -146,20 +169,20 @@ class faust2chBrf2p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow2 = (fSlow1 + 1.0);
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
double fSlow5 = (0.0010000000000000009 / fSlow2);
double fSlow3 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
double fSlow4 = (fConst2 * ((1.0 - fSlow1) / fSlow2));
double fSlow5 = (fConst2 / fSlow2);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
fRec0[0] = (fSlow3 + (fConst1 * fRec0[1]));
double fTemp2 = (fRec0[0] * fRec1[1]);
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow4 + (fConst1 * fRec2[1]));
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow5 + (fConst1 * fRec3[1]));
output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
double fTemp3 = (fRec0[0] * fRec4[1]);
fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2])));
@ -171,7 +194,9 @@ class faust2chBrf2p : public sfzFilterDsp {
fRec3[1] = fRec3[0];
fRec4[2] = fRec4[1];
fRec4[1] = fRec4[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chBrf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chBrf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chBrf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec5[2];
FAUSTFLOAT fQ;
@ -50,13 +52,15 @@ class faust2chBrf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,12 +73,14 @@ class faust2chBrf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -87,53 +93,70 @@ class faust2chBrf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec5[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec6[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec9[l5] = 0.0;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec10[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -143,10 +166,12 @@ class faust2chBrf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -154,15 +179,15 @@ class faust2chBrf2pSv : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
fRec5[0] = (fSlow0 + (fConst1 * fRec5[1]));
double fTemp2 = (fSlow1 + fRec5[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp2) + 1.0)));
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp2));
fRec4[0] = ((fConst1 * fRec4[1]) + (fConst2 / ((fRec5[0] * fTemp2) + 1.0)));
fRec6[0] = ((fConst1 * fRec6[1]) + (fConst2 * fTemp2));
double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
double fRec0 = (fRec4[0] * fTemp3);
double fTemp4 = (fRec5[0] * fRec4[0]);
@ -189,7 +214,9 @@ class faust2chBrf2pSv : public sfzFilterDsp {
fRec3[1] = fRec3[0];
fRec9[1] = fRec9[0];
fRec10[1] = fRec10[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chEq_H__
@ -22,7 +22,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chEq
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -32,11 +31,13 @@ class faust2chEq : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fConst4;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fPkShGain;
double fRec1[2];
@ -53,13 +54,15 @@ class faust2chEq : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -72,12 +75,14 @@ class faust2chEq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -90,53 +95,68 @@ class faust2chEq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = (2.1775860903036022 / fConst0);
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (2.1775860903036022 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
fPkShGain = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -146,10 +166,12 @@ class faust2chEq : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -158,29 +180,29 @@ class faust2chEq : public sfzFilterDsp {
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = std::max<double>(0.0, double(fCutoff));
double fSlow1 = (fConst1 * fSlow0);
double fSlow1 = (fConst3 * fSlow0);
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst2 * ((fSlow0 * double(fBandwidth)) / fSlow2)))))));
double fSlow3 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst4 * ((fSlow0 * double(fBandwidth)) / fSlow2)))))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
double fSlow6 = (fSlow5 + 1.0);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow5) / fSlow6));
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6));
double fSlow8 = (fConst2 * ((1.0 - fSlow5) / fSlow6));
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
double fSlow10 = (0.0010000000000000009 * ((fSlow9 + 1.0) / fSlow6));
double fSlow11 = (0.0010000000000000009 * ((1.0 - fSlow9) / fSlow6));
double fSlow10 = (fConst2 * ((fSlow9 + 1.0) / fSlow6));
double fSlow11 = (fConst2 * ((1.0 - fSlow9) / fSlow6));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
fRec1[0] = (fSlow7 + (fConst1 * fRec1[1]));
double fTemp2 = (fRec1[0] * fRec0[1]);
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow8 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
double fTemp3 = (fRec1[0] * fRec5[1]);
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[2]) + fTemp3));
output1[i] = FAUSTFLOAT(((fTemp3 + (fRec3[0] * fRec5[0])) + (fRec4[0] * fRec5[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -190,7 +212,9 @@ class faust2chEq : public sfzFilterDsp {
fRec4[1] = fRec4[0];
fRec5[2] = fRec5[1];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chHpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -45,13 +47,15 @@ class faust2chHpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +68,14 @@ class faust2chHpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -82,40 +88,53 @@ class faust2chHpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec2[l2] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -125,10 +144,12 @@ class faust2chHpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -136,21 +157,23 @@ class faust2chHpf1p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
double fTemp2 = (fRec1[0] + 1.0);
double fTemp3 = (0.0 - (0.5 * fTemp2));
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3)));
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1);
output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1])));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chHpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec2[2];
double fRec3[2];
double fRec1[3];
double fConst4;
double fRec4[2];
double fRec5[3];
@ -49,13 +52,15 @@ class faust2chHpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -68,12 +73,14 @@ class faust2chHpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -86,50 +93,67 @@ class faust2chHpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec3[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -139,10 +163,12 @@ class faust2chHpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -150,22 +176,22 @@ class faust2chHpf2p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec2[0] = (fSlow5 + (fConst1 * fRec2[1]));
fRec3[0] = (fSlow6 + (fConst1 * fRec3[1]));
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
@ -177,7 +203,9 @@ class faust2chHpf2p : public sfzFilterDsp {
fRec4[1] = fRec4[0];
fRec5[2] = fRec5[1];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chHpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec4[2];
FAUSTFLOAT fQ;
@ -50,13 +52,15 @@ class faust2chHpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,12 +73,14 @@ class faust2chHpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -87,53 +93,70 @@ class faust2chHpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec4[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec7[l5] = 0.0;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -143,10 +166,12 @@ class faust2chHpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -154,15 +179,15 @@ class faust2chHpf2pSv : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow0 + (fConst1 * fRec4[1]));
double fTemp2 = (fSlow1 + fRec4[0]);
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp2) + 1.0)));
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
fRec3[0] = ((fConst2 / ((fRec4[0] * fTemp2) + 1.0)) + (fConst1 * fRec3[1]));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp2));
double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fRec0 = (fRec3[0] * fTemp3);
double fTemp4 = (fRec4[0] * fRec3[0]);
@ -187,7 +212,9 @@ class faust2chHpf2pSv : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec7[1] = fRec7[0];
fRec8[1] = fRec8[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chHpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec3[2];
double fRec4[2];
double fRec2[3];
double fConst4;
double fRec5[2];
double fRec1[3];
double fRec7[3];
@ -51,13 +54,15 @@ class faust2chHpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -70,12 +75,14 @@ class faust2chHpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -88,56 +95,75 @@ class faust2chHpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec1[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec7[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec6[l7] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -147,10 +173,12 @@ class faust2chHpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -158,22 +186,22 @@ class faust2chHpf4p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow5 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow6 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
fRec5[0] = (fSlow7 + (fConst1 * fRec5[1]));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
@ -191,7 +219,9 @@ class faust2chHpf4p : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[2] = fRec6[1];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chHpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec4[2];
double fRec5[2];
double fRec3[3];
double fConst4;
double fRec6[2];
double fRec2[3];
double fRec1[3];
@ -53,13 +56,15 @@ class faust2chHpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -72,12 +77,14 @@ class faust2chHpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -90,62 +97,83 @@ class faust2chHpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec2[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec9[l7] = 0.0;
}
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
fRec8[l8] = 0.0;
}
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
fRec7[l9] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -155,10 +183,12 @@ class faust2chHpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -166,22 +196,22 @@ class faust2chHpf6p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow5 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow6 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow7 + (fConst1 * fRec6[1]));
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
@ -205,7 +235,9 @@ class faust2chHpf6p : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[2] = fRec7[1];
fRec7[1] = fRec7[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chHsh_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chHsh
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,9 +30,13 @@ class faust2chHsh : public sfzFilterDsp {
public:
FAUSTFLOAT fPkShGain;
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fPkShGain;
double fConst4;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
@ -51,13 +54,15 @@ class faust2chHsh : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -70,12 +75,14 @@ class faust2chHsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -88,54 +95,72 @@ class faust2chHsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (2.0 * fConst2);
fConst4 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec6[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -145,10 +170,12 @@ class faust2chHsh : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -157,27 +184,27 @@ class faust2chHsh : public sfzFilterDsp {
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst4 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
double fSlow3 = ((fSlow0 + 1.0) * fSlow2);
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
double fSlow5 = ((fSlow0 + -1.0) * fSlow2);
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
double fSlow9 = (fSlow0 + fSlow5);
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
double fSlow7 = (fConst3 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
double fSlow8 = (fConst2 * ((fSlow0 + (1.0 - (fSlow5 + fSlow4))) / fSlow6));
double fSlow9 = (fSlow5 + fSlow0);
double fSlow10 = (fConst2 * ((((fSlow9 + fSlow4) + 1.0) * fSlow0) / fSlow6));
double fSlow11 = (fConst2 * (((0.0 - (2.0 * fSlow0)) * ((fSlow3 + fSlow0) + -1.0)) / fSlow6));
double fSlow12 = (fConst2 * (((fSlow9 + (1.0 - fSlow4)) * fSlow0) / fSlow6));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
fRec1[0] = (fSlow7 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow8 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow12 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
@ -190,7 +217,9 @@ class faust2chHsh : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec6[2] = fRec6[1];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chLpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -45,13 +47,15 @@ class faust2chLpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +68,14 @@ class faust2chLpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -82,40 +88,53 @@ class faust2chLpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec2[l2] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -125,10 +144,12 @@ class faust2chLpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -136,20 +157,22 @@ class faust2chLpf1p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
double fTemp2 = (1.0 - fRec1[0]);
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1);
output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chLpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec2[2];
double fRec3[2];
double fRec1[3];
double fConst4;
double fRec4[2];
double fRec5[3];
@ -49,13 +52,15 @@ class faust2chLpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -68,12 +73,14 @@ class faust2chLpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -86,50 +93,67 @@ class faust2chLpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec3[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -139,10 +163,12 @@ class faust2chLpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -150,23 +176,23 @@ class faust2chLpf2p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec2[0] = (fSlow6 + (fConst1 * fRec2[1]));
fRec3[0] = (fSlow7 + (fConst1 * fRec3[1]));
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow8 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
@ -178,7 +204,9 @@ class faust2chLpf2p : public sfzFilterDsp {
fRec4[1] = fRec4[0];
fRec5[2] = fRec5[1];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faust2chLpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec3[2];
FAUSTFLOAT fQ;
@ -50,13 +52,15 @@ class faust2chLpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,12 +73,14 @@ class faust2chLpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -87,53 +93,70 @@ class faust2chLpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec7[l5] = 0.0;
}
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
fRec8[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -143,10 +166,12 @@ class faust2chLpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -154,16 +179,16 @@ class faust2chLpf2pSv : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow0 + (fConst1 * fRec3[1]));
double fTemp2 = (fSlow1 + fRec3[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
fRec4[0] = ((fConst2 / ((fRec3[0] * fTemp2) + 1.0)) + (fConst1 * fRec4[1]));
double fTemp3 = (fRec3[0] * fRec4[0]);
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp2));
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fTemp5 = (fTemp3 * fTemp4);
double fTemp6 = (fRec2[1] + (2.0 * fTemp5));
@ -187,7 +212,9 @@ class faust2chLpf2pSv : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec7[1] = fRec7[0];
fRec8[1] = fRec8[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chLpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec3[2];
double fRec4[2];
double fRec2[3];
double fConst4;
double fRec5[2];
double fRec1[3];
double fRec7[3];
@ -51,13 +54,15 @@ class faust2chLpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -70,12 +75,14 @@ class faust2chLpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -88,56 +95,75 @@ class faust2chLpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec1[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec7[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec6[l7] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -147,10 +173,12 @@ class faust2chLpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -158,23 +186,23 @@ class faust2chLpf4p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow6 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
fRec5[0] = (fSlow8 + (fConst1 * fRec5[1]));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
@ -192,7 +220,9 @@ class faust2chLpf4p : public sfzFilterDsp {
fRec7[1] = fRec7[0];
fRec6[2] = fRec6[1];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faust2chLpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec4[2];
double fRec5[2];
double fRec3[3];
double fConst4;
double fRec6[2];
double fRec2[3];
double fRec1[3];
@ -53,13 +56,15 @@ class faust2chLpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -72,12 +77,14 @@ class faust2chLpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -90,62 +97,83 @@ class faust2chLpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec2[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec9[l7] = 0.0;
}
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
fRec8[l8] = 0.0;
}
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
fRec7[l9] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -155,10 +183,12 @@ class faust2chLpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -166,23 +196,23 @@ class faust2chLpf6p : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow6 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow7 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow8 + (fConst1 * fRec6[1]));
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
@ -206,7 +236,9 @@ class faust2chLpf6p : public sfzFilterDsp {
fRec8[1] = fRec8[0];
fRec7[2] = fRec7[1];
fRec7[1] = fRec7[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chLsh_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chLsh
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,15 +30,19 @@ class faust2chLsh : public sfzFilterDsp {
public:
FAUSTFLOAT fPkShGain;
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fPkShGain;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
double fRec2[2];
double fRec0[3];
double fRec3[2];
double fConst4;
double fRec4[2];
double fRec5[2];
double fRec6[3];
@ -51,13 +54,15 @@ class faust2chLsh : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -70,12 +75,14 @@ class faust2chLsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -88,54 +95,72 @@ class faust2chLsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (2.0 * fConst2);
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec6[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -145,10 +170,12 @@ class faust2chLsh : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -157,27 +184,27 @@ class faust2chLsh : public sfzFilterDsp {
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
double fSlow6 = (fSlow0 + fSlow5);
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
double fSlow3 = ((fSlow0 + 1.0) * fSlow2);
double fSlow4 = ((fSlow0 + -1.0) * fSlow2);
double fSlow5 = (fSlow4 + fSlow0);
double fSlow6 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow7 = ((fSlow5 + fSlow6) + 1.0);
double fSlow8 = (fConst2 * ((0.0 - (2.0 * ((fSlow3 + fSlow0) + -1.0))) / fSlow7));
double fSlow9 = (fConst2 * ((fSlow5 + (1.0 - fSlow6)) / fSlow7));
double fSlow10 = (fConst2 * ((((fSlow0 + fSlow6) + (1.0 - fSlow4)) * fSlow0) / fSlow7));
double fSlow11 = (fConst4 * (((fSlow0 + (-1.0 - fSlow3)) * fSlow0) / fSlow7));
double fSlow12 = (fConst2 * (((fSlow0 + (1.0 - (fSlow4 + fSlow6))) * fSlow0) / fSlow7));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
fRec1[0] = (fSlow8 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow9 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow12 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
@ -190,7 +217,9 @@ class faust2chLsh : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec6[2] = fRec6[1];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chPeq_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chPeq
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,17 @@ class faust2chPeq : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fPkShGain;
double fRec1[2];
double fRec0[2];
double fRec2[2];
double fRec0[3];
double fRec1[3];
double fRec3[2];
double fRec4[2];
double fRec5[3];
@ -50,13 +52,15 @@ class faust2chPeq : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,12 +73,14 @@ class faust2chPeq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -87,51 +93,67 @@ class faust2chPeq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
fPkShGain = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
fRec1[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -141,10 +163,12 @@ class faust2chPeq : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -152,39 +176,41 @@ class faust2chPeq : public sfzFilterDsp {
FAUSTFLOAT* input1 = inputs[1];
FAUSTFLOAT* output0 = outputs[0];
FAUSTFLOAT* output1 = outputs[1];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
double fSlow6 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
double fSlow7 = (fConst2 * ((1.0 - fSlow4) / fSlow5));
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
double fSlow9 = (fConst2 * ((fSlow8 + 1.0) / fSlow5));
double fSlow10 = (fConst2 * ((1.0 - fSlow8) / fSlow5));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
double fTemp2 = (fRec1[0] * fRec0[1]);
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
double fTemp3 = (fRec1[0] * fRec5[1]);
fRec0[0] = (fSlow6 + (fConst1 * fRec0[1]));
double fTemp2 = (fRec0[0] * fRec1[1]);
fRec2[0] = (fSlow7 + (fConst1 * fRec2[1]));
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
fRec3[0] = (fSlow9 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow10 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT((fTemp2 + ((fRec1[0] * fRec3[0]) + (fRec4[0] * fRec1[2]))));
double fTemp3 = (fRec0[0] * fRec5[1]);
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
output1[i] = FAUSTFLOAT(((fTemp3 + (fRec3[0] * fRec5[0])) + (fRec4[0] * fRec5[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
fRec0[2] = fRec0[1];
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
fRec5[2] = fRec5[1];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faust2chPink_H__
@ -20,7 +20,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faust2chPink
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -32,7 +31,7 @@ class faust2chPink : public sfzFilterDsp {
double fRec0[4];
double fRec1[4];
int fSampleRate;
int fSamplingFreq;
public:
@ -41,13 +40,15 @@ class faust2chPink : public sfzFilterDsp {
virtual int getNumInputs() {
return 2;
}
virtual int getNumOutputs() {
return 2;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -60,12 +61,14 @@ class faust2chPink : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,35 +81,44 @@ class faust2chPink : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
}
virtual void instanceResetUserInterface() {
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
fRec1[l1] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -116,10 +128,12 @@ class faust2chPink : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -130,17 +144,21 @@ class faust2chPink : public sfzFilterDsp {
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
double fTemp1 = double(input1[i]);
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2]));
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
fRec1[0] = ((fTemp1 + ((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3]))) - (2.0172658750000001 * fRec1[2]));
fRec1[0] = ((((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3])) + fTemp1) - (2.0172658750000001 * fRec1[2]));
output1[i] = FAUSTFLOAT((((0.049922034999999997 * fRec1[0]) + (0.050612698999999997 * fRec1[2])) - ((0.095993537000000004 * fRec1[1]) + (0.0044087859999999996 * fRec1[3]))));
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
fRec0[j0] = fRec0[(j0 - 1)];
}
for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) {
fRec1[j1] = fRec1[(j1 - 1)];
}
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustApf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustApf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustApf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -44,13 +46,15 @@ class faustApf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -59,12 +63,14 @@ class faustApf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -73,37 +79,49 @@ class faustApf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -113,24 +131,28 @@ class faustApf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
double fSlow0 = (fConst2 * ((fConst3 * double(fCutoff)) + -1.0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustBpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec2[2];
double fRec1[2];
@ -45,13 +47,15 @@ class faustBpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -60,12 +64,14 @@ class faustBpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -74,40 +80,53 @@ class faustBpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -117,27 +136,31 @@ class faustBpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
fRec2[0] = (fSlow0 + (fConst1 * fRec2[1]));
fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0);
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
double fTemp1 = (fRec2[0] + 1.0);
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,13 +30,17 @@ class faustBpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
double fRec2[2];
double fRec0[3];
double fConst4;
double fRec3[2];
double fRec4[2];
double fRec5[2];
@ -49,13 +52,15 @@ class faustBpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +69,14 @@ class faustBpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,50 +85,67 @@ class faustBpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -131,33 +155,35 @@ class faustBpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow8 = (0.00050000000000000044 * fSlow7);
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow6 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow7 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow8 = (fConst4 * fSlow7);
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow7)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
fRec1[0] = (fSlow5 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow6 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
fRec4[0] = (0.999 * fRec4[1]);
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
fRec3[0] = (fSlow8 + (fConst1 * fRec3[1]));
fRec4[0] = (fConst1 * fRec4[1]);
fRec5[0] = (fSlow9 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -166,7 +192,9 @@ class faustBpf2p : public sfzFilterDsp {
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustBpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec3[2];
FAUSTFLOAT fQ;
@ -49,13 +51,15 @@ class faustBpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +68,14 @@ class faustBpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,50 +84,66 @@ class faustBpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec6[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -131,25 +153,27 @@ class faustBpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
double fSlow2 = (1.0 / fSlow1);
double fSlow3 = (0.0010000000000000009 / fSlow1);
double fSlow3 = (fConst2 / fSlow1);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow0 + (fConst1 * fRec3[1]));
double fTemp1 = (fSlow2 + fRec3[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
fRec4[0] = ((fConst1 * fRec4[1]) + (fConst2 / ((fRec3[0] * fTemp1) + 1.0)));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp1));
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
double fTemp4 = (fRec2[1] + fTemp3);
@ -157,7 +181,7 @@ class faustBpf2pSv : public sfzFilterDsp {
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4)));
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
fRec2[0] = fTemp5;
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow3 + (fConst1 * fRec6[1]));
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
@ -165,7 +189,9 @@ class faustBpf2pSv : public sfzFilterDsp {
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
fRec6[1] = fRec6[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,12 @@ class faustBpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
double fConst4;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -50,13 +53,15 @@ class faustBpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -65,12 +70,14 @@ class faustBpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -79,53 +86,71 @@ class faustBpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (0.5 * fConst2);
fConst4 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec6[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -135,33 +160,35 @@ class faustBpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst4 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow6 = (0.00050000000000000044 * fSlow5);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
double fSlow5 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow6 = (fConst3 * fSlow5);
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow5)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow6 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow7 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow8 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (0.999 * fRec5[1]);
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
fRec5[0] = (fConst1 * fRec5[1]);
fRec6[0] = (fSlow9 + (fConst1 * fRec6[1]));
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
fRec0[1] = fRec0[0];
@ -173,7 +200,9 @@ class faustBpf4p : public sfzFilterDsp {
fRec6[1] = fRec6[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,12 @@ class faustBpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
double fConst4;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -51,13 +54,15 @@ class faustBpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -66,12 +71,14 @@ class faustBpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -80,56 +87,75 @@ class faustBpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (0.5 * fConst2);
fConst4 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec7[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec2[l6] = 0.0;
}
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
fRec1[l7] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -139,33 +165,35 @@ class faustBpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst4 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
double fSlow4 = (fSlow3 + 1.0);
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
double fSlow6 = (0.00050000000000000044 * fSlow5);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
double fSlow5 = (fSlow1 / (fSlow4 * fSlow2));
double fSlow6 = (fConst3 * fSlow5);
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
double fSlow8 = (fConst2 * ((1.0 - fSlow3) / fSlow4));
double fSlow9 = (fConst2 * (0.0 - (0.5 * fSlow5)));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow6 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow8 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (0.999 * fRec6[1]);
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
fRec6[0] = (fConst1 * fRec6[1]);
fRec7[0] = (fSlow9 + (fConst1 * fRec7[1]));
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
@ -180,7 +208,9 @@ class faustBpf6p : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBrf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBrf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustBrf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec2[2];
double fRec1[2];
@ -45,13 +47,15 @@ class faustBrf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -60,12 +64,14 @@ class faustBrf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -74,40 +80,53 @@ class faustBrf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec2[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec1[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -117,26 +136,30 @@ class faustBrf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
double fSlow0 = (fConst2 * ((fConst3 * double(fCutoff)) + -1.0));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow0 + (fConst1 * fRec2[1]));
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]))));
output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0));
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBrf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBrf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustBrf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
@ -47,13 +49,15 @@ class faustBrf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -62,12 +66,14 @@ class faustBrf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -76,44 +82,58 @@ class faustBrf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec1[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -123,35 +143,39 @@ class faustBrf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow2 = (fSlow1 + 1.0);
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
double fSlow5 = (0.0010000000000000009 / fSlow2);
double fSlow3 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
double fSlow4 = (fConst2 * ((1.0 - fSlow1) / fSlow2));
double fSlow5 = (fConst2 / fSlow2);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
fRec0[0] = (fSlow3 + (fConst1 * fRec0[1]));
double fTemp1 = (fRec0[0] * fRec1[1]);
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow4 + (fConst1 * fRec2[1]));
fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2])));
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow5 + (fConst1 * fRec3[1]));
output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
fRec3[1] = fRec3[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustBrf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustBrf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustBrf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec5[2];
FAUSTFLOAT fQ;
@ -48,13 +50,15 @@ class faustBrf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -63,12 +67,14 @@ class faustBrf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -77,47 +83,62 @@ class faustBrf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec5[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec6[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec3[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -127,23 +148,25 @@ class faustBrf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
fRec5[0] = (fSlow0 + (fConst1 * fRec5[1]));
double fTemp1 = (fSlow1 + fRec5[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp1) + 1.0)));
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp1));
fRec4[0] = ((fConst1 * fRec4[1]) + (fConst2 / ((fRec5[0] * fTemp1) + 1.0)));
fRec6[0] = ((fConst1 * fRec6[1]) + (fConst2 * fTemp1));
double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
double fRec0 = (fRec4[0] * fTemp2);
double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2);
@ -158,7 +181,9 @@ class faustBrf2pSv : public sfzFilterDsp {
fRec6[1] = fRec6[0];
fRec2[1] = fRec2[0];
fRec3[1] = fRec3[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustEq_H__
@ -22,7 +22,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustEq
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -32,11 +31,13 @@ class faustEq : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
FAUSTFLOAT fCutoff;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fConst4;
FAUSTFLOAT fBandwidth;
FAUSTFLOAT fPkShGain;
double fRec1[2];
@ -52,13 +53,15 @@ class faustEq : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -67,12 +70,14 @@ class faustEq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -81,50 +86,64 @@ class faustEq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
fConst1 = (6.2831853071795862 / fConst0);
fConst2 = (2.1775860903036022 / fConst0);
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (2.1775860903036022 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fBandwidth = FAUSTFLOAT(1.0);
fPkShGain = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -134,35 +153,37 @@ class faustEq : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = std::max<double>(0.0, double(fCutoff));
double fSlow1 = (fConst1 * fSlow0);
double fSlow1 = (fConst3 * fSlow0);
double fSlow2 = std::sin(fSlow1);
double fSlow3 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst2 * ((fSlow0 * double(fBandwidth)) / fSlow2)))))));
double fSlow3 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst4 * ((fSlow0 * double(fBandwidth)) / fSlow2)))))));
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
double fSlow6 = (fSlow5 + 1.0);
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6));
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow5) / fSlow6));
double fSlow7 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6));
double fSlow8 = (fConst2 * ((1.0 - fSlow5) / fSlow6));
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
double fSlow10 = (0.0010000000000000009 * ((fSlow9 + 1.0) / fSlow6));
double fSlow11 = (0.0010000000000000009 * ((1.0 - fSlow9) / fSlow6));
double fSlow10 = (fConst2 * ((fSlow9 + 1.0) / fSlow6));
double fSlow11 = (fConst2 * ((1.0 - fSlow9) / fSlow6));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
fRec1[0] = (fSlow7 + (fConst1 * fRec1[1]));
double fTemp1 = (fRec1[0] * fRec0[1]);
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow8 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -170,7 +191,9 @@ class faustEq : public sfzFilterDsp {
fRec0[1] = fRec0[0];
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustHpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -44,13 +46,15 @@ class faustHpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -59,12 +63,14 @@ class faustHpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -73,37 +79,49 @@ class faustHpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -113,25 +131,29 @@ class faustHpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
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];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustHpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec2[2];
double fRec3[2];
double fRec1[3];
double fConst4;
double fRec4[2];
public:
@ -48,13 +51,15 @@ class faustHpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -63,12 +68,14 @@ class faustHpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -77,47 +84,63 @@ class faustHpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec3[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -127,30 +150,32 @@ class faustHpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec2[0] = (fSlow5 + (fConst1 * fRec2[1]));
fRec3[0] = (fSlow6 + (fConst1 * fRec3[1]));
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
@ -158,7 +183,9 @@ class faustHpf2p : public sfzFilterDsp {
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
fRec4[1] = fRec4[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustHpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec4[2];
FAUSTFLOAT fQ;
@ -48,13 +50,15 @@ class faustHpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -63,12 +67,14 @@ class faustHpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -77,47 +83,62 @@ class faustHpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec4[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -127,23 +148,25 @@ class faustHpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow0 + (fConst1 * fRec4[1]));
double fTemp1 = (fSlow1 + fRec4[0]);
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp1) + 1.0)));
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 / ((fRec4[0] * fTemp1) + 1.0)));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp1));
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fRec0 = (fRec3[0] * fTemp2);
double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2);
@ -157,7 +180,9 @@ class faustHpf2pSv : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustHpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec3[2];
double fRec4[2];
double fRec2[3];
double fConst4;
double fRec5[2];
double fRec1[3];
@ -49,13 +52,15 @@ class faustHpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +69,14 @@ class faustHpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,50 +85,67 @@ class faustHpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec1[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -131,30 +155,32 @@ class faustHpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow5 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow6 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
fRec5[0] = (fSlow7 + (fConst1 * fRec5[1]));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
fRec0[1] = fRec0[0];
@ -165,7 +191,9 @@ class faustHpf4p : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustHpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec4[2];
double fRec5[2];
double fRec3[3];
double fConst4;
double fRec6[2];
double fRec2[3];
double fRec1[3];
@ -50,13 +53,15 @@ class faustHpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -65,12 +70,14 @@ class faustHpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -79,53 +86,71 @@ class faustHpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec2[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -135,30 +160,32 @@ class faustHpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
double fSlow4 = (fConst2 * ((-1.0 - fSlow1) / fSlow3));
double fSlow5 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow6 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow7 = (fConst4 * ((fSlow1 + 1.0) / fSlow3));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow4 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow5 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow6 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow7 + (fConst1 * fRec6[1]));
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
@ -172,7 +199,9 @@ class faustHpf6p : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustHsh_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustHsh
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,12 +30,16 @@ class faustHsh : public sfzFilterDsp {
public:
FAUSTFLOAT fPkShGain;
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fPkShGain;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
double fConst4;
double fRec2[2];
double fRec0[3];
double fRec3[2];
@ -50,13 +53,15 @@ class faustHsh : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -65,12 +70,14 @@ class faustHsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -79,51 +86,68 @@ class faustHsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (2.0 * fConst2);
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -133,36 +157,38 @@ class faustHsh : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
double fSlow3 = ((fSlow0 + -1.0) * fSlow2);
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
double fSlow9 = (fSlow0 + fSlow5);
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
double fSlow5 = ((fSlow0 + fSlow4) + (1.0 - fSlow3));
double fSlow6 = (fConst2 * ((fSlow0 + (1.0 - (fSlow3 + fSlow4))) / fSlow5));
double fSlow7 = ((fSlow0 + 1.0) * fSlow2);
double fSlow8 = (fConst4 * ((fSlow0 + (-1.0 - fSlow7)) / fSlow5));
double fSlow9 = (fSlow3 + fSlow0);
double fSlow10 = (fConst2 * ((((fSlow9 + fSlow4) + 1.0) * fSlow0) / fSlow5));
double fSlow11 = (fConst2 * (((0.0 - (2.0 * fSlow0)) * ((fSlow7 + fSlow0) + -1.0)) / fSlow5));
double fSlow12 = (fConst2 * (((fSlow9 + (1.0 - fSlow4)) * fSlow0) / fSlow5));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
fRec1[0] = (fSlow6 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow8 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[2]) + (fRec2[0] * fRec0[1])));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow12 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -171,7 +197,9 @@ class faustHsh : public sfzFilterDsp {
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf1p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf1p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustLpf1p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec1[2];
double fRec0[2];
@ -44,13 +46,15 @@ class faustLpf1p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -59,12 +63,14 @@ class faustLpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -73,37 +79,49 @@ class faustLpf1p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (1.0 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec0[l1] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -113,24 +131,28 @@ class faustLpf1p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
double fSlow0 = (fConst2 * std::exp((fConst3 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
fRec1[0] = (fSlow0 + (fConst1 * fRec1[1]));
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
fRec1[1] = fRec1[0];
fRec0[1] = fRec0[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf2p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf2p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustLpf2p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec2[2];
double fRec3[2];
double fRec1[3];
double fConst4;
double fRec4[2];
public:
@ -48,13 +51,15 @@ class faustLpf2p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -63,12 +68,14 @@ class faustLpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -77,47 +84,63 @@ class faustLpf2p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec3[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -127,31 +150,33 @@ class faustLpf2p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec2[0] = (fSlow6 + (fConst1 * fRec2[1]));
fRec3[0] = (fSlow7 + (fConst1 * fRec3[1]));
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
fRec4[0] = (fSlow8 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
fRec0[1] = fRec0[0];
fRec2[1] = fRec2[0];
@ -159,7 +184,9 @@ class faustLpf2p : public sfzFilterDsp {
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
fRec4[1] = fRec4[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf2pSv_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf2pSv
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustLpf2pSv : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
double fRec3[2];
FAUSTFLOAT fQ;
@ -48,13 +50,15 @@ class faustLpf2pSv : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -63,12 +67,14 @@ class faustLpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -77,47 +83,62 @@ class faustLpf2pSv : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (3.1415926535897931 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec3[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec1[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec2[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -127,23 +148,25 @@ class faustLpf2pSv : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
double fSlow0 = (fConst2 * std::tan((fConst3 * double(fCutoff))));
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
fRec3[0] = (fSlow0 + (fConst1 * fRec3[1]));
double fTemp1 = (fSlow1 + fRec3[0]);
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
fRec4[0] = ((fConst1 * fRec4[1]) + (fConst2 / ((fRec3[0] * fTemp1) + 1.0)));
fRec5[0] = ((fConst1 * fRec5[1]) + (fConst2 * fTemp1));
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
double fTemp4 = (fRec2[1] + (2.0 * fTemp3));
@ -157,7 +180,9 @@ class faustLpf2pSv : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf4p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf4p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustLpf4p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec3[2];
double fRec4[2];
double fRec2[3];
double fConst4;
double fRec5[2];
double fRec1[3];
@ -49,13 +52,15 @@ class faustLpf4p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +69,14 @@ class faustLpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,50 +85,67 @@ class faustLpf4p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec3[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec4[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec2[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec5[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec1[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -131,32 +155,34 @@ class faustLpf4p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec3[0] = (fSlow6 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow7 + (fConst1 * fRec4[1]));
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
fRec5[0] = (fSlow8 + (fConst1 * fRec5[1]));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[2]) + (fRec3[0] * fRec1[1])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
fRec0[1] = fRec0[0];
fRec3[1] = fRec3[0];
@ -166,7 +192,9 @@ class faustLpf4p : public sfzFilterDsp {
fRec5[1] = fRec5[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLpf6p_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLpf6p
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,14 +30,18 @@ class faustLpf6p : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec0[2];
double fRec4[2];
double fRec5[2];
double fRec3[3];
double fConst4;
double fRec6[2];
double fRec2[3];
double fRec1[3];
@ -50,13 +53,15 @@ class faustLpf6p : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -65,12 +70,14 @@ class faustLpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -79,53 +86,71 @@ class faustLpf6p : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (0.5 * fConst2);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec4[l1] = 0.0;
}
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
fRec5[l2] = 0.0;
}
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec6[l4] = 0.0;
}
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
fRec2[l5] = 0.0;
}
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
fRec1[l6] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -135,31 +160,33 @@ class faustLpf6p : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::cos(fSlow0);
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
double fSlow3 = (fSlow2 + 1.0);
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
double fSlow5 = (0.0010000000000000009 * fSlow4);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (0.00050000000000000044 * fSlow4);
double fSlow5 = (fConst2 * fSlow4);
double fSlow6 = (fConst2 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
double fSlow7 = (fConst2 * ((1.0 - fSlow2) / fSlow3));
double fSlow8 = (fConst4 * fSlow4);
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
fRec0[0] = (fSlow5 + (fConst1 * fRec0[1]));
fRec4[0] = (fSlow6 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow7 + (fConst1 * fRec5[1]));
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
fRec6[0] = (fSlow8 + (fConst1 * fRec6[1]));
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
@ -173,7 +200,9 @@ class faustLpf6p : public sfzFilterDsp {
fRec2[1] = fRec2[0];
fRec1[2] = fRec1[1];
fRec1[1] = fRec1[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustLsh_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustLsh
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,15 +30,19 @@ class faustLsh : public sfzFilterDsp {
public:
FAUSTFLOAT fPkShGain;
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
FAUSTFLOAT fPkShGain;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
double fRec1[2];
double fRec2[2];
double fRec0[3];
double fRec3[2];
double fConst4;
double fRec4[2];
double fRec5[2];
@ -50,13 +53,15 @@ class faustLsh : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -65,12 +70,14 @@ class faustLsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -79,51 +86,68 @@ class faustLsh : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
fConst4 = (2.0 * fConst2);
}
virtual void instanceResetUserInterface() {
fPkShGain = FAUSTFLOAT(0.0);
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
fRec5[l5] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -133,36 +157,38 @@ class faustLsh : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow2 = std::cos(fSlow1);
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
double fSlow6 = (fSlow0 + fSlow5);
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
double fSlow3 = ((fSlow0 + 1.0) * fSlow2);
double fSlow4 = ((fSlow0 + -1.0) * fSlow2);
double fSlow5 = (fSlow4 + fSlow0);
double fSlow6 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
double fSlow7 = ((fSlow5 + fSlow6) + 1.0);
double fSlow8 = (fConst2 * ((0.0 - (2.0 * ((fSlow3 + fSlow0) + -1.0))) / fSlow7));
double fSlow9 = (fConst2 * ((fSlow5 + (1.0 - fSlow6)) / fSlow7));
double fSlow10 = (fConst2 * ((((fSlow0 + fSlow6) + (1.0 - fSlow4)) * fSlow0) / fSlow7));
double fSlow11 = (fConst4 * (((fSlow0 + (-1.0 - fSlow3)) * fSlow0) / fSlow7));
double fSlow12 = (fConst2 * (((fSlow0 + (1.0 - (fSlow4 + fSlow6))) * fSlow0) / fSlow7));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
fRec1[0] = (fSlow8 + (fConst1 * fRec1[1]));
fRec2[0] = (fSlow9 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
fRec3[0] = (fSlow10 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow11 + (fConst1 * fRec4[1]));
fRec5[0] = (fSlow12 + (fConst1 * fRec5[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -171,7 +197,9 @@ class faustLsh : public sfzFilterDsp {
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
fRec5[1] = fRec5[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustPeq_H__
@ -21,7 +21,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustPeq
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,8 +30,11 @@ class faustPeq : public sfzFilterDsp {
public:
int fSampleRate;
int fSamplingFreq;
double fConst0;
double fConst1;
double fConst2;
double fConst3;
FAUSTFLOAT fCutoff;
FAUSTFLOAT fQ;
FAUSTFLOAT fPkShGain;
@ -49,13 +51,15 @@ class faustPeq : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -64,12 +68,14 @@ class faustPeq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -78,48 +84,63 @@ class faustPeq : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
fConst2 = (1.0 - fConst1);
fConst3 = (6.2831853071795862 / fConst0);
}
virtual void instanceResetUserInterface() {
fCutoff = FAUSTFLOAT(440.0);
fQ = FAUSTFLOAT(0.0);
fPkShGain = FAUSTFLOAT(0.0);
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
fRec1[l0] = 0.0;
}
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
fRec2[l1] = 0.0;
}
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
fRec0[l2] = 0.0;
}
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
fRec3[l3] = 0.0;
}
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
fRec4[l4] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -129,34 +150,36 @@ class faustPeq : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
double fSlow0 = (fConst3 * std::max<double>(0.0, double(fCutoff)));
double fSlow1 = std::sin(fSlow0);
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
double fSlow5 = (fSlow4 + 1.0);
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
double fSlow6 = (fConst2 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
double fSlow7 = (fConst2 * ((1.0 - fSlow4) / fSlow5));
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
double fSlow9 = (fConst2 * ((fSlow8 + 1.0) / fSlow5));
double fSlow10 = (fConst2 * ((1.0 - fSlow8) / fSlow5));
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
fRec1[0] = (fSlow6 + (fConst1 * fRec1[1]));
double fTemp1 = (fRec1[0] * fRec0[1]);
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
fRec2[0] = (fSlow7 + (fConst1 * fRec2[1]));
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
fRec3[0] = (fSlow9 + (fConst1 * fRec3[1]));
fRec4[0] = (fSlow10 + (fConst1 * fRec4[1]));
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
fRec1[1] = fRec1[0];
fRec2[1] = fRec2[0];
@ -164,7 +187,9 @@ class faustPeq : public sfzFilterDsp {
fRec0[1] = fRec0[0];
fRec3[1] = fRec3[0];
fRec4[1] = fRec4[0];
}
}
};

View file

@ -2,8 +2,8 @@
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.15.11 (https://faust.grame.fr)
Compilation options: -inpl -double -ftz 0
------------------------------------------------------------ */
#ifndef __faustPink_H__
@ -20,7 +20,6 @@ Compilation options: -lang cpp -inpl -double -ftz 0
#ifndef FAUSTCLASS
#define FAUSTCLASS faustPink
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
@ -31,7 +30,7 @@ class faustPink : public sfzFilterDsp {
public:
double fRec0[4];
int fSampleRate;
int fSamplingFreq;
public:
@ -40,13 +39,15 @@ class faustPink : public sfzFilterDsp {
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
virtual int getInputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -55,12 +56,14 @@ class faustPink : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
virtual int getOutputRate(int channel) {
int rate;
switch ((channel)) {
switch (channel) {
case 0: {
rate = 1;
break;
@ -69,32 +72,40 @@ class faustPink : public sfzFilterDsp {
rate = -1;
break;
}
}
return rate;
}
static void classInit(int sample_rate) {
static void classInit(int samplingFreq) {
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
virtual void instanceConstants(int samplingFreq) {
fSamplingFreq = samplingFreq;
}
virtual void instanceResetUserInterface() {
}
virtual void instanceClear() {
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
fRec0[l0] = 0.0;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
virtual void init(int samplingFreq) {
classInit(samplingFreq);
instanceInit(samplingFreq);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
virtual void instanceInit(int samplingFreq) {
instanceConstants(samplingFreq);
instanceResetUserInterface();
instanceClear();
}
@ -104,10 +115,12 @@ class faustPink : public sfzFilterDsp {
}
virtual int getSampleRate() {
return fSampleRate;
return fSamplingFreq;
}
virtual void buildUserInterface(UI* ui_interface) {
}
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
@ -115,12 +128,15 @@ class faustPink : public sfzFilterDsp {
FAUSTFLOAT* output0 = outputs[0];
for (int i = 0; (i < count); i = (i + 1)) {
double fTemp0 = double(input0[i]);
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2]));
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
fRec0[j0] = fRec0[(j0 - 1)];
}
}
}
};