Regenerated the filters with faust 2.20.2
This commit is contained in:
parent
d283392692
commit
8ece037935
48 changed files with 1897 additions and 2845 deletions
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chApf1p_H__
|
#ifndef __faust2chApf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chApf1p
|
#define FAUSTCLASS faust2chApf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
|
|
@ -46,15 +47,13 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -87,52 +84,42 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec2[l2] = 0.0;
|
fRec2[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -142,12 +129,10 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -155,12 +140,12 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||||
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
|
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
|
||||||
|
|
@ -168,9 +153,7 @@ class faust2chApf1p : public sfzFilterDsp {
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBpf1p_H__
|
#ifndef __faust2chBpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBpf1p
|
#define FAUSTCLASS faust2chBpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
@ -48,15 +49,13 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -69,14 +68,12 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -89,60 +86,48 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec2[l0] = 0.0;
|
fRec2[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec1[l1] = 0.0;
|
fRec1[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec4[l3] = 0.0;
|
fRec4[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec3[l4] = 0.0;
|
fRec3[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -152,12 +137,10 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -165,19 +148,19 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1);
|
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||||
fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0);
|
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||||
double fTemp2 = (1.0 - fRec2[0]);
|
double fTemp2 = (1.0 - fRec2[0]);
|
||||||
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
|
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
|
||||||
double fTemp3 = (fRec2[0] + 1.0);
|
double fTemp3 = (fRec2[0] + 1.0);
|
||||||
double fTemp4 = (0.0 - (0.5 * fTemp3));
|
double fTemp4 = (0.0 - (0.5 * fTemp3));
|
||||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4)));
|
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4)));
|
||||||
fRec4[0] = ((fRec2[0] * fRec4[1]) + fTemp1);
|
fRec4[0] = (fTemp1 + (fRec2[0] * fRec4[1]));
|
||||||
fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1]));
|
fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1]));
|
||||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1])));
|
output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1])));
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -185,9 +168,7 @@ class faust2chBpf1p : public sfzFilterDsp {
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBpf2p_H__
|
#ifndef __faust2chBpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBpf2p
|
#define FAUSTCLASS faust2chBpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,14 +71,12 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -92,69 +89,55 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec6[l6] = 0.0;
|
fRec6[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -164,12 +147,10 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,7 +158,7 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
|
|
@ -186,18 +167,18 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
double fSlow6 = (1.0 - fSlow0);
|
double fSlow6 = (1.0 - fSlow0);
|
||||||
double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6);
|
double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6);
|
||||||
double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6);
|
double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6);
|
||||||
double fSlow9 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow9 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow10 = (fSlow9 * fSlow6);
|
double fSlow10 = (fSlow9 * fSlow6);
|
||||||
double fSlow11 = ((0.0 - fSlow9) * fSlow6);
|
double fSlow11 = ((0.0 - fSlow9) * fSlow6);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow7);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow7);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow8);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow8);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow10);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow10);
|
||||||
fRec4[0] = (fRec4[1] * fSlow0);
|
fRec4[0] = (fSlow0 * fRec4[1]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow11);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow11);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
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])));
|
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])));
|
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||||
|
|
@ -210,9 +191,7 @@ class faust2chBpf2p : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec6[2] = fRec6[1];
|
fRec6[2] = fRec6[1];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBpf2pSv_H__
|
#ifndef __faust2chBpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBpf2pSv
|
#define FAUSTCLASS faust2chBpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -52,15 +53,13 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,14 +72,12 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,73 +90,58 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec3[l0] = 0.0;
|
fRec3[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec6[l5] = 0.0;
|
fRec6[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||||
fRec8[l6] = 0.0;
|
fRec8[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
|
||||||
fRec9[l7] = 0.0;
|
fRec9[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -169,12 +151,10 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -182,7 +162,7 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
|
|
@ -190,11 +170,11 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||||
double fTemp2 = (fSlow3 + fRec3[0]);
|
double fTemp2 = (fSlow3 + fRec3[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2));
|
||||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fTemp5 = (fTemp3 * fTemp4);
|
double fTemp5 = (fTemp3 * fTemp4);
|
||||||
double fTemp6 = (fRec2[1] + fTemp5);
|
double fTemp6 = (fRec2[1] + fTemp5);
|
||||||
|
|
@ -202,7 +182,7 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6)));
|
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6)));
|
||||||
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
||||||
fRec2[0] = fTemp7;
|
fRec2[0] = fTemp7;
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow4);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow4);
|
||||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||||
double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1])));
|
double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1])));
|
||||||
double fTemp9 = (fTemp3 * fTemp8);
|
double fTemp9 = (fTemp3 * fTemp8);
|
||||||
|
|
@ -220,9 +200,7 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
fRec9[1] = fRec9[0];
|
fRec9[1] = fRec9[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBpf4p_H__
|
#ifndef __faust2chBpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBpf4p
|
#define FAUSTCLASS faust2chBpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -53,15 +54,13 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -74,14 +73,12 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -94,77 +91,61 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec6[l5] = 0.0;
|
fRec6[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec8[l7] = 0.0;
|
fRec8[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||||
fRec7[l8] = 0.0;
|
fRec7[l8] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -174,12 +155,10 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -187,13 +166,13 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||||
double fSlow5 = (fSlow4 + 1.0);
|
double fSlow5 = (fSlow4 + 1.0);
|
||||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow7 = (1.0 - fSlow0);
|
double fSlow7 = (1.0 - fSlow0);
|
||||||
double fSlow8 = (fSlow6 * fSlow7);
|
double fSlow8 = (fSlow6 * fSlow7);
|
||||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
||||||
|
|
@ -202,12 +181,12 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow9);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow9);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow10);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow10);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = (fRec5[1] * fSlow0);
|
fRec5[0] = (fSlow0 * fRec5[1]);
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow11);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow11);
|
||||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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])));
|
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])));
|
fRec8[0] = (fTemp1 - ((fRec3[0] * fRec8[1]) + (fRec4[0] * fRec8[2])));
|
||||||
|
|
@ -226,9 +205,7 @@ class faust2chBpf4p : public sfzFilterDsp {
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
fRec7[2] = fRec7[1];
|
fRec7[2] = fRec7[1];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBpf6p_H__
|
#ifndef __faust2chBpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBpf6p
|
#define FAUSTCLASS faust2chBpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -55,15 +56,13 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -76,14 +75,12 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -96,85 +93,67 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec6[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec6[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec7[l5] = 0.0;
|
fRec7[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec2[l6] = 0.0;
|
fRec2[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec1[l7] = 0.0;
|
fRec1[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||||
fRec10[l8] = 0.0;
|
fRec10[l8] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||||
fRec9[l9] = 0.0;
|
fRec9[l9] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) {
|
for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) {
|
||||||
fRec8[l10] = 0.0;
|
fRec8[l10] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -184,12 +163,10 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -197,13 +174,13 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||||
double fSlow5 = (fSlow4 + 1.0);
|
double fSlow5 = (fSlow4 + 1.0);
|
||||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow7 = (1.0 - fSlow0);
|
double fSlow7 = (1.0 - fSlow0);
|
||||||
double fSlow8 = (fSlow6 * fSlow7);
|
double fSlow8 = (fSlow6 * fSlow7);
|
||||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
||||||
|
|
@ -212,19 +189,19 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8);
|
||||||
fRec3[0] = (fRec3[1] * fSlow0);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow10);
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow10);
|
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||||
fRec4[0] = (fTemp0 - ((fRec5[0] * fRec4[1]) + (fRec6[0] * fRec4[2])));
|
fRec6[0] = (fSlow0 * fRec6[1]);
|
||||||
fRec7[0] = (fSlow11 + (fRec7[1] * fSlow0));
|
fRec7[0] = ((fSlow0 * fRec7[1]) + fSlow11);
|
||||||
fRec2[0] = (((fRec3[0] * fRec4[1]) + ((fRec4[0] * fRec0[0]) + (fRec7[0] * fRec4[2]))) - ((fRec5[0] * fRec2[1]) + (fRec6[0] * fRec2[2])));
|
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]) + (fRec3[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec5[0] * fRec1[1]) + (fRec6[0] * fRec1[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]) + (fRec3[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||||
fRec10[0] = (fTemp1 - ((fRec5[0] * fRec10[1]) + (fRec6[0] * fRec10[2])));
|
fRec10[0] = (fTemp1 - ((fRec4[0] * fRec10[1]) + (fRec5[0] * fRec10[2])));
|
||||||
fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec3[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec5[0] * fRec9[1]) + (fRec6[0] * fRec9[2])));
|
fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec6[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||||
fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec3[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec5[0] * fRec8[1]) + (fRec6[0] * fRec8[2])));
|
fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec6[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||||
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec3[0] * fRec8[1])) + (fRec7[0] * fRec8[2])));
|
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec6[0] * fRec8[1])) + (fRec7[0] * fRec8[2])));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
@ -242,9 +219,7 @@ class faust2chBpf6p : public sfzFilterDsp {
|
||||||
fRec9[1] = fRec9[0];
|
fRec9[1] = fRec9[0];
|
||||||
fRec8[2] = fRec8[1];
|
fRec8[2] = fRec8[1];
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBrf1p_H__
|
#ifndef __faust2chBrf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBrf1p
|
#define FAUSTCLASS faust2chBrf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
@ -48,15 +49,13 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -69,14 +68,12 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -89,60 +86,48 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec2[l0] = 0.0;
|
fRec2[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec1[l1] = 0.0;
|
fRec1[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec4[l3] = 0.0;
|
fRec4[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec3[l4] = 0.0;
|
fRec3[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -152,12 +137,10 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -165,26 +148,24 @@ class faust2chBrf1p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1);
|
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0));
|
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||||
fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1]));
|
fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1]));
|
||||||
fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1])));
|
fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1])));
|
||||||
output1[i] = FAUSTFLOAT(((fRec3[1] + (fRec2[0] * fRec3[0])) + fTemp1));
|
output1[i] = FAUSTFLOAT((fTemp1 + (fRec3[1] + (fRec2[0] * fRec3[0]))));
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBrf2p_H__
|
#ifndef __faust2chBrf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBrf2p
|
#define FAUSTCLASS faust2chBrf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -49,15 +50,13 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -70,14 +69,12 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -90,61 +87,49 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec1[l2] = 0.0;
|
fRec1[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -154,12 +139,10 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -167,7 +150,7 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
double fSlow3 = (fSlow2 + 1.0);
|
double fSlow3 = (fSlow2 + 1.0);
|
||||||
|
|
@ -178,11 +161,11 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow5);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow5);
|
||||||
double fTemp2 = (fRec0[0] * fRec1[1]);
|
double fTemp2 = (fRec0[0] * fRec1[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow6);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow6);
|
||||||
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7);
|
||||||
output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||||
double fTemp3 = (fRec0[0] * fRec4[1]);
|
double fTemp3 = (fRec0[0] * fRec4[1]);
|
||||||
fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2])));
|
fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2])));
|
||||||
|
|
@ -194,9 +177,7 @@ class faust2chBrf2p : public sfzFilterDsp {
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec4[2] = fRec4[1];
|
fRec4[2] = fRec4[1];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chBrf2pSv_H__
|
#ifndef __faust2chBrf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chBrf2pSv
|
#define FAUSTCLASS faust2chBrf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,14 +71,12 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -92,69 +89,55 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec5[l0] = 0.0;
|
fRec5[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec6[l2] = 0.0;
|
fRec6[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec3[l4] = 0.0;
|
fRec3[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec9[l5] = 0.0;
|
fRec9[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||||
fRec10[l6] = 0.0;
|
fRec10[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -164,12 +147,10 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,17 +158,17 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow2);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2);
|
||||||
double fTemp2 = (fSlow3 + fRec5[0]);
|
double fTemp2 = (fSlow3 + fRec5[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec5[0] * fTemp2) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec5[0] * fTemp2) + 1.0)));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + (fSlow1 * fTemp2));
|
fRec6[0] = ((fSlow0 * fRec6[1]) + (fSlow1 * fTemp2));
|
||||||
double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||||
double fRec0 = (fRec4[0] * fTemp3);
|
double fRec0 = (fRec4[0] * fTemp3);
|
||||||
double fTemp4 = (fRec5[0] * fRec4[0]);
|
double fTemp4 = (fRec5[0] * fRec4[0]);
|
||||||
|
|
@ -214,9 +195,7 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec9[1] = fRec9[0];
|
fRec9[1] = fRec9[0];
|
||||||
fRec10[1] = fRec10[0];
|
fRec10[1] = fRec10[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chEq_H__
|
#ifndef __faust2chEq_H__
|
||||||
|
|
@ -22,6 +22,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chEq
|
#define FAUSTCLASS faust2chEq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -31,7 +32,7 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -53,15 +54,13 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -74,14 +73,12 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -94,67 +91,54 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
fConst3 = (2.1775860903036022 / fConst0);
|
fConst3 = (2.1775860903036022 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fBandwidth = FAUSTFLOAT(1.0);
|
fBandwidth = FAUSTFLOAT(1.0);
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -164,12 +148,10 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,7 +159,7 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
||||||
double fSlow2 = (fConst2 * fSlow1);
|
double fSlow2 = (fConst2 * fSlow1);
|
||||||
double fSlow3 = std::sin(fSlow2);
|
double fSlow3 = std::sin(fSlow2);
|
||||||
|
|
@ -194,12 +176,12 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9);
|
||||||
double fTemp2 = (fRec1[0] * fRec0[1]);
|
double fTemp2 = (fRec1[0] * fRec0[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10);
|
||||||
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
||||||
double fTemp3 = (fRec1[0] * fRec5[1]);
|
double fTemp3 = (fRec1[0] * fRec5[1]);
|
||||||
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
||||||
|
|
@ -212,9 +194,7 @@ class faust2chEq : public sfzFilterDsp {
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[2] = fRec5[1];
|
fRec5[2] = fRec5[1];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHpf1p_H__
|
#ifndef __faust2chHpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHpf1p
|
#define FAUSTCLASS faust2chHpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
|
|
@ -46,15 +47,13 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -87,52 +84,42 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec2[l2] = 0.0;
|
fRec2[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -142,12 +129,10 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -155,24 +140,22 @@ class faust2chHpf1p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
|
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||||
double fTemp2 = (fRec1[0] + 1.0);
|
double fTemp2 = (fRec1[0] + 1.0);
|
||||||
double fTemp3 = (0.0 - (0.5 * fTemp2));
|
double fTemp3 = (0.0 - (0.5 * fTemp2));
|
||||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3)));
|
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3)));
|
||||||
fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1);
|
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1])));
|
output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHpf2p_H__
|
#ifndef __faust2chHpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHpf2p
|
#define FAUSTCLASS faust2chHpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -50,15 +51,13 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -71,14 +70,12 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -91,65 +88,52 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec3[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -159,12 +143,10 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -172,7 +154,7 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -185,11 +167,11 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow7);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow7);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow8);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow8);
|
||||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9);
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[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]))));
|
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||||
|
|
@ -201,9 +183,7 @@ class faust2chHpf2p : public sfzFilterDsp {
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[2] = fRec5[1];
|
fRec5[2] = fRec5[1];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHpf2pSv_H__
|
#ifndef __faust2chHpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHpf2pSv
|
#define FAUSTCLASS faust2chHpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,14 +71,12 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -92,69 +89,55 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec4[l0] = 0.0;
|
fRec4[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec7[l5] = 0.0;
|
fRec7[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||||
fRec8[l6] = 0.0;
|
fRec8[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -164,12 +147,10 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,17 +158,17 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow2);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2);
|
||||||
double fTemp2 = (fSlow3 + fRec4[0]);
|
double fTemp2 = (fSlow3 + fRec4[0]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + (fSlow1 / ((fRec4[0] * fTemp2) + 1.0)));
|
fRec3[0] = ((fSlow0 * fRec3[1]) + (fSlow1 / ((fRec4[0] * fTemp2) + 1.0)));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2));
|
||||||
double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fRec0 = (fRec3[0] * fTemp3);
|
double fRec0 = (fRec3[0] * fTemp3);
|
||||||
double fTemp4 = (fRec4[0] * fRec3[0]);
|
double fTemp4 = (fRec4[0] * fRec3[0]);
|
||||||
|
|
@ -212,9 +193,7 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHpf4p_H__
|
#ifndef __faust2chHpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHpf4p
|
#define FAUSTCLASS faust2chHpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -52,15 +53,13 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,14 +72,12 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,73 +90,58 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec1[l5] = 0.0;
|
fRec1[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec7[l6] = 0.0;
|
fRec7[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec6[l7] = 0.0;
|
fRec6[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -169,12 +151,10 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -182,7 +162,7 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -195,11 +175,11 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow8);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow8);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9);
|
||||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||||
|
|
@ -217,9 +197,7 @@ class faust2chHpf4p : public sfzFilterDsp {
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
fRec6[2] = fRec6[1];
|
fRec6[2] = fRec6[1];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHpf6p_H__
|
#ifndef __faust2chHpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHpf6p
|
#define FAUSTCLASS faust2chHpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -54,15 +55,13 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -75,14 +74,12 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -95,81 +92,64 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec6[l4] = 0.0;
|
fRec6[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec2[l5] = 0.0;
|
fRec2[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec9[l7] = 0.0;
|
fRec9[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||||
fRec8[l8] = 0.0;
|
fRec8[l8] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||||
fRec7[l9] = 0.0;
|
fRec7[l9] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -179,12 +159,10 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -192,7 +170,7 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -205,11 +183,11 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow7);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow7);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow8);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow8);
|
||||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow9);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow9);
|
||||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
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])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||||
|
|
@ -233,9 +211,7 @@ class faust2chHpf6p : public sfzFilterDsp {
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
fRec7[2] = fRec7[1];
|
fRec7[2] = fRec7[1];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chHsh_H__
|
#ifndef __faust2chHsh_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chHsh
|
#define FAUSTCLASS faust2chHsh
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fPkShGain;
|
FAUSTFLOAT fPkShGain;
|
||||||
|
|
@ -52,15 +53,13 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,14 +72,12 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,70 +90,56 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec6[l6] = 0.0;
|
fRec6[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -166,12 +149,10 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -179,30 +160,30 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow3 = std::cos(fSlow2);
|
double fSlow3 = std::cos(fSlow2);
|
||||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||||
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
|
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||||
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
||||||
double fSlow8 = (1.0 - fSlow0);
|
double fSlow8 = (1.0 - fSlow0);
|
||||||
double fSlow9 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
double fSlow9 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
||||||
double fSlow10 = (((fSlow1 + (1.0 - (fSlow6 + fSlow5))) / fSlow7) * fSlow8);
|
double fSlow10 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
|
||||||
double fSlow11 = (fSlow6 + fSlow1);
|
double fSlow11 = (fSlow1 + fSlow6);
|
||||||
double fSlow12 = (((((fSlow11 + fSlow5) + 1.0) * fSlow1) / fSlow7) * fSlow8);
|
double fSlow12 = (((fSlow1 * ((fSlow5 + fSlow11) + 1.0)) / fSlow7) * fSlow8);
|
||||||
double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow4 + fSlow1) + -1.0)) / fSlow7) * fSlow8);
|
double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
|
||||||
double fSlow14 = ((((fSlow11 + (1.0 - fSlow5)) * fSlow1) / fSlow7) * fSlow8);
|
double fSlow14 = (((fSlow1 * (fSlow11 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
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])));
|
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])));
|
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||||
|
|
@ -215,9 +196,7 @@ class faust2chHsh : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec6[2] = fRec6[1];
|
fRec6[2] = fRec6[1];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLpf1p_H__
|
#ifndef __faust2chLpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLpf1p
|
#define FAUSTCLASS faust2chLpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
|
|
@ -46,15 +47,13 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -87,52 +84,42 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec2[l2] = 0.0;
|
fRec2[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -142,12 +129,10 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -155,23 +140,21 @@ class faust2chLpf1p : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
|
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||||
double fTemp2 = (1.0 - fRec1[0]);
|
double fTemp2 = (1.0 - fRec1[0]);
|
||||||
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
|
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
|
||||||
fRec2[0] = ((fRec1[0] * fRec2[1]) + fTemp1);
|
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||||
output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2));
|
output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLpf2p_H__
|
#ifndef __faust2chLpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLpf2p
|
#define FAUSTCLASS faust2chLpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -50,15 +51,13 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -71,14 +70,12 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -91,65 +88,52 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec3[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -159,12 +143,10 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,7 +159,7 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -186,11 +168,11 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec2[0] = ((fRec2[1] * fSlow5) + fSlow8);
|
fRec2[0] = ((fSlow5 * fRec2[1]) + fSlow8);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow5) + fSlow9);
|
fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow9);
|
||||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow10);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow10);
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[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]))));
|
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||||
|
|
@ -202,9 +184,7 @@ class faust2chLpf2p : public sfzFilterDsp {
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[2] = fRec5[1];
|
fRec5[2] = fRec5[1];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLpf2pSv_H__
|
#ifndef __faust2chLpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLpf2pSv
|
#define FAUSTCLASS faust2chLpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,14 +71,12 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -92,69 +89,55 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec3[l0] = 0.0;
|
fRec3[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec7[l5] = 0.0;
|
fRec7[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||||
fRec8[l6] = 0.0;
|
fRec8[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -164,12 +147,10 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -177,18 +158,18 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||||
double fTemp2 = (fSlow3 + fRec3[0]);
|
double fTemp2 = (fSlow3 + fRec3[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp2));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp2));
|
||||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fTemp5 = (fTemp3 * fTemp4);
|
double fTemp5 = (fTemp3 * fTemp4);
|
||||||
double fTemp6 = (fRec2[1] + (2.0 * fTemp5));
|
double fTemp6 = (fRec2[1] + (2.0 * fTemp5));
|
||||||
|
|
@ -212,9 +193,7 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLpf4p_H__
|
#ifndef __faust2chLpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLpf4p
|
#define FAUSTCLASS faust2chLpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -52,15 +53,13 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,14 +72,12 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,73 +90,58 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec1[l5] = 0.0;
|
fRec1[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec7[l6] = 0.0;
|
fRec7[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec6[l7] = 0.0;
|
fRec6[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -169,12 +151,10 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -187,7 +167,7 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -196,11 +176,11 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow5) + fSlow8);
|
fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow8);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow9);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow9);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow5) + fSlow10);
|
fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow10);
|
||||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||||
|
|
@ -218,9 +198,7 @@ class faust2chLpf4p : public sfzFilterDsp {
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
fRec6[2] = fRec6[1];
|
fRec6[2] = fRec6[1];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLpf6p_H__
|
#ifndef __faust2chLpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLpf6p
|
#define FAUSTCLASS faust2chLpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -54,15 +55,13 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -75,14 +74,12 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -95,81 +92,64 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec6[l4] = 0.0;
|
fRec6[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec2[l5] = 0.0;
|
fRec2[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec9[l7] = 0.0;
|
fRec9[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||||
fRec8[l8] = 0.0;
|
fRec8[l8] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||||
fRec7[l9] = 0.0;
|
fRec7[l9] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -179,12 +159,10 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -197,7 +175,7 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -206,11 +184,11 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow8);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow8);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow5) + fSlow9);
|
fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow9);
|
||||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow5) + fSlow10);
|
fRec6[0] = ((fSlow5 * fRec6[1]) + fSlow10);
|
||||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
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])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||||
|
|
@ -234,9 +212,7 @@ class faust2chLpf6p : public sfzFilterDsp {
|
||||||
fRec8[1] = fRec8[0];
|
fRec8[1] = fRec8[0];
|
||||||
fRec7[2] = fRec7[1];
|
fRec7[2] = fRec7[1];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chLsh_H__
|
#ifndef __faust2chLsh_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chLsh
|
#define FAUSTCLASS faust2chLsh
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fPkShGain;
|
FAUSTFLOAT fPkShGain;
|
||||||
|
|
@ -52,15 +53,13 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -73,14 +72,12 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -93,70 +90,56 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec6[l6] = 0.0;
|
fRec6[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -166,12 +149,10 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -179,30 +160,30 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow3 = std::cos(fSlow2);
|
double fSlow3 = std::cos(fSlow2);
|
||||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||||
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
|
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||||
double fSlow6 = (fSlow5 + fSlow1);
|
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||||
double fSlow7 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
double fSlow7 = (fSlow1 + fSlow6);
|
||||||
double fSlow8 = ((fSlow6 + fSlow7) + 1.0);
|
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
|
||||||
double fSlow9 = (1.0 - fSlow0);
|
double fSlow9 = (1.0 - fSlow0);
|
||||||
double fSlow10 = (((0.0 - (2.0 * ((fSlow4 + fSlow1) + -1.0))) / fSlow8) * fSlow9);
|
double fSlow10 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
|
||||||
double fSlow11 = (((fSlow6 + (1.0 - fSlow7)) / fSlow8) * fSlow9);
|
double fSlow11 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
|
||||||
double fSlow12 = (((((fSlow1 + fSlow7) + (1.0 - fSlow5)) * fSlow1) / fSlow8) * fSlow9);
|
double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
|
||||||
double fSlow13 = ((2.0 * (((fSlow1 + (-1.0 - fSlow4)) * fSlow1) / fSlow8)) * fSlow9);
|
double fSlow13 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
|
||||||
double fSlow14 = ((((fSlow1 + (1.0 - (fSlow5 + fSlow7))) * fSlow1) / fSlow8) * fSlow9);
|
double fSlow14 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow10);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow10);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow11);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow11);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
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])));
|
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])));
|
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||||
|
|
@ -215,9 +196,7 @@ class faust2chLsh : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec6[2] = fRec6[1];
|
fRec6[2] = fRec6[1];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chPeq_H__
|
#ifndef __faust2chPeq_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chPeq
|
#define FAUSTCLASS faust2chPeq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,14 +71,12 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -92,66 +89,53 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -161,12 +145,10 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -174,7 +156,7 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* input1 = inputs[1];
|
FAUSTFLOAT* input1 = inputs[1];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
FAUSTFLOAT* output1 = outputs[1];
|
FAUSTFLOAT* output1 = outputs[1];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
|
|
@ -190,12 +172,12 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow8);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow8);
|
||||||
double fTemp2 = (fRec1[0] * fRec0[1]);
|
double fTemp2 = (fRec1[0] * fRec0[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow9);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow9);
|
||||||
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow11);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow12);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow12);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
||||||
double fTemp3 = (fRec1[0] * fRec5[1]);
|
double fTemp3 = (fRec1[0] * fRec5[1]);
|
||||||
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
||||||
|
|
@ -208,9 +190,7 @@ class faust2chPeq : public sfzFilterDsp {
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[2] = fRec5[1];
|
fRec5[2] = fRec5[1];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faust2chPink_H__
|
#ifndef __faust2chPink_H__
|
||||||
|
|
@ -20,6 +20,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faust2chPink
|
#define FAUSTCLASS faust2chPink
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -31,7 +32,7 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
|
|
||||||
double fRec0[4];
|
double fRec0[4];
|
||||||
double fRec1[4];
|
double fRec1[4];
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -40,15 +41,13 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -61,14 +60,12 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -81,44 +78,35 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
|
||||||
fRec1[l1] = 0.0;
|
fRec1[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -128,12 +116,10 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -144,21 +130,17 @@ class faust2chPink : public sfzFilterDsp {
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
double fTemp1 = double(input1[i]);
|
double fTemp1 = double(input1[i]);
|
||||||
fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2]));
|
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
||||||
fRec1[0] = ((((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3])) + fTemp1) - (2.0172658750000001 * fRec1[2]));
|
fRec1[0] = ((fTemp1 + ((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3]))) - (2.0172658750000001 * fRec1[2]));
|
||||||
output1[i] = FAUSTFLOAT((((0.049922034999999997 * fRec1[0]) + (0.050612698999999997 * fRec1[2])) - ((0.095993537000000004 * fRec1[1]) + (0.0044087859999999996 * fRec1[3]))));
|
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)) {
|
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||||
fRec0[j0] = fRec0[(j0 - 1)];
|
fRec0[j0] = fRec0[(j0 - 1)];
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) {
|
for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) {
|
||||||
fRec1[j1] = fRec1[(j1 - 1)];
|
fRec1[j1] = fRec1[(j1 - 1)];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustApf1p_H__
|
#ifndef __faustApf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustApf1p
|
#define FAUSTCLASS faustApf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faustApf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
||||||
|
|
@ -45,15 +46,13 @@ class faustApf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -62,14 +61,12 @@ class faustApf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -78,48 +75,39 @@ class faustApf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -129,29 +117,25 @@ class faustApf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBpf1p_H__
|
#ifndef __faustBpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBpf1p
|
#define FAUSTCLASS faustBpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faustBpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
@ -46,15 +47,13 @@ class faustBpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -63,14 +62,12 @@ class faustBpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -79,52 +76,42 @@ class faustBpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec2[l0] = 0.0;
|
fRec2[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec1[l1] = 0.0;
|
fRec1[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -134,32 +121,28 @@ class faustBpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1);
|
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||||
fRec1[0] = ((fRec2[0] * fRec1[1]) + fTemp0);
|
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||||
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
|
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
|
||||||
double fTemp1 = (fRec2[0] + 1.0);
|
double fTemp1 = (fRec2[0] + 1.0);
|
||||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBpf2p_H__
|
#ifndef __faustBpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBpf2p
|
#define FAUSTCLASS faustBpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -50,15 +51,13 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -83,65 +80,52 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -151,18 +135,16 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
|
|
@ -171,17 +153,17 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
double fSlow6 = (1.0 - fSlow0);
|
double fSlow6 = (1.0 - fSlow0);
|
||||||
double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6);
|
double fSlow7 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow6);
|
||||||
double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6);
|
double fSlow8 = (((1.0 - fSlow4) / fSlow5) * fSlow6);
|
||||||
double fSlow9 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow9 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow10 = (fSlow9 * fSlow6);
|
double fSlow10 = (fSlow9 * fSlow6);
|
||||||
double fSlow11 = ((0.0 - fSlow9) * fSlow6);
|
double fSlow11 = ((0.0 - fSlow9) * fSlow6);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow7);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow7);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow8);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow8);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow10);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow10);
|
||||||
fRec4[0] = (fRec4[1] * fSlow0);
|
fRec4[0] = (fSlow0 * fRec4[1]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow11);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow11);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -190,9 +172,7 @@ class faustBpf2p : public sfzFilterDsp {
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBpf2pSv_H__
|
#ifndef __faustBpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBpf2pSv
|
#define FAUSTCLASS faustBpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -50,15 +51,13 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -83,65 +80,52 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec3[l0] = 0.0;
|
fRec3[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec6[l5] = 0.0;
|
fRec6[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -151,28 +135,26 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
double fSlow4 = (fSlow3 * fSlow1);
|
double fSlow4 = (fSlow3 * fSlow1);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||||
double fTemp1 = (fSlow3 + fRec3[0]);
|
double fTemp1 = (fSlow3 + fRec3[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1));
|
||||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||||
double fTemp4 = (fRec2[1] + fTemp3);
|
double fTemp4 = (fRec2[1] + fTemp3);
|
||||||
|
|
@ -180,7 +162,7 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4)));
|
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4)));
|
||||||
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
||||||
fRec2[0] = fTemp5;
|
fRec2[0] = fTemp5;
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow4);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow4);
|
||||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
@ -188,9 +170,7 @@ class faustBpf2pSv : public sfzFilterDsp {
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBpf4p_H__
|
#ifndef __faustBpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBpf4p
|
#define FAUSTCLASS faustBpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -68,14 +67,12 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -84,69 +81,55 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec6[l5] = 0.0;
|
fRec6[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -156,24 +139,22 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||||
double fSlow5 = (fSlow4 + 1.0);
|
double fSlow5 = (fSlow4 + 1.0);
|
||||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow7 = (1.0 - fSlow0);
|
double fSlow7 = (1.0 - fSlow0);
|
||||||
double fSlow8 = (fSlow6 * fSlow7);
|
double fSlow8 = (fSlow6 * fSlow7);
|
||||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
||||||
|
|
@ -181,12 +162,12 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
double fSlow11 = ((0.0 - fSlow6) * fSlow7);
|
double fSlow11 = ((0.0 - fSlow6) * fSlow7);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow9);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow9);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow10);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow10);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = (fRec5[1] * fSlow0);
|
fRec5[0] = (fSlow0 * fRec5[1]);
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow11);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow11);
|
||||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
@ -198,9 +179,7 @@ class faustBpf4p : public sfzFilterDsp {
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBpf6p_H__
|
#ifndef __faustBpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBpf6p
|
#define FAUSTCLASS faustBpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,17 +31,17 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
FAUSTFLOAT fQ;
|
FAUSTFLOAT fQ;
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
double fRec4[2];
|
double fRec3[2];
|
||||||
double fRec5[2];
|
double fRec5[2];
|
||||||
double fRec3[3];
|
|
||||||
double fRec6[2];
|
double fRec6[2];
|
||||||
|
double fRec4[3];
|
||||||
double fRec7[2];
|
double fRec7[2];
|
||||||
double fRec2[3];
|
double fRec2[3];
|
||||||
double fRec1[3];
|
double fRec1[3];
|
||||||
|
|
@ -52,15 +53,13 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -69,14 +68,12 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -85,73 +82,58 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec6[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
||||||
fRec6[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec7[l5] = 0.0;
|
fRec7[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec2[l6] = 0.0;
|
fRec2[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||||
fRec1[l7] = 0.0;
|
fRec1[l7] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -161,24 +143,22 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||||
double fSlow5 = (fSlow4 + 1.0);
|
double fSlow5 = (fSlow4 + 1.0);
|
||||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow5 * fSlow3)));
|
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||||
double fSlow7 = (1.0 - fSlow0);
|
double fSlow7 = (1.0 - fSlow0);
|
||||||
double fSlow8 = (fSlow6 * fSlow7);
|
double fSlow8 = (fSlow6 * fSlow7);
|
||||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow5) * fSlow7);
|
||||||
|
|
@ -186,29 +166,27 @@ class faustBpf6p : public sfzFilterDsp {
|
||||||
double fSlow11 = ((0.0 - fSlow6) * fSlow7);
|
double fSlow11 = ((0.0 - fSlow6) * fSlow7);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow8);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow8);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9);
|
fRec3[0] = (fSlow0 * fRec3[1]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow10);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9);
|
||||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow10);
|
||||||
fRec6[0] = (fRec6[1] * fSlow0);
|
fRec4[0] = (fTemp0 - ((fRec5[0] * fRec4[1]) + (fRec6[0] * fRec4[2])));
|
||||||
fRec7[0] = ((fRec7[1] * fSlow0) + fSlow11);
|
fRec7[0] = ((fSlow0 * fRec7[1]) + fSlow11);
|
||||||
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
fRec2[0] = (((fRec3[0] * fRec4[1]) + ((fRec4[0] * fRec0[0]) + (fRec7[0] * fRec4[2]))) - ((fRec5[0] * fRec2[1]) + (fRec6[0] * fRec2[2])));
|
||||||
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec3[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec5[0] * fRec1[1]) + (fRec6[0] * fRec1[2])));
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec3[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec4[1] = fRec4[0];
|
|
||||||
fRec5[1] = fRec5[0];
|
|
||||||
fRec3[2] = fRec3[1];
|
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
fRec5[1] = fRec5[0];
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
|
fRec4[2] = fRec4[1];
|
||||||
|
fRec4[1] = fRec4[0];
|
||||||
fRec7[1] = fRec7[0];
|
fRec7[1] = fRec7[0];
|
||||||
fRec2[2] = fRec2[1];
|
fRec2[2] = fRec2[1];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBrf1p_H__
|
#ifndef __faustBrf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBrf1p
|
#define FAUSTCLASS faustBrf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faustBrf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
@ -46,15 +47,13 @@ class faustBrf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -63,14 +62,12 @@ class faustBrf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -79,52 +76,42 @@ class faustBrf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec2[l0] = 0.0;
|
fRec2[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec1[l1] = 0.0;
|
fRec1[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -134,31 +121,27 @@ class faustBrf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (((fConst2 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow1);
|
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[1] + (fRec2[0] * fRec0[0])) + fTemp0));
|
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBrf2p_H__
|
#ifndef __faustBrf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBrf2p
|
#define FAUSTCLASS faustBrf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -48,15 +49,13 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -65,14 +64,12 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -81,57 +78,46 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec1[l2] = 0.0;
|
fRec1[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -141,18 +127,16 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
double fSlow3 = (fSlow2 + 1.0);
|
double fSlow3 = (fSlow2 + 1.0);
|
||||||
|
|
@ -162,20 +146,18 @@ class faustBrf2p : public sfzFilterDsp {
|
||||||
double fSlow7 = ((1.0 / fSlow3) * fSlow4);
|
double fSlow7 = ((1.0 / fSlow3) * fSlow4);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow5);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow5);
|
||||||
double fTemp1 = (fRec0[0] * fRec1[1]);
|
double fTemp1 = (fRec0[0] * fRec1[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow6);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow6);
|
||||||
fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7);
|
||||||
output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustBrf2pSv_H__
|
#ifndef __faustBrf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustBrf2pSv
|
#define FAUSTCLASS faustBrf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -49,15 +50,13 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -66,14 +65,12 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,61 +79,49 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec5[l0] = 0.0;
|
fRec5[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec6[l2] = 0.0;
|
fRec6[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec3[l4] = 0.0;
|
fRec3[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -146,27 +131,25 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow2);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2);
|
||||||
double fTemp1 = (fSlow3 + fRec5[0]);
|
double fTemp1 = (fSlow3 + fRec5[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec5[0] * fTemp1) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec5[0] * fTemp1) + 1.0)));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + (fSlow1 * fTemp1));
|
fRec6[0] = ((fSlow0 * fRec6[1]) + (fSlow1 * fTemp1));
|
||||||
double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||||
double fRec0 = (fRec4[0] * fTemp2);
|
double fRec0 = (fRec4[0] * fTemp2);
|
||||||
double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2);
|
double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2);
|
||||||
|
|
@ -181,9 +164,7 @@ class faustBrf2pSv : public sfzFilterDsp {
|
||||||
fRec6[1] = fRec6[0];
|
fRec6[1] = fRec6[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustEq_H__
|
#ifndef __faustEq_H__
|
||||||
|
|
@ -22,6 +22,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustEq
|
#define FAUSTCLASS faustEq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -31,7 +32,7 @@ class faustEq : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -52,15 +53,13 @@ class faustEq : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -69,14 +68,12 @@ class faustEq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -85,63 +82,51 @@ class faustEq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
fConst3 = (2.1775860903036022 / fConst0);
|
fConst3 = (2.1775860903036022 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fBandwidth = FAUSTFLOAT(1.0);
|
fBandwidth = FAUSTFLOAT(1.0);
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -151,18 +136,16 @@ class faustEq : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
||||||
double fSlow2 = (fConst2 * fSlow1);
|
double fSlow2 = (fConst2 * fSlow1);
|
||||||
double fSlow3 = std::sin(fSlow2);
|
double fSlow3 = std::sin(fSlow2);
|
||||||
|
|
@ -178,12 +161,12 @@ class faustEq : public sfzFilterDsp {
|
||||||
double fSlow13 = (((1.0 - fSlow11) / fSlow7) * fSlow8);
|
double fSlow13 = (((1.0 - fSlow11) / fSlow7) * fSlow8);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow9);
|
||||||
double fTemp1 = (fRec1[0] * fRec0[1]);
|
double fTemp1 = (fRec1[0] * fRec0[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10);
|
||||||
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -191,9 +174,7 @@ class faustEq : public sfzFilterDsp {
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHpf1p_H__
|
#ifndef __faustHpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHpf1p
|
#define FAUSTCLASS faustHpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faustHpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
||||||
|
|
@ -45,15 +46,13 @@ class faustHpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -62,14 +61,12 @@ class faustHpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -78,48 +75,39 @@ class faustHpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -129,30 +117,26 @@ class faustHpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
|
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||||
double fTemp1 = (fRec1[0] + 1.0);
|
double fTemp1 = (fRec1[0] + 1.0);
|
||||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHpf2p_H__
|
#ifndef __faustHpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHpf2p
|
#define FAUSTCLASS faustHpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -49,15 +50,13 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -66,14 +65,12 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,61 +79,49 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec3[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -146,18 +131,16 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -169,11 +152,11 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow7);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow7);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow8);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow8);
|
||||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow9);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow9);
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -181,9 +164,7 @@ class faustHpf2p : public sfzFilterDsp {
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHpf2pSv_H__
|
#ifndef __faustHpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHpf2pSv
|
#define FAUSTCLASS faustHpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -49,15 +50,13 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -66,14 +65,12 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,61 +79,49 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec4[l0] = 0.0;
|
fRec4[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -146,27 +131,25 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow2);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2);
|
||||||
double fTemp1 = (fSlow3 + fRec4[0]);
|
double fTemp1 = (fSlow3 + fRec4[0]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + (fSlow1 / ((fRec4[0] * fTemp1) + 1.0)));
|
fRec3[0] = ((fSlow0 * fRec3[1]) + (fSlow1 / ((fRec4[0] * fTemp1) + 1.0)));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1));
|
||||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fRec0 = (fRec3[0] * fTemp2);
|
double fRec0 = (fRec3[0] * fTemp2);
|
||||||
double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2);
|
double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2);
|
||||||
|
|
@ -180,9 +163,7 @@ class faustHpf2pSv : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHpf4p_H__
|
#ifndef __faustHpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHpf4p
|
#define FAUSTCLASS faustHpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -50,15 +51,13 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -83,65 +80,52 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec1[l5] = 0.0;
|
fRec1[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -151,18 +135,16 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -174,11 +156,11 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow7);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow7);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow8);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow8);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow9);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow9);
|
||||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
@ -189,9 +171,7 @@ class faustHpf4p : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHpf6p_H__
|
#ifndef __faustHpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHpf6p
|
#define FAUSTCLASS faustHpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -51,15 +52,13 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -68,14 +67,12 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -84,69 +81,55 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec6[l4] = 0.0;
|
fRec6[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec2[l5] = 0.0;
|
fRec2[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -156,18 +139,16 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::cos(fSlow1);
|
double fSlow2 = std::cos(fSlow1);
|
||||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||||
|
|
@ -179,11 +160,11 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
double fSlow9 = ((0.5 * ((fSlow2 + 1.0) / fSlow4)) * fSlow5);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((fRec0[1] * fSlow0) + fSlow6);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow6);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow7);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow7);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow8);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow8);
|
||||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow0) + fSlow9);
|
fRec6[0] = ((fSlow0 * fRec6[1]) + fSlow9);
|
||||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
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])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||||
|
|
@ -197,9 +178,7 @@ class faustHpf6p : public sfzFilterDsp {
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustHsh_H__
|
#ifndef __faustHsh_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustHsh
|
#define FAUSTCLASS faustHsh
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,17 +31,17 @@ class faustHsh : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fPkShGain;
|
FAUSTFLOAT fPkShGain;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
FAUSTFLOAT fQ;
|
FAUSTFLOAT fQ;
|
||||||
double fRec1[2];
|
double fRec0[2];
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec0[3];
|
|
||||||
double fRec3[2];
|
double fRec3[2];
|
||||||
|
double fRec1[3];
|
||||||
double fRec4[2];
|
double fRec4[2];
|
||||||
double fRec5[2];
|
double fRec5[2];
|
||||||
|
|
||||||
|
|
@ -51,15 +52,13 @@ class faustHsh : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -68,14 +67,12 @@ class faustHsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -84,66 +81,53 @@ class faustHsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
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)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -153,51 +137,47 @@ class faustHsh : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow3 = std::cos(fSlow2);
|
double fSlow3 = std::cos(fSlow2);
|
||||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||||
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
|
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||||
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
||||||
double fSlow8 = (1.0 - fSlow0);
|
double fSlow8 = (1.0 - fSlow0);
|
||||||
double fSlow9 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
|
||||||
double fSlow10 = (((fSlow1 + (1.0 - (fSlow6 + fSlow5))) / fSlow7) * fSlow8);
|
double fSlow10 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
||||||
double fSlow11 = (fSlow6 + fSlow1);
|
double fSlow11 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
|
||||||
double fSlow12 = (((((fSlow11 + fSlow5) + 1.0) * fSlow1) / fSlow7) * fSlow8);
|
double fSlow12 = (fSlow1 + fSlow6);
|
||||||
double fSlow13 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow4 + fSlow1) + -1.0)) / fSlow7) * fSlow8);
|
double fSlow13 = (((fSlow1 * ((fSlow5 + fSlow12) + 1.0)) / fSlow7) * fSlow8);
|
||||||
double fSlow14 = ((((fSlow11 + (1.0 - fSlow5)) * fSlow1) / fSlow7) * fSlow8);
|
double fSlow14 = (((fSlow1 * (fSlow12 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow9);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow9);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow10);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow10);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + ((fRec1[0] * fRec4[0]) + (fRec5[0] * fRec1[2]))));
|
||||||
fRec1[1] = fRec1[0];
|
|
||||||
fRec2[1] = fRec2[0];
|
|
||||||
fRec0[2] = fRec0[1];
|
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
fRec2[1] = fRec2[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
fRec1[2] = fRec1[1];
|
||||||
|
fRec1[1] = fRec1[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLpf1p_H__
|
#ifndef __faustLpf1p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLpf1p
|
#define FAUSTCLASS faustLpf1p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,11 +31,11 @@ class faustLpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
double fConst2;
|
||||||
double fRec1[2];
|
double fRec1[2];
|
||||||
double fRec0[2];
|
double fRec0[2];
|
||||||
|
|
||||||
|
|
@ -45,15 +46,13 @@ class faustLpf1p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -62,14 +61,12 @@ class faustLpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -78,48 +75,39 @@ class faustLpf1p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = (1.0 / fConst0);
|
||||||
fConst2 = (1.0 / fConst0);
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec0[l1] = 0.0;
|
fRec0[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -129,29 +117,25 @@ class faustLpf1p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow1);
|
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||||
fRec0[0] = ((fRec1[0] * fRec0[1]) + fTemp0);
|
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||||
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
|
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLpf2p_H__
|
#ifndef __faustLpf2p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLpf2p
|
#define FAUSTCLASS faustLpf2p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -49,15 +50,13 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -66,14 +65,12 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,61 +79,49 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec3[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -146,12 +131,10 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -162,7 +145,7 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -170,11 +153,11 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec2[0] = ((fRec2[1] * fSlow5) + fSlow8);
|
fRec2[0] = ((fSlow5 * fRec2[1]) + fSlow8);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow5) + fSlow9);
|
fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow9);
|
||||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow10);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow10);
|
||||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -182,9 +165,7 @@ class faustLpf2p : public sfzFilterDsp {
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLpf2pSv_H__
|
#ifndef __faustLpf2pSv_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLpf2pSv
|
#define FAUSTCLASS faustLpf2pSv
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -49,15 +50,13 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -66,14 +65,12 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -82,61 +79,49 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (3.1415926535897931 / fConst0);
|
fConst2 = (3.1415926535897931 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec3[l0] = 0.0;
|
fRec3[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec1[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec2[l4] = 0.0;
|
fRec2[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -146,27 +131,25 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (1.0 - fSlow0);
|
double fSlow1 = (1.0 - fSlow0);
|
||||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow2);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||||
double fTemp1 = (fSlow3 + fRec3[0]);
|
double fTemp1 = (fSlow3 + fRec3[0]);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0)));
|
fRec4[0] = ((fSlow0 * fRec4[1]) + (fSlow1 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + (fSlow1 * fTemp1));
|
fRec5[0] = ((fSlow0 * fRec5[1]) + (fSlow1 * fTemp1));
|
||||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||||
double fTemp4 = (fRec2[1] + (2.0 * fTemp3));
|
double fTemp4 = (fRec2[1] + (2.0 * fTemp3));
|
||||||
|
|
@ -180,9 +163,7 @@ class faustLpf2pSv : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLpf4p_H__
|
#ifndef __faustLpf4p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLpf4p
|
#define FAUSTCLASS faustLpf4p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -50,15 +51,13 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -83,65 +80,52 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec3[l1] = 0.0;
|
fRec3[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec4[l2] = 0.0;
|
fRec4[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec2[l3] = 0.0;
|
fRec2[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec5[l4] = 0.0;
|
fRec5[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec1[l5] = 0.0;
|
fRec1[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -151,12 +135,10 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -167,7 +149,7 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -175,11 +157,11 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow5) + fSlow8);
|
fRec3[0] = ((fSlow5 * fRec3[1]) + fSlow8);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow9);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow9);
|
||||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||||
fRec5[0] = ((fRec5[1] * fSlow5) + fSlow10);
|
fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow10);
|
||||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
|
@ -190,9 +172,7 @@ class faustLpf4p : public sfzFilterDsp {
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLpf6p_H__
|
#ifndef __faustLpf6p_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLpf6p
|
#define FAUSTCLASS faustLpf6p
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
|
|
@ -51,15 +52,13 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -68,14 +67,12 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -84,69 +81,55 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = (6.2831853071795862 / fConst0);
|
fConst1 = (6.2831853071795862 / fConst0);
|
||||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec4[l1] = 0.0;
|
fRec4[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec5[l2] = 0.0;
|
fRec5[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec6[l4] = 0.0;
|
fRec6[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||||
fRec2[l5] = 0.0;
|
fRec2[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||||
fRec1[l6] = 0.0;
|
fRec1[l6] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -156,12 +139,10 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -172,7 +153,7 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
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 fSlow3 = (fSlow2 + 1.0);
|
||||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||||
double fSlow5 = (fSmoothEnable?fConst2:0.0);
|
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||||
double fSlow6 = (1.0 - fSlow5);
|
double fSlow6 = (1.0 - fSlow5);
|
||||||
double fSlow7 = (fSlow4 * fSlow6);
|
double fSlow7 = (fSlow4 * fSlow6);
|
||||||
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
double fSlow8 = (((0.0 - (2.0 * fSlow1)) / fSlow3) * fSlow6);
|
||||||
|
|
@ -180,11 +161,11 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
double fSlow10 = ((0.5 * fSlow4) * fSlow6);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = (fSlow7 + (fRec0[1] * fSlow5));
|
fRec0[0] = (fSlow7 + (fSlow5 * fRec0[1]));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow5) + fSlow8);
|
fRec4[0] = ((fSlow5 * fRec4[1]) + fSlow8);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow5) + fSlow9);
|
fRec5[0] = ((fSlow5 * fRec5[1]) + fSlow9);
|
||||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||||
fRec6[0] = ((fRec6[1] * fSlow5) + fSlow10);
|
fRec6[0] = ((fSlow5 * fRec6[1]) + fSlow10);
|
||||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
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])));
|
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]))));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||||
|
|
@ -198,9 +179,7 @@ class faustLpf6p : public sfzFilterDsp {
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
fRec1[2] = fRec1[1];
|
fRec1[2] = fRec1[1];
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustLsh_H__
|
#ifndef __faustLsh_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustLsh
|
#define FAUSTCLASS faustLsh
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,17 +31,17 @@ class faustLsh : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
FAUSTFLOAT fPkShGain;
|
FAUSTFLOAT fPkShGain;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
FAUSTFLOAT fCutoff;
|
FAUSTFLOAT fCutoff;
|
||||||
FAUSTFLOAT fQ;
|
FAUSTFLOAT fQ;
|
||||||
double fRec1[2];
|
double fRec0[2];
|
||||||
double fRec2[2];
|
double fRec2[2];
|
||||||
double fRec0[3];
|
|
||||||
double fRec3[2];
|
double fRec3[2];
|
||||||
|
double fRec1[3];
|
||||||
double fRec4[2];
|
double fRec4[2];
|
||||||
double fRec5[2];
|
double fRec5[2];
|
||||||
|
|
||||||
|
|
@ -51,15 +52,13 @@ class faustLsh : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -68,14 +67,12 @@ class faustLsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -84,66 +81,53 @@ class faustLsh : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
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)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec3[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec1[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||||
fRec5[l5] = 0.0;
|
fRec5[l5] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -153,51 +137,47 @@ class faustLsh : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow3 = std::cos(fSlow2);
|
double fSlow3 = std::cos(fSlow2);
|
||||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||||
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
|
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||||
double fSlow6 = (fSlow5 + fSlow1);
|
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||||
double fSlow7 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
double fSlow7 = (fSlow1 + fSlow6);
|
||||||
double fSlow8 = ((fSlow6 + fSlow7) + 1.0);
|
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
|
||||||
double fSlow9 = (1.0 - fSlow0);
|
double fSlow9 = (1.0 - fSlow0);
|
||||||
double fSlow10 = (((0.0 - (2.0 * ((fSlow4 + fSlow1) + -1.0))) / fSlow8) * fSlow9);
|
double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
|
||||||
double fSlow11 = (((fSlow6 + (1.0 - fSlow7)) / fSlow8) * fSlow9);
|
double fSlow11 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
|
||||||
double fSlow12 = (((((fSlow1 + fSlow7) + (1.0 - fSlow5)) * fSlow1) / fSlow8) * fSlow9);
|
double fSlow12 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
|
||||||
double fSlow13 = ((2.0 * (((fSlow1 + (-1.0 - fSlow4)) * fSlow1) / fSlow8)) * fSlow9);
|
double fSlow13 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
|
||||||
double fSlow14 = ((((fSlow1 + (1.0 - (fSlow5 + fSlow7))) * fSlow1) / fSlow8) * fSlow9);
|
double fSlow14 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow10);
|
fRec0[0] = ((fSlow0 * fRec0[1]) + fSlow10);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow11);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow11);
|
||||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow12);
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow12);
|
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow13);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow13);
|
||||||
fRec5[0] = ((fRec5[1] * fSlow0) + fSlow14);
|
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow14);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + ((fRec1[0] * fRec4[0]) + (fRec5[0] * fRec1[2]))));
|
||||||
fRec1[1] = fRec1[0];
|
|
||||||
fRec2[1] = fRec2[0];
|
|
||||||
fRec0[2] = fRec0[1];
|
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
|
fRec2[1] = fRec2[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
|
fRec1[2] = fRec1[1];
|
||||||
|
fRec1[1] = fRec1[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
fRec5[1] = fRec5[0];
|
fRec5[1] = fRec5[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustPeq_H__
|
#ifndef __faustPeq_H__
|
||||||
|
|
@ -21,6 +21,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustPeq
|
#define FAUSTCLASS faustPeq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustPeq : public sfzFilterDsp {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
double fConst0;
|
double fConst0;
|
||||||
double fConst1;
|
double fConst1;
|
||||||
double fConst2;
|
double fConst2;
|
||||||
|
|
@ -50,15 +51,13 @@ class faustPeq : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -67,14 +66,12 @@ class faustPeq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -83,62 +80,50 @@ class faustPeq : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSamplingFreq)));
|
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||||
fConst2 = (6.2831853071795862 / fConst0);
|
fConst2 = (6.2831853071795862 / fConst0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
fCutoff = FAUSTFLOAT(440.0);
|
fCutoff = FAUSTFLOAT(440.0);
|
||||||
fQ = FAUSTFLOAT(0.0);
|
fQ = FAUSTFLOAT(0.0);
|
||||||
fPkShGain = FAUSTFLOAT(0.0);
|
fPkShGain = FAUSTFLOAT(0.0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||||
fRec1[l0] = 0.0;
|
fRec1[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||||
fRec2[l1] = 0.0;
|
fRec2[l1] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||||
fRec0[l2] = 0.0;
|
fRec0[l2] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||||
fRec3[l3] = 0.0;
|
fRec3[l3] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||||
fRec4[l4] = 0.0;
|
fRec4[l4] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -148,18 +133,16 @@ class faustPeq : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
FAUSTFLOAT* input0 = inputs[0];
|
FAUSTFLOAT* input0 = inputs[0];
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
double fSlow0 = (fSmoothEnable?fConst1:0.0);
|
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||||
double fSlow2 = std::sin(fSlow1);
|
double fSlow2 = std::sin(fSlow1);
|
||||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||||
|
|
@ -174,12 +157,12 @@ class faustPeq : public sfzFilterDsp {
|
||||||
double fSlow12 = (((1.0 - fSlow10) / fSlow6) * fSlow7);
|
double fSlow12 = (((1.0 - fSlow10) / fSlow6) * fSlow7);
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec1[0] = ((fRec1[1] * fSlow0) + fSlow8);
|
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow8);
|
||||||
double fTemp1 = (fRec1[0] * fRec0[1]);
|
double fTemp1 = (fRec1[0] * fRec0[1]);
|
||||||
fRec2[0] = ((fRec2[1] * fSlow0) + fSlow9);
|
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow9);
|
||||||
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
||||||
fRec3[0] = ((fRec3[1] * fSlow0) + fSlow11);
|
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow11);
|
||||||
fRec4[0] = ((fRec4[1] * fSlow0) + fSlow12);
|
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow12);
|
||||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
||||||
fRec1[1] = fRec1[0];
|
fRec1[1] = fRec1[0];
|
||||||
fRec2[1] = fRec2[0];
|
fRec2[1] = fRec2[0];
|
||||||
|
|
@ -187,9 +170,7 @@ class faustPeq : public sfzFilterDsp {
|
||||||
fRec0[1] = fRec0[0];
|
fRec0[1] = fRec0[0];
|
||||||
fRec3[1] = fRec3[0];
|
fRec3[1] = fRec3[0];
|
||||||
fRec4[1] = fRec4[0];
|
fRec4[1] = fRec4[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
author: "Jean Pierre Cimalando"
|
author: "Jean Pierre Cimalando"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
name: "sfz_filters"
|
name: "sfz_filters"
|
||||||
Code generated with Faust 2.15.11 (https://faust.grame.fr)
|
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||||
Compilation options: -inpl -double -ftz 0
|
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||||
------------------------------------------------------------ */
|
------------------------------------------------------------ */
|
||||||
|
|
||||||
#ifndef __faustPink_H__
|
#ifndef __faustPink_H__
|
||||||
|
|
@ -20,6 +20,7 @@ Compilation options: -inpl -double -ftz 0
|
||||||
#ifndef FAUSTCLASS
|
#ifndef FAUSTCLASS
|
||||||
#define FAUSTCLASS faustPink
|
#define FAUSTCLASS faustPink
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#define exp10f __exp10f
|
#define exp10f __exp10f
|
||||||
#define exp10 __exp10
|
#define exp10 __exp10
|
||||||
|
|
@ -30,7 +31,7 @@ class faustPink : public sfzFilterDsp {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
double fRec0[4];
|
double fRec0[4];
|
||||||
int fSamplingFreq;
|
int fSampleRate;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
@ -39,15 +40,13 @@ class faustPink : public sfzFilterDsp {
|
||||||
|
|
||||||
virtual int getNumInputs() {
|
virtual int getNumInputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getNumOutputs() {
|
virtual int getNumOutputs() {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getInputRate(int channel) {
|
virtual int getInputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -56,14 +55,12 @@ class faustPink : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
virtual int getOutputRate(int channel) {
|
virtual int getOutputRate(int channel) {
|
||||||
int rate;
|
int rate;
|
||||||
switch (channel) {
|
switch ((channel)) {
|
||||||
case 0: {
|
case 0: {
|
||||||
rate = 1;
|
rate = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,40 +69,32 @@ class faustPink : public sfzFilterDsp {
|
||||||
rate = -1;
|
rate = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void classInit(int samplingFreq) {
|
static void classInit(int sample_rate) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceConstants(int samplingFreq) {
|
virtual void instanceConstants(int sample_rate) {
|
||||||
fSamplingFreq = samplingFreq;
|
fSampleRate = sample_rate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceResetUserInterface() {
|
virtual void instanceResetUserInterface() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instanceClear() {
|
virtual void instanceClear() {
|
||||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||||
fRec0[l0] = 0.0;
|
fRec0[l0] = 0.0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void init(int samplingFreq) {
|
virtual void init(int sample_rate) {
|
||||||
classInit(samplingFreq);
|
classInit(sample_rate);
|
||||||
instanceInit(samplingFreq);
|
instanceInit(sample_rate);
|
||||||
}
|
}
|
||||||
|
virtual void instanceInit(int sample_rate) {
|
||||||
virtual void instanceInit(int samplingFreq) {
|
instanceConstants(sample_rate);
|
||||||
instanceConstants(samplingFreq);
|
|
||||||
instanceResetUserInterface();
|
instanceResetUserInterface();
|
||||||
instanceClear();
|
instanceClear();
|
||||||
}
|
}
|
||||||
|
|
@ -115,12 +104,10 @@ class faustPink : public sfzFilterDsp {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int getSampleRate() {
|
virtual int getSampleRate() {
|
||||||
return fSamplingFreq;
|
return fSampleRate;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void buildUserInterface(UI* ui_interface) {
|
virtual void buildUserInterface(UI* ui_interface) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||||
|
|
@ -128,15 +115,12 @@ class faustPink : public sfzFilterDsp {
|
||||||
FAUSTFLOAT* output0 = outputs[0];
|
FAUSTFLOAT* output0 = outputs[0];
|
||||||
for (int i = 0; (i < count); i = (i + 1)) {
|
for (int i = 0; (i < count); i = (i + 1)) {
|
||||||
double fTemp0 = double(input0[i]);
|
double fTemp0 = double(input0[i]);
|
||||||
fRec0[0] = ((((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3])) + fTemp0) - (2.0172658750000001 * fRec0[2]));
|
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
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)) {
|
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||||
fRec0[j0] = fRec0[(j0 - 1)];
|
fRec0[j0] = fRec0[(j0 - 1)];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue