Add the generated source of faust filters
This commit is contained in:
parent
ac4dfff729
commit
ba969158ed
46 changed files with 8107 additions and 0 deletions
156
src/sfizz/gen/filters/sfz2chApf1p.cxx
Normal file
156
src/sfizz/gen/filters/sfz2chApf1p.cxx
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chApf1p_H__
|
||||
#define __faust2chApf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chApf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chApf1p* clone() {
|
||||
return new faust2chApf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT((fRec2[1] + (fRec1[0] * fRec2[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
171
src/sfizz/gen/filters/sfz2chBpf1p.cxx
Normal file
171
src/sfizz/gen/filters/sfz2chBpf1p.cxx
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf1p_H__
|
||||
#define __faust2chBpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec4[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf1p* clone() {
|
||||
return new faust2chBpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
double fTemp2 = (1.0 - fRec2[0]);
|
||||
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
|
||||
double fTemp3 = (fRec2[0] + 1.0);
|
||||
double fTemp4 = (0.0 - (0.5 * fTemp3));
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp3)) + (fRec0[1] * fTemp4)));
|
||||
fRec4[0] = (fTemp1 + (fRec2[0] * fRec4[1]));
|
||||
fRec3[0] = ((fRec4[0] * fTemp2) + (fRec2[0] * fRec3[1]));
|
||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec3[0] * fTemp3)) + (fTemp4 * fRec3[1])));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
193
src/sfizz/gen/filters/sfz2chBpf2p.cxx
Normal file
193
src/sfizz/gen/filters/sfz2chBpf2p.cxx
Normal file
|
|
@ -0,0 +1,193 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2p_H__
|
||||
#define __faust2chBpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf2p* clone() {
|
||||
return new faust2chBpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow7);
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (0.999 * fRec4[1]);
|
||||
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
203
src/sfizz/gen/filters/sfz2chBpf2pSv.cxx
Normal file
203
src/sfizz/gen/filters/sfz2chBpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2pSv_H__
|
||||
#define __faust2chBpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec6[2];
|
||||
double fRec8[2];
|
||||
double fRec9[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf2pSv* clone() {
|
||||
return new faust2chBpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
|
||||
double fSlow2 = (1.0 / fSlow1);
|
||||
double fSlow3 = (0.0010000000000000009 / fSlow1);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp2 = (fSlow2 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp5 = (fTemp3 * fTemp4);
|
||||
double fTemp6 = (fRec2[1] + fTemp5);
|
||||
double fRec0 = fTemp6;
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp6)));
|
||||
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
||||
fRec2[0] = fTemp7;
|
||||
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||
double fTemp8 = (fTemp1 - (fRec8[1] + (fRec5[0] * fRec9[1])));
|
||||
double fTemp9 = (fTemp3 * fTemp8);
|
||||
double fTemp10 = (fRec9[1] + fTemp9);
|
||||
double fRec7 = fTemp10;
|
||||
fRec8[0] = (fRec8[1] + (2.0 * (fRec3[0] * fTemp10)));
|
||||
double fTemp11 = (fRec9[1] + (2.0 * fTemp9));
|
||||
fRec9[0] = fTemp11;
|
||||
output1[i] = FAUSTFLOAT((fRec6[0] * fRec7));
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
207
src/sfizz/gen/filters/sfz2chBpf4p.cxx
Normal file
207
src/sfizz/gen/filters/sfz2chBpf4p.cxx
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf4p_H__
|
||||
#define __faust2chBpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec6[2];
|
||||
double fRec1[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec8[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec7[l8] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf4p* clone() {
|
||||
return new faust2chBpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (0.999 * fRec5[1]);
|
||||
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
|
||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
|
||||
fRec8[0] = (fTemp1 - ((fRec3[0] * fRec8[1]) + (fRec4[0] * fRec8[2])));
|
||||
fRec7[0] = ((((fRec0[0] * fRec8[0]) + (fRec5[0] * fRec8[1])) + (fRec6[0] * fRec8[2])) - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec7[0]) + (fRec5[0] * fRec7[1])) + (fRec6[0] * fRec7[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
221
src/sfizz/gen/filters/sfz2chBpf6p.cxx
Normal file
221
src/sfizz/gen/filters/sfz2chBpf6p.cxx
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf6p_H__
|
||||
#define __faust2chBpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec7[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec10[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec2[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec1[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec10[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec9[l9] = 0.0;
|
||||
}
|
||||
for (int l10 = 0; (l10 < 3); l10 = (l10 + 1)) {
|
||||
fRec8[l10] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBpf6p* clone() {
|
||||
return new faust2chBpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (0.999 * fRec6[1]);
|
||||
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
|
||||
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||
fRec10[0] = (fTemp1 - ((fRec4[0] * fRec10[1]) + (fRec5[0] * fRec10[2])));
|
||||
fRec9[0] = ((((fRec0[0] * fRec10[0]) + (fRec6[0] * fRec10[1])) + (fRec7[0] * fRec10[2])) - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = ((((fRec0[0] * fRec9[0]) + (fRec6[0] * fRec9[1])) + (fRec7[0] * fRec9[2])) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec0[0] * fRec8[0]) + (fRec6[0] * fRec8[1])) + (fRec7[0] * fRec8[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec10[2] = fRec10[1];
|
||||
fRec10[1] = fRec10[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
168
src/sfizz/gen/filters/sfz2chBrf1p.cxx
Normal file
168
src/sfizz/gen/filters/sfz2chBrf1p.cxx
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf1p_H__
|
||||
#define __faust2chBrf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec4[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf1p* clone() {
|
||||
return new faust2chBrf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
fRec4[0] = (fTemp1 - (fRec2[0] * fRec4[1]));
|
||||
fRec3[0] = (fRec4[1] + (fRec2[0] * (fRec4[0] - fRec3[1])));
|
||||
output1[i] = FAUSTFLOAT((fTemp1 + (fRec3[1] + (fRec2[0] * fRec3[0]))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfz2chBrf2p.cxx
Normal file
179
src/sfizz/gen/filters/sfz2chBrf2p.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2p_H__
|
||||
#define __faust2chBrf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec1[3];
|
||||
double fRec3[2];
|
||||
double fRec4[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec1[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 3); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf2p* clone() {
|
||||
return new faust2chBrf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow2 = (fSlow1 + 1.0);
|
||||
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
|
||||
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
|
||||
double fSlow5 = (0.0010000000000000009 / fSlow2);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
|
||||
double fTemp2 = (fRec0[0] * fRec1[1]);
|
||||
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec1[2])));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
output0[i] = FAUSTFLOAT((fTemp2 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||
double fTemp3 = (fRec0[0] * fRec4[1]);
|
||||
fRec4[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec4[2])));
|
||||
output1[i] = FAUSTFLOAT((fTemp3 + (fRec3[0] * (fRec4[0] + fRec4[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[2] = fRec4[1];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
197
src/sfizz/gen/filters/sfz2chBrf2pSv.cxx
Normal file
197
src/sfizz/gen/filters/sfz2chBrf2pSv.cxx
Normal file
|
|
@ -0,0 +1,197 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2pSv_H__
|
||||
#define __faust2chBrf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chBrf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec9[2];
|
||||
double fRec10[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec6[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec9[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec10[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chBrf2pSv* clone() {
|
||||
return new faust2chBrf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
|
||||
double fTemp2 = (fSlow1 + fRec5[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp2) + 1.0)));
|
||||
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp3 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||
double fRec0 = (fRec4[0] * fTemp3);
|
||||
double fTemp4 = (fRec5[0] * fRec4[0]);
|
||||
double fTemp5 = (fTemp4 * fTemp3);
|
||||
double fTemp6 = (fRec3[1] + (2.0 * fTemp5));
|
||||
double fRec1 = (fRec2[1] + (fRec5[0] * fTemp6));
|
||||
double fTemp7 = (fRec3[1] + fTemp5);
|
||||
fRec2[0] = (fRec2[1] + (2.0 * (fRec5[0] * fTemp7)));
|
||||
fRec3[0] = fTemp6;
|
||||
output0[i] = FAUSTFLOAT((fRec1 + fRec0));
|
||||
double fTemp8 = (fTemp1 - (fRec9[1] + (fRec6[0] * fRec10[1])));
|
||||
double fRec7 = (fRec4[0] * fTemp8);
|
||||
double fTemp9 = (fTemp4 * fTemp8);
|
||||
double fTemp10 = (fRec10[1] + (2.0 * fTemp9));
|
||||
double fRec8 = (fRec9[1] + (fRec5[0] * fTemp10));
|
||||
double fTemp11 = (fRec10[1] + fTemp9);
|
||||
fRec9[0] = (fRec9[1] + (2.0 * (fRec5[0] * fTemp11)));
|
||||
fRec10[0] = fTemp10;
|
||||
output1[i] = FAUSTFLOAT((fRec8 + fRec7));
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec10[1] = fRec10[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
158
src/sfizz/gen/filters/sfz2chHpf1p.cxx
Normal file
158
src/sfizz/gen/filters/sfz2chHpf1p.cxx
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf1p_H__
|
||||
#define __faust2chHpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf1p* clone() {
|
||||
return new faust2chHpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (fRec1[0] + 1.0);
|
||||
double fTemp3 = (0.0 - (0.5 * fTemp2));
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp2)) + (fRec0[1] * fTemp3)));
|
||||
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT(((0.5 * (fRec2[0] * fTemp2)) + (fTemp3 * fRec2[1])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
185
src/sfizz/gen/filters/sfz2chHpf2p.cxx
Normal file
185
src/sfizz/gen/filters/sfz2chHpf2p.cxx
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2p_H__
|
||||
#define __faust2chHpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf2p* clone() {
|
||||
return new faust2chHpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
195
src/sfizz/gen/filters/sfz2chHpf2pSv.cxx
Normal file
195
src/sfizz/gen/filters/sfz2chHpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2pSv_H__
|
||||
#define __faust2chHpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf2pSv* clone() {
|
||||
return new faust2chHpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
|
||||
double fTemp2 = (fSlow1 + fRec4[0]);
|
||||
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp2) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp3 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fRec0 = (fRec3[0] * fTemp3);
|
||||
double fTemp4 = (fRec4[0] * fRec3[0]);
|
||||
double fTemp5 = (fTemp4 * fTemp3);
|
||||
double fTemp6 = (fRec2[1] + fTemp5);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec4[0] * fTemp6)));
|
||||
double fTemp7 = (fRec2[1] + (2.0 * fTemp5));
|
||||
fRec2[0] = fTemp7;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
double fTemp8 = (fTemp1 - (fRec7[1] + (fRec5[0] * fRec8[1])));
|
||||
double fRec6 = (fRec3[0] * fTemp8);
|
||||
double fTemp9 = (fTemp4 * fTemp8);
|
||||
double fTemp10 = (fRec8[1] + fTemp9);
|
||||
fRec7[0] = (fRec7[1] + (2.0 * (fRec4[0] * fTemp10)));
|
||||
double fTemp11 = (fRec8[1] + (2.0 * fTemp9));
|
||||
fRec8[0] = fTemp11;
|
||||
output1[i] = FAUSTFLOAT(fRec6);
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
199
src/sfizz/gen/filters/sfz2chHpf4p.cxx
Normal file
199
src/sfizz/gen/filters/sfz2chHpf4p.cxx
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf4p_H__
|
||||
#define __faust2chHpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
double fRec7[3];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec7[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec6[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf4p* clone() {
|
||||
return new faust2chHpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
fRec6[0] = (((fRec0[0] * fRec7[1]) + (fRec5[0] * (fRec7[0] + fRec7[2]))) - ((fRec3[0] * fRec6[1]) + (fRec4[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec6[1]) + (fRec5[0] * (fRec6[0] + fRec6[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
213
src/sfizz/gen/filters/sfz2chHpf6p.cxx
Normal file
213
src/sfizz/gen/filters/sfz2chHpf6p.cxx
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf6p_H__
|
||||
#define __faust2chHpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec8[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec7[l9] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHpf6p* clone() {
|
||||
return new faust2chHpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec9[0] = (fTemp1 - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = (((fRec0[0] * fRec9[1]) + (fRec6[0] * (fRec9[0] + fRec9[2]))) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
fRec7[0] = (((fRec0[0] * fRec8[1]) + (fRec6[0] * (fRec8[0] + fRec8[2]))) - ((fRec4[0] * fRec7[1]) + (fRec5[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec7[1]) + (fRec6[0] * (fRec7[0] + fRec7[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
198
src/sfizz/gen/filters/sfz2chHsh.cxx
Normal file
198
src/sfizz/gen/filters/sfz2chHsh.cxx
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHsh_H__
|
||||
#define __faust2chHsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chHsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chHsh* clone() {
|
||||
return new faust2chHsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
|
||||
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
|
||||
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
|
||||
double fSlow9 = (fSlow0 + fSlow5);
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
|
||||
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
157
src/sfizz/gen/filters/sfz2chLpf1p.cxx
Normal file
157
src/sfizz/gen/filters/sfz2chLpf1p.cxx
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf1p_H__
|
||||
#define __faust2chLpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf1p* clone() {
|
||||
return new faust2chLpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (1.0 - fRec1[0]);
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
|
||||
fRec2[0] = (fTemp1 + (fRec1[0] * fRec2[1]));
|
||||
output1[i] = FAUSTFLOAT((fRec2[0] * fTemp2));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
186
src/sfizz/gen/filters/sfz2chLpf2p.cxx
Normal file
186
src/sfizz/gen/filters/sfz2chLpf2p.cxx
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2p_H__
|
||||
#define __faust2chLpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf2p* clone() {
|
||||
return new faust2chLpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec5[0] = (fTemp1 - ((fRec2[0] * fRec5[1]) + (fRec3[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec5[1]) + (fRec4[0] * (fRec5[0] + fRec5[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
195
src/sfizz/gen/filters/sfz2chLpf2pSv.cxx
Normal file
195
src/sfizz/gen/filters/sfz2chLpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2pSv_H__
|
||||
#define __faust2chLpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf2pSv* clone() {
|
||||
return new faust2chLpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp2 = (fSlow1 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp2) + 1.0)));
|
||||
double fTemp3 = (fRec3[0] * fRec4[0]);
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp2));
|
||||
double fTemp4 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp5 = (fTemp3 * fTemp4);
|
||||
double fTemp6 = (fRec2[1] + (2.0 * fTemp5));
|
||||
double fRec0 = (fRec1[1] + (fRec3[0] * fTemp6));
|
||||
double fTemp7 = (fRec2[1] + fTemp5);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp7)));
|
||||
fRec2[0] = fTemp6;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
double fTemp8 = (fTemp1 - (fRec7[1] + (fRec5[0] * fRec8[1])));
|
||||
double fTemp9 = (fTemp3 * fTemp8);
|
||||
double fTemp10 = (fRec8[1] + (2.0 * fTemp9));
|
||||
double fRec6 = (fRec7[1] + (fRec3[0] * fTemp10));
|
||||
double fTemp11 = (fRec8[1] + fTemp9);
|
||||
fRec7[0] = (fRec7[1] + (2.0 * (fRec3[0] * fTemp11)));
|
||||
fRec8[0] = fTemp10;
|
||||
output1[i] = FAUSTFLOAT(fRec6);
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
200
src/sfizz/gen/filters/sfz2chLpf4p.cxx
Normal file
200
src/sfizz/gen/filters/sfz2chLpf4p.cxx
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf4p_H__
|
||||
#define __faust2chLpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
double fRec7[3];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec7[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec6[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf4p* clone() {
|
||||
return new faust2chLpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec7[0] = (fTemp1 - ((fRec3[0] * fRec7[1]) + (fRec4[0] * fRec7[2])));
|
||||
fRec6[0] = (((fRec0[0] * fRec7[1]) + (fRec5[0] * (fRec7[0] + fRec7[2]))) - ((fRec3[0] * fRec6[1]) + (fRec4[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec6[1]) + (fRec5[0] * (fRec6[0] + fRec6[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
214
src/sfizz/gen/filters/sfz2chLpf6p.cxx
Normal file
214
src/sfizz/gen/filters/sfz2chLpf6p.cxx
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf6p_H__
|
||||
#define __faust2chLpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
double fRec9[3];
|
||||
double fRec8[3];
|
||||
double fRec7[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec9[l7] = 0.0;
|
||||
}
|
||||
for (int l8 = 0; (l8 < 3); l8 = (l8 + 1)) {
|
||||
fRec8[l8] = 0.0;
|
||||
}
|
||||
for (int l9 = 0; (l9 < 3); l9 = (l9 + 1)) {
|
||||
fRec7[l9] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLpf6p* clone() {
|
||||
return new faust2chLpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec9[0] = (fTemp1 - ((fRec4[0] * fRec9[1]) + (fRec5[0] * fRec9[2])));
|
||||
fRec8[0] = (((fRec0[0] * fRec9[1]) + (fRec6[0] * (fRec9[0] + fRec9[2]))) - ((fRec4[0] * fRec8[1]) + (fRec5[0] * fRec8[2])));
|
||||
fRec7[0] = (((fRec0[0] * fRec8[1]) + (fRec6[0] * (fRec8[0] + fRec8[2]))) - ((fRec4[0] * fRec7[1]) + (fRec5[0] * fRec7[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec0[0] * fRec7[1]) + (fRec6[0] * (fRec7[0] + fRec7[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec9[2] = fRec9[1];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec8[2] = fRec8[1];
|
||||
fRec8[1] = fRec8[0];
|
||||
fRec7[2] = fRec7[1];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
198
src/sfizz/gen/filters/sfz2chLsh.cxx
Normal file
198
src/sfizz/gen/filters/sfz2chLsh.cxx
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLsh_H__
|
||||
#define __faust2chLsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chLsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec6[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec6[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chLsh* clone() {
|
||||
return new faust2chLsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = (fSlow0 + fSlow5);
|
||||
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
|
||||
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
|
||||
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec6[0] = (fTemp1 - ((fRec1[0] * fRec6[1]) + (fRec2[0] * fRec6[2])));
|
||||
output1[i] = FAUSTFLOAT((((fRec3[0] * fRec6[0]) + (fRec4[0] * fRec6[1])) + (fRec5[0] * fRec6[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[2] = fRec6[1];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
192
src/sfizz/gen/filters/sfz2chPeq.cxx
Normal file
192
src/sfizz/gen/filters/sfz2chPeq.cxx
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPeq_H__
|
||||
#define __faust2chPeq_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chPeq : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chPeq* clone() {
|
||||
return new faust2chPeq();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
|
||||
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
|
||||
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
|
||||
double fTemp2 = (fRec1[0] * fRec0[1]);
|
||||
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - (fTemp2 + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp2) + (fRec4[0] * fRec0[2])));
|
||||
double fTemp3 = (fRec1[0] * fRec5[1]);
|
||||
fRec5[0] = (fTemp1 - (fTemp3 + (fRec2[0] * fRec5[2])));
|
||||
output1[i] = FAUSTFLOAT(((fRec3[0] * fRec5[0]) + (fTemp3 + (fRec4[0] * fRec5[2]))));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[2] = fRec5[1];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
148
src/sfizz/gen/filters/sfz2chPink.cxx
Normal file
148
src/sfizz/gen/filters/sfz2chPink.cxx
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPink_H__
|
||||
#define __faust2chPink_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faust2chPink : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
double fRec0[4];
|
||||
double fRec1[4];
|
||||
int fSampleRate;
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faust2chPink* clone() {
|
||||
return new faust2chPink();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
||||
fRec1[0] = ((fTemp1 + ((2.4949560019999999 * fRec1[1]) + (0.52218940000000003 * fRec1[3]))) - (2.0172658750000001 * fRec1[2]));
|
||||
output1[i] = FAUSTFLOAT((((0.049922034999999997 * fRec1[0]) + (0.050612698999999997 * fRec1[2])) - ((0.095993537000000004 * fRec1[1]) + (0.0044087859999999996 * fRec1[3]))));
|
||||
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||
fRec0[j0] = fRec0[(j0 - 1)];
|
||||
}
|
||||
for (int j1 = 3; (j1 > 0); j1 = (j1 - 1)) {
|
||||
fRec1[j1] = fRec1[(j1 - 1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
138
src/sfizz/gen/filters/sfzApf1p.cxx
Normal file
138
src/sfizz/gen/filters/sfzApf1p.cxx
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustApf1p_H__
|
||||
#define __faustApf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustApf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustApf1p* clone() {
|
||||
return new faustApf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
145
src/sfizz/gen/filters/sfzBpf1p.cxx
Normal file
145
src/sfizz/gen/filters/sfzBpf1p.cxx
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf1p_H__
|
||||
#define __faustBpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf1p* clone() {
|
||||
return new faustBpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec2[0] + 1.0);
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
174
src/sfizz/gen/filters/sfzBpf2p.cxx
Normal file
174
src/sfizz/gen/filters/sfzBpf2p.cxx
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2p_H__
|
||||
#define __faustBpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf2p* clone() {
|
||||
return new faustBpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow7 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow7);
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow7)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow5 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow8 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (0.999 * fRec4[1]);
|
||||
fRec5[0] = (fSlow9 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
173
src/sfizz/gen/filters/sfzBpf2pSv.cxx
Normal file
173
src/sfizz/gen/filters/sfzBpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2pSv_H__
|
||||
#define __faustBpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec6[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf2pSv* clone() {
|
||||
return new faustBpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = std::pow(10.0, (0.050000000000000003 * double(fQ)));
|
||||
double fSlow2 = (1.0 / fSlow1);
|
||||
double fSlow3 = (0.0010000000000000009 / fSlow1);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp1 = (fSlow2 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + fTemp3);
|
||||
double fRec0 = fTemp4;
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp4)));
|
||||
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
||||
fRec2[0] = fTemp5;
|
||||
fRec6[0] = (fSlow3 + (0.999 * fRec6[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0 * fRec6[0]));
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
181
src/sfizz/gen/filters/sfzBpf4p.cxx
Normal file
181
src/sfizz/gen/filters/sfzBpf4p.cxx
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf4p_H__
|
||||
#define __faustBpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec6[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec6[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf4p* clone() {
|
||||
return new faustBpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (0.999 * fRec5[1]);
|
||||
fRec6[0] = (fSlow9 + (0.999 * fRec6[1]));
|
||||
fRec1[0] = ((((fRec2[0] * fRec0[0]) + (fRec5[0] * fRec2[1])) + (fRec6[0] * fRec2[2])) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec5[0] * fRec1[1])) + (fRec6[0] * fRec1[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
188
src/sfizz/gen/filters/sfzBpf6p.cxx
Normal file
188
src/sfizz/gen/filters/sfzBpf6p.cxx
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf6p_H__
|
||||
#define __faustBpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec7[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec7[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec2[l6] = 0.0;
|
||||
}
|
||||
for (int l7 = 0; (l7 < 3); l7 = (l7 + 1)) {
|
||||
fRec1[l7] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBpf6p* clone() {
|
||||
return new faustBpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = (0.5 * (fSlow1 / fSlow2));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (fSlow1 / (fSlow2 * fSlow4));
|
||||
double fSlow6 = (0.00050000000000000044 * fSlow5);
|
||||
double fSlow7 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow4));
|
||||
double fSlow8 = (0.0010000000000000009 * ((1.0 - fSlow3) / fSlow4));
|
||||
double fSlow9 = (0.0010000000000000009 * (0.0 - (0.5 * fSlow5)));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow6 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (0.999 * fRec6[1]);
|
||||
fRec7[0] = (fSlow9 + (0.999 * fRec7[1]));
|
||||
fRec2[0] = ((((fRec3[0] * fRec0[0]) + (fRec6[0] * fRec3[1])) + (fRec7[0] * fRec3[2])) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = ((((fRec0[0] * fRec2[0]) + (fRec6[0] * fRec2[1])) + (fRec7[0] * fRec2[2])) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec1[0]) + (fRec6[0] * fRec1[1])) + (fRec7[0] * fRec1[2])));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
144
src/sfizz/gen/filters/sfzBrf1p.cxx
Normal file
144
src/sfizz/gen/filters/sfzBrf1p.cxx
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf1p_H__
|
||||
#define __faustBrf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf1p* clone() {
|
||||
return new faustBrf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * ((fConst0 * double(fCutoff)) + -1.0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow0 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
159
src/sfizz/gen/filters/sfzBrf2p.cxx
Normal file
159
src/sfizz/gen/filters/sfzBrf2p.cxx
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2p_H__
|
||||
#define __faustBrf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec1[3];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec1[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf2p* clone() {
|
||||
return new faustBrf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow2 = (fSlow1 + 1.0);
|
||||
double fSlow3 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow2));
|
||||
double fSlow4 = (0.0010000000000000009 * ((1.0 - fSlow1) / fSlow2));
|
||||
double fSlow5 = (0.0010000000000000009 / fSlow2);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow3 + (0.999 * fRec0[1]));
|
||||
double fTemp1 = (fRec0[0] * fRec1[1]);
|
||||
fRec2[0] = (fSlow4 + (0.999 * fRec2[1]));
|
||||
fRec1[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec1[2])));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
output0[i] = FAUSTFLOAT((fTemp1 + (fRec3[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
166
src/sfizz/gen/filters/sfzBrf2pSv.cxx
Normal file
166
src/sfizz/gen/filters/sfzBrf2pSv.cxx
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2pSv_H__
|
||||
#define __faustBrf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustBrf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec6[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustBrf2pSv* clone() {
|
||||
return new faustBrf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec5[0] = (fSlow0 + (0.999 * fRec5[1]));
|
||||
double fTemp1 = (fSlow1 + fRec5[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec5[0] * fTemp1) + 1.0)));
|
||||
fRec6[0] = ((0.999 * fRec6[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec2[1] + (fRec6[0] * fRec3[1])));
|
||||
double fRec0 = (fRec4[0] * fTemp2);
|
||||
double fTemp3 = ((fRec5[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec3[1] + (2.0 * fTemp3));
|
||||
double fRec1 = (fRec2[1] + (fRec5[0] * fTemp4));
|
||||
double fTemp5 = (fRec3[1] + fTemp3);
|
||||
fRec2[0] = (fRec2[1] + (2.0 * (fRec5[0] * fTemp5)));
|
||||
fRec3[0] = fTemp4;
|
||||
output0[i] = FAUSTFLOAT((fRec1 + fRec0));
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
139
src/sfizz/gen/filters/sfzHpf1p.cxx
Normal file
139
src/sfizz/gen/filters/sfzHpf1p.cxx
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf1p_H__
|
||||
#define __faustHpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf1p* clone() {
|
||||
return new faustHpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec1[0] + 1.0);
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
166
src/sfizz/gen/filters/sfzHpf2p.cxx
Normal file
166
src/sfizz/gen/filters/sfzHpf2p.cxx
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2p_H__
|
||||
#define __faustHpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf2p* clone() {
|
||||
return new faustHpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow5 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
165
src/sfizz/gen/filters/sfzHpf2pSv.cxx
Normal file
165
src/sfizz/gen/filters/sfzHpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2pSv_H__
|
||||
#define __faustHpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf2pSv* clone() {
|
||||
return new faustHpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec4[0] = (fSlow0 + (0.999 * fRec4[1]));
|
||||
double fTemp1 = (fSlow1 + fRec4[0]);
|
||||
fRec3[0] = ((0.999 * fRec3[1]) + (0.0010000000000000009 / ((fRec4[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fRec0 = (fRec3[0] * fTemp2);
|
||||
double fTemp3 = ((fRec4[0] * fRec3[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + fTemp3);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec4[0] * fTemp4)));
|
||||
double fTemp5 = (fRec2[1] + (2.0 * fTemp3));
|
||||
fRec2[0] = fTemp5;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
173
src/sfizz/gen/filters/sfzHpf4p.cxx
Normal file
173
src/sfizz/gen/filters/sfzHpf4p.cxx
Normal file
|
|
@ -0,0 +1,173 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf4p_H__
|
||||
#define __faustHpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf4p* clone() {
|
||||
return new faustHpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow5 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
180
src/sfizz/gen/filters/sfzHpf6p.cxx
Normal file
180
src/sfizz/gen/filters/sfzHpf6p.cxx
Normal file
|
|
@ -0,0 +1,180 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf6p_H__
|
||||
#define __faustHpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHpf6p* clone() {
|
||||
return new faustHpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (0.0010000000000000009 * ((-1.0 - fSlow1) / fSlow3));
|
||||
double fSlow5 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow6 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow7 = (0.00050000000000000044 * ((fSlow1 + 1.0) / fSlow3));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow4 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow5 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow6 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow7 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfzHsh.cxx
Normal file
179
src/sfizz/gen/filters/sfzHsh.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHsh_H__
|
||||
#define __faustHsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustHsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustHsh* clone() {
|
||||
return new faustHsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = ((fSlow0 + fSlow4) + (1.0 - fSlow5));
|
||||
double fSlow7 = (0.0020000000000000018 * ((fSlow0 + (-1.0 - fSlow3)) / fSlow6));
|
||||
double fSlow8 = (0.0010000000000000009 * ((fSlow0 + (1.0 - (fSlow4 + fSlow5))) / fSlow6));
|
||||
double fSlow9 = (fSlow0 + fSlow5);
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow4 + fSlow9) + 1.0)) / fSlow6));
|
||||
double fSlow11 = (0.0010000000000000009 * (((0.0 - (2.0 * fSlow0)) * ((fSlow0 + fSlow3) + -1.0)) / fSlow6));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow9 + (1.0 - fSlow4))) / fSlow6));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow7 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow8 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
138
src/sfizz/gen/filters/sfzLpf1p.cxx
Normal file
138
src/sfizz/gen/filters/sfzLpf1p.cxx
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf1p_H__
|
||||
#define __faustLpf1p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf1p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (1.0 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf1p* clone() {
|
||||
return new faustLpf1p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::exp((fConst0 * (0.0 - (6.2831853071795862 * double(fCutoff))))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow0 + (0.999 * fRec1[1]));
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
167
src/sfizz/gen/filters/sfzLpf2p.cxx
Normal file
167
src/sfizz/gen/filters/sfzLpf2p.cxx
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2p_H__
|
||||
#define __faustLpf2p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf2p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec1[3];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec3[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf2p* clone() {
|
||||
return new faustLpf2p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec2[0] = (fSlow6 + (0.999 * fRec2[1]));
|
||||
fRec3[0] = (fSlow7 + (0.999 * fRec3[1]));
|
||||
fRec1[0] = (fTemp0 - ((fRec2[0] * fRec1[1]) + (fRec3[0] * fRec1[2])));
|
||||
fRec4[0] = (fSlow8 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec4[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
165
src/sfizz/gen/filters/sfzLpf2pSv.cxx
Normal file
165
src/sfizz/gen/filters/sfzLpf2pSv.cxx
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2pSv_H__
|
||||
#define __faustLpf2pSv_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf2pSv : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (3.1415926535897931 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec1[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf2pSv* clone() {
|
||||
return new faustLpf2pSv();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (0.0010000000000000009 * std::tan((fConst0 * double(fCutoff))));
|
||||
double fSlow1 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = (fSlow0 + (0.999 * fRec3[1]));
|
||||
double fTemp1 = (fSlow1 + fRec3[0]);
|
||||
fRec4[0] = ((0.999 * fRec4[1]) + (0.0010000000000000009 / ((fRec3[0] * fTemp1) + 1.0)));
|
||||
fRec5[0] = ((0.999 * fRec5[1]) + (0.0010000000000000009 * fTemp1));
|
||||
double fTemp2 = (fTemp0 - (fRec1[1] + (fRec5[0] * fRec2[1])));
|
||||
double fTemp3 = ((fRec3[0] * fRec4[0]) * fTemp2);
|
||||
double fTemp4 = (fRec2[1] + (2.0 * fTemp3));
|
||||
double fRec0 = (fRec1[1] + (fRec3[0] * fTemp4));
|
||||
double fTemp5 = (fRec2[1] + fTemp3);
|
||||
fRec1[0] = (fRec1[1] + (2.0 * (fRec3[0] * fTemp5)));
|
||||
fRec2[0] = fTemp4;
|
||||
output0[i] = FAUSTFLOAT(fRec0);
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
174
src/sfizz/gen/filters/sfzLpf4p.cxx
Normal file
174
src/sfizz/gen/filters/sfzLpf4p.cxx
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf4p_H__
|
||||
#define __faustLpf4p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf4p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec2[3];
|
||||
double fRec5[2];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec3[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec4[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec2[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec5[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec1[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf4p* clone() {
|
||||
return new faustLpf4p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec3[0] = (fSlow6 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow7 + (0.999 * fRec4[1]));
|
||||
fRec2[0] = (fTemp0 - ((fRec3[0] * fRec2[1]) + (fRec4[0] * fRec2[2])));
|
||||
fRec5[0] = (fSlow8 + (0.999 * fRec5[1]));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec5[0] * (fRec2[0] + fRec2[2]))) - ((fRec3[0] * fRec1[1]) + (fRec4[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec5[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
181
src/sfizz/gen/filters/sfzLpf6p.cxx
Normal file
181
src/sfizz/gen/filters/sfzLpf6p.cxx
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf6p_H__
|
||||
#define __faustLpf6p_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLpf6p : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec3[3];
|
||||
double fRec6[2];
|
||||
double fRec2[3];
|
||||
double fRec1[3];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec4[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec5[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 3); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec6[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 3); l5 = (l5 + 1)) {
|
||||
fRec2[l5] = 0.0;
|
||||
}
|
||||
for (int l6 = 0; (l6 < 3); l6 = (l6 + 1)) {
|
||||
fRec1[l6] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLpf6p* clone() {
|
||||
return new faustLpf6p();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::cos(fSlow0);
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (0.0010000000000000009 * fSlow4);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * fSlow1)) / fSlow3));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow2) / fSlow3));
|
||||
double fSlow8 = (0.00050000000000000044 * fSlow4);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = (fSlow5 + (0.999 * fRec0[1]));
|
||||
fRec4[0] = (fSlow6 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow7 + (0.999 * fRec5[1]));
|
||||
fRec3[0] = (fTemp0 - ((fRec4[0] * fRec3[1]) + (fRec5[0] * fRec3[2])));
|
||||
fRec6[0] = (fSlow8 + (0.999 * fRec6[1]));
|
||||
fRec2[0] = (((fRec0[0] * fRec3[1]) + (fRec6[0] * (fRec3[0] + fRec3[2]))) - ((fRec4[0] * fRec2[1]) + (fRec5[0] * fRec2[2])));
|
||||
fRec1[0] = (((fRec0[0] * fRec2[1]) + (fRec6[0] * (fRec2[0] + fRec2[2]))) - ((fRec4[0] * fRec1[1]) + (fRec5[0] * fRec1[2])));
|
||||
output0[i] = FAUSTFLOAT(((fRec0[0] * fRec1[1]) + (fRec6[0] * (fRec1[0] + fRec1[2]))));
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec3[2] = fRec3[1];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
fRec2[2] = fRec2[1];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[2] = fRec1[1];
|
||||
fRec1[1] = fRec1[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
179
src/sfizz/gen/filters/sfzLsh.cxx
Normal file
179
src/sfizz/gen/filters/sfzLsh.cxx
Normal file
|
|
@ -0,0 +1,179 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLsh_H__
|
||||
#define __faustLsh_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustLsh : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
FAUSTFLOAT fPkShGain;
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec5[l5] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustLsh* clone() {
|
||||
return new faustLsh();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow1 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (fSlow2 * (fSlow0 + 1.0));
|
||||
double fSlow4 = ((std::sqrt(fSlow0) * std::sin(fSlow1)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow5 = (fSlow2 * (fSlow0 + -1.0));
|
||||
double fSlow6 = (fSlow0 + fSlow5);
|
||||
double fSlow7 = ((fSlow4 + fSlow6) + 1.0);
|
||||
double fSlow8 = (0.0010000000000000009 * ((0.0 - (2.0 * ((fSlow0 + fSlow3) + -1.0))) / fSlow7));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow6 + (1.0 - fSlow4)) / fSlow7));
|
||||
double fSlow10 = (0.0010000000000000009 * ((fSlow0 * ((fSlow0 + fSlow4) + (1.0 - fSlow5))) / fSlow7));
|
||||
double fSlow11 = (0.0020000000000000018 * ((fSlow0 * (fSlow0 + (-1.0 - fSlow3))) / fSlow7));
|
||||
double fSlow12 = (0.0010000000000000009 * ((fSlow0 * (fSlow0 + (1.0 - (fSlow4 + fSlow5)))) / fSlow7));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow8 + (0.999 * fRec1[1]));
|
||||
fRec2[0] = (fSlow9 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - ((fRec1[0] * fRec0[1]) + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow10 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow11 + (0.999 * fRec4[1]));
|
||||
fRec5[0] = (fSlow12 + (0.999 * fRec5[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + (fRec4[0] * fRec0[1])) + (fRec5[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
172
src/sfizz/gen/filters/sfzPeq.cxx
Normal file
172
src/sfizz/gen/filters/sfzPeq.cxx
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPeq_H__
|
||||
#define __faustPeq_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustPeq : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec0[3];
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (6.2831853071795862 / std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate))));
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec2[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 3); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec3[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustPeq* clone() {
|
||||
return new faustPeq();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst0 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::sin(fSlow0);
|
||||
double fSlow2 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = (0.5 * (fSlow1 / (fSlow2 * fSlow3)));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.0010000000000000009 * ((0.0 - (2.0 * std::cos(fSlow0))) / fSlow5));
|
||||
double fSlow7 = (0.0010000000000000009 * ((1.0 - fSlow4) / fSlow5));
|
||||
double fSlow8 = (0.5 * ((fSlow1 * fSlow3) / fSlow2));
|
||||
double fSlow9 = (0.0010000000000000009 * ((fSlow8 + 1.0) / fSlow5));
|
||||
double fSlow10 = (0.0010000000000000009 * ((1.0 - fSlow8) / fSlow5));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow6 + (0.999 * fRec1[1]));
|
||||
double fTemp1 = (fRec1[0] * fRec0[1]);
|
||||
fRec2[0] = (fSlow7 + (0.999 * fRec2[1]));
|
||||
fRec0[0] = (fTemp0 - (fTemp1 + (fRec2[0] * fRec0[2])));
|
||||
fRec3[0] = (fSlow9 + (0.999 * fRec3[1]));
|
||||
fRec4[0] = (fSlow10 + (0.999 * fRec4[1]));
|
||||
output0[i] = FAUSTFLOAT((((fRec0[0] * fRec3[0]) + fTemp1) + (fRec4[0] * fRec0[2])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec0[2] = fRec0[1];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
128
src/sfizz/gen/filters/sfzPink.cxx
Normal file
128
src/sfizz/gen/filters/sfzPink.cxx
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPink_H__
|
||||
#define __faustPink_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustPink : public dsp {
|
||||
|
||||
public:
|
||||
|
||||
double fRec0[4];
|
||||
int fSampleRate;
|
||||
|
||||
public:
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
fSampleRate = sample_rate;
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
faustPink* clone() {
|
||||
return new faustPink();
|
||||
}
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec0[0] = ((fTemp0 + ((2.4949560019999999 * fRec0[1]) + (0.52218940000000003 * fRec0[3]))) - (2.0172658750000001 * fRec0[2]));
|
||||
output0[i] = FAUSTFLOAT((((0.049922034999999997 * fRec0[0]) + (0.050612698999999997 * fRec0[2])) - ((0.095993537000000004 * fRec0[1]) + (0.0044087859999999996 * fRec0[3]))));
|
||||
for (int j0 = 3; (j0 > 0); j0 = (j0 - 1)) {
|
||||
fRec0[j0] = fRec0[(j0 - 1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue