Add regenerated faust source
This commit is contained in:
parent
acf8b9f15a
commit
58c7c38f2e
57 changed files with 4606 additions and 4715 deletions
|
|
@ -1,7 +1,11 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
name: "compressor"
|
||||
Code generated with Faust 2.27.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -scal -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustCompressor_H__
|
||||
|
|
@ -9,97 +13,73 @@ Compilation options: -lang cpp -inpl -scal -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustCompressor
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustCompressor {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
float fConst0;
|
||||
float fConst1;
|
||||
|
||||
private:
|
||||
|
||||
FAUSTFLOAT fHslider0;
|
||||
int fSampleRate;
|
||||
float fConst2;
|
||||
float fConst0;
|
||||
FAUSTFLOAT fHslider1;
|
||||
FAUSTFLOAT fHslider2;
|
||||
float fRec2[2];
|
||||
float fRec1[2];
|
||||
FAUSTFLOAT fHslider3;
|
||||
float fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata() {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
(void)sample_rate;
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = float(_oversampling);
|
||||
fConst1 = (0.5f * fConst0);
|
||||
fConst2 = (1.0f / std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate))));
|
||||
fConst0 = (1.0f / float(fSampleRate));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(0.0f);
|
||||
fHslider1 = FAUSTFLOAT(1.0f);
|
||||
fHslider2 = FAUSTFLOAT(0.0f);
|
||||
fHslider3 = FAUSTFLOAT(0.0f);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0f;
|
||||
}
|
||||
|
|
@ -109,73 +89,81 @@ class faustCompressor {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0f;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
faustCompressor* clone() {
|
||||
return new faustCompressor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface() {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
float fSlow0 = float(fHslider0);
|
||||
float fSlow1 = (fConst1 * fSlow0);
|
||||
float fSlow1 = (0.5f * fSlow0);
|
||||
int iSlow2 = (std::fabs(fSlow1) < 1.1920929e-07f);
|
||||
float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow2 ? 1.0f : fSlow1)))));
|
||||
float fSlow4 = ((1.0f / std::max<float>(1.00000001e-07f, float(fHslider1))) + -1.0f);
|
||||
float fSlow5 = (fConst0 * fSlow0);
|
||||
int iSlow6 = (std::fabs(fSlow5) < 1.1920929e-07f);
|
||||
float fSlow7 = (iSlow6 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow6 ? 1.0f : fSlow5)))));
|
||||
float fSlow8 = (fConst0 * float(fHslider2));
|
||||
int iSlow9 = (std::fabs(fSlow8) < 1.1920929e-07f);
|
||||
float fSlow10 = (iSlow9 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow9 ? 1.0f : fSlow8)))));
|
||||
float fSlow11 = float(fHslider3);
|
||||
float fSlow12 = (1.0f - fSlow3);
|
||||
float fSlow3 = (iSlow2 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow2 ? 1.0f : fSlow1)))));
|
||||
float fSlow4 = ((1.0f / std::max<float>(1.1920929e-07f, float(fHslider1))) + -1.0f);
|
||||
int iSlow5 = (std::fabs(fSlow0) < 1.1920929e-07f);
|
||||
float fSlow6 = (iSlow5 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow5 ? 1.0f : fSlow0)))));
|
||||
float fSlow7 = float(fHslider2);
|
||||
int iSlow8 = (std::fabs(fSlow7) < 1.1920929e-07f);
|
||||
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst0 / (iSlow8 ? 1.0f : fSlow7)))));
|
||||
float fSlow10 = float(fHslider3);
|
||||
float fSlow11 = (1.0f - fSlow3);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
float fTemp0 = float(input0[i]);
|
||||
float fTemp1 = std::fabs(fTemp0);
|
||||
float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow10 : fSlow7);
|
||||
float fTemp2 = ((fRec1[1] > fTemp1) ? fSlow9 : fSlow6);
|
||||
fRec2[0] = ((fRec2[1] * fTemp2) + (fTemp1 * (1.0f - fTemp2)));
|
||||
fRec1[0] = fRec2[0];
|
||||
fRec0[0] = ((fRec0[1] * fSlow3) + (fSlow4 * (std::max<float>(((20.0f * std::log10(fRec1[0])) - fSlow11), 0.0f) * fSlow12)));
|
||||
fRec0[0] = ((fSlow3 * fRec0[1]) + (fSlow4 * (std::max<float>(((20.0f * std::log10(fRec1[0])) - fSlow10), 0.0f) * fSlow11)));
|
||||
output0[i] = FAUSTFLOAT(std::pow(10.0f, (0.0500000007f * fRec0[0])));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getRatio() const { return fHslider1; }
|
||||
void setRatio(FAUSTFLOAT value) { fHslider1 = value; }
|
||||
|
||||
FAUSTFLOAT getThreshold() const { return fHslider3; }
|
||||
void setThreshold(FAUSTFLOAT value) { fHslider3 = value; }
|
||||
|
||||
FAUSTFLOAT getAttack() const { return fHslider0; }
|
||||
void setAttack(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getRelease() const { return fHslider2; }
|
||||
void setRelease(FAUSTFLOAT value) { fHslider2 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
#ifdef FAUST_UIMACROS
|
||||
|
||||
|
||||
|
||||
#define FAUST_LIST_ACTIVES(p) \
|
||||
p(HORIZONTALSLIDER, Ratio, "Ratio", fHslider1, 1.0f, 1.0f, 20.0f, 0.01f) \
|
||||
p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider3, 0.0f, -60.0f, 0.0f, 0.01f) \
|
||||
p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 0.5f, 0.001f) \
|
||||
p(HORIZONTALSLIDER, Release, "Release", fHslider2, 0.0f, 0.0f, 5.0f, 0.001f) \
|
||||
|
||||
#define FAUST_LIST_PASSIVES(p) \
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
name: "disto_stage"
|
||||
Code generated with Faust 2.27.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -scal -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustDisto_H__
|
||||
|
|
@ -9,20 +13,24 @@ Compilation options: -lang cpp -inpl -scal -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustDistoSIG0 {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int iRec3[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
int getNumInputsfaustDistoSIG0() {
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -53,14 +61,13 @@ class faustDistoSIG0 {
|
|||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
void instanceInitfaustDistoSIG0(int sample_rate) {
|
||||
(void)sample_rate;
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
iRec3[l3] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void fillfaustDistoSIG0(int count, float* table) {
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
iRec3[0] = (iRec3[1] + 1);
|
||||
|
|
@ -77,19 +84,19 @@ static void deletefaustDistoSIG0(faustDistoSIG0* dsp) { delete dsp; }
|
|||
|
||||
static float ftbl0faustDistoSIG0[256];
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustDisto
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
class faustDisto {
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
float fVec0[2];
|
||||
int fSampleRate;
|
||||
float fConst0;
|
||||
|
|
@ -97,79 +104,52 @@ class faustDisto {
|
|||
float fConst2;
|
||||
float fConst3;
|
||||
float fConst4;
|
||||
int iConst5;
|
||||
float fConst6;
|
||||
float fConst5;
|
||||
int iRec2[2];
|
||||
float fConst7;
|
||||
float fRec1[2];
|
||||
FAUSTFLOAT fHslider0;
|
||||
float fVec1[2];
|
||||
float fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata() {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
faustDistoSIG0* sig0 = newfaustDistoSIG0();
|
||||
sig0->instanceInitfaustDistoSIG0(sample_rate);
|
||||
sig0->fillfaustDistoSIG0(256, ftbl0faustDistoSIG0);
|
||||
deletefaustDistoSIG0(sig0);
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
|
||||
fConst0 = float(fSampleRate);
|
||||
fConst1 = (15.707963f / fConst0);
|
||||
fConst2 = (1.0f / (fConst1 + 1.0f));
|
||||
fConst3 = (1.0f - fConst1);
|
||||
fConst4 = (0.00999999978f * float(_oversampling));
|
||||
iConst5 = (std::fabs(fConst4) < 1.1920929e-07f);
|
||||
fConst6 = (iConst5 ? 0.0f : std::exp((0.0f - ((1.0f / fConst0) / (iConst5 ? 1.0f : fConst4)))));
|
||||
fConst7 = (1.0f - fConst6);
|
||||
fConst4 = std::exp((0.0f - (100.0f / fConst0)));
|
||||
fConst5 = (1.0f - fConst4);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(100.0f);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fVec0[l0] = 0.0f;
|
||||
}
|
||||
|
|
@ -185,38 +165,39 @@ class faustDisto {
|
|||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec0[l5] = 0.0f;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
faustDisto* clone() {
|
||||
return new faustDisto();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface() {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
float fSlow0 = ((0.200000003f * float(fHslider0)) + 2.0f);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
float fTemp0 = float(input0[i]);
|
||||
fVec0[0] = fTemp0;
|
||||
iRec2[0] = (((fTemp0 < fVec0[1]) & (fTemp0 < -0.25f)) ? 1 : (((fTemp0 > fVec0[1]) & (fTemp0 > 0.25f)) ? 0 : iRec2[1]));
|
||||
fRec1[0] = ((fRec1[1] * fConst6) + (float(iRec2[0]) * fConst7));
|
||||
fRec1[0] = ((fConst4 * fRec1[1]) + (fConst5 * float(iRec2[0])));
|
||||
float fTemp2 = std::max<float>(0.0f, (12.75f * ((fSlow0 * fTemp0) + 10.0f)));
|
||||
int iTemp3 = int(fTemp2);
|
||||
float fTemp4 = ftbl0faustDistoSIG0[std::min<int>(255, iTemp3)];
|
||||
|
|
@ -231,19 +212,21 @@ class faustDisto {
|
|||
fVec1[1] = fVec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getDepth() const { return fHslider0; }
|
||||
void setDepth(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
#ifdef FAUST_UIMACROS
|
||||
|
||||
|
||||
|
||||
#define FAUST_LIST_ACTIVES(p) \
|
||||
p(HORIZONTALSLIDER, Depth, "Depth", fHslider0, 100.0f, 0.0f, 100.0f, 0.01f) \
|
||||
|
||||
#define FAUST_LIST_PASSIVES(p) \
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,11 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
name: "gate"
|
||||
Code generated with Faust 2.27.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -scal -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustGate_H__
|
||||
|
|
@ -9,101 +13,77 @@ Compilation options: -lang cpp -inpl -scal -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustGate
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustGate {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
float fConst0;
|
||||
|
||||
private:
|
||||
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fHslider1;
|
||||
int fSampleRate;
|
||||
float fConst0;
|
||||
float fConst1;
|
||||
float fConst2;
|
||||
float fRec3[2];
|
||||
FAUSTFLOAT fHslider2;
|
||||
int iVec0[2];
|
||||
float fConst3;
|
||||
FAUSTFLOAT fHslider3;
|
||||
int iRec4[2];
|
||||
float fRec1[2];
|
||||
float fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata() {
|
||||
}
|
||||
|
||||
int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
(void)sample_rate;
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = float(_oversampling);
|
||||
fConst1 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
|
||||
fConst2 = (1.0f / fConst1);
|
||||
fConst3 = (fConst1 * fConst0);
|
||||
fConst0 = float(fSampleRate);
|
||||
fConst1 = (1.0f / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(0.0f);
|
||||
fHslider1 = FAUSTFLOAT(0.0f);
|
||||
fHslider2 = FAUSTFLOAT(0.0f);
|
||||
fHslider3 = FAUSTFLOAT(0.0f);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0f;
|
||||
}
|
||||
|
|
@ -119,44 +99,45 @@ class faustGate {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec0[l4] = 0.0f;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
faustGate* clone() {
|
||||
return new faustGate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void buildUserInterface() {
|
||||
}
|
||||
|
||||
void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
float fSlow0 = (fConst0 * float(fHslider0));
|
||||
float fSlow1 = (fConst0 * float(fHslider1));
|
||||
float fSlow0 = float(fHslider0);
|
||||
float fSlow1 = float(fHslider1);
|
||||
float fSlow2 = std::min<float>(fSlow0, fSlow1);
|
||||
int iSlow3 = (std::fabs(fSlow2) < 1.1920929e-07f);
|
||||
float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow3 ? 1.0f : fSlow2)))));
|
||||
float fSlow4 = (iSlow3 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow3 ? 1.0f : fSlow2)))));
|
||||
float fSlow5 = (1.0f - fSlow4);
|
||||
float fSlow6 = std::pow(10.0f, (0.0500000007f * float(fHslider2)));
|
||||
int iSlow7 = int((fConst3 * float(fHslider3)));
|
||||
int iSlow7 = int((fConst0 * float(fHslider3)));
|
||||
int iSlow8 = (std::fabs(fSlow0) < 1.1920929e-07f);
|
||||
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow8 ? 1.0f : fSlow0)))));
|
||||
float fSlow9 = (iSlow8 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow8 ? 1.0f : fSlow0)))));
|
||||
int iSlow10 = (std::fabs(fSlow1) < 1.1920929e-07f);
|
||||
float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst2 / (iSlow10 ? 1.0f : fSlow1)))));
|
||||
float fSlow11 = (iSlow10 ? 0.0f : std::exp((0.0f - (fConst1 / (iSlow10 ? 1.0f : fSlow1)))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
float fTemp0 = float(input0[i]);
|
||||
fRec3[0] = ((fRec3[1] * fSlow4) + (std::fabs(fTemp0) * fSlow5));
|
||||
|
|
@ -175,22 +156,30 @@ class faustGate {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getThreshold() const { return fHslider2; }
|
||||
void setThreshold(FAUSTFLOAT value) { fHslider2 = value; }
|
||||
|
||||
FAUSTFLOAT getAttack() const { return fHslider0; }
|
||||
void setAttack(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getHold() const { return fHslider3; }
|
||||
void setHold(FAUSTFLOAT value) { fHslider3 = value; }
|
||||
|
||||
FAUSTFLOAT getRelease() const { return fHslider1; }
|
||||
void setRelease(FAUSTFLOAT value) { fHslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
#ifdef FAUST_UIMACROS
|
||||
|
||||
|
||||
|
||||
#define FAUST_LIST_ACTIVES(p) \
|
||||
p(HORIZONTALSLIDER, Threshold, "Threshold", fHslider2, 0.0f, -60.0f, 0.0f, 0.01f) \
|
||||
p(HORIZONTALSLIDER, Attack, "Attack", fHslider0, 0.0f, 0.0f, 10.0f, 0.001f) \
|
||||
p(HORIZONTALSLIDER, Hold, "Hold", fHslider3, 0.0f, 0.0f, 10.0f, 0.001f) \
|
||||
p(HORIZONTALSLIDER, Release, "Release", fHslider1, 0.0f, 0.0f, 5.0f, 0.001f) \
|
||||
|
||||
#define FAUST_LIST_PASSIVES(p) \
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,135 +1,171 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
name: "limiter"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -scal -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -scal -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLimiter_H__
|
||||
#define __faustLimiter_H__
|
||||
#ifndef __faustLimiter_H__
|
||||
#define __faustLimiter_H__
|
||||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLimiter
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLimiter {
|
||||
//[Begin:class]
|
||||
|
||||
private:
|
||||
int fSampleRate;
|
||||
float fConst0;
|
||||
float fConst1;
|
||||
float fConst2;
|
||||
float fConst3;
|
||||
float fConst4;
|
||||
float fConst5;
|
||||
float fConst6;
|
||||
float fRec2[2];
|
||||
float fRec1[2];
|
||||
float fRec0[2];
|
||||
float fRec5[2];
|
||||
float fRec4[2];
|
||||
float fRec3[2];
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
float fConst0;
|
||||
float fConst1;
|
||||
float fConst2;
|
||||
float fConst3;
|
||||
float fConst4;
|
||||
float fConst5;
|
||||
float fConst6;
|
||||
float fRec2[2];
|
||||
float fRec1[2];
|
||||
float fRec0[2];
|
||||
float fRec5[2];
|
||||
float fRec4[2];
|
||||
float fRec3[2];
|
||||
|
||||
public:
|
||||
|
||||
|
||||
public:
|
||||
static void classInit(int sample_rate)
|
||||
{
|
||||
(void)sample_rate;
|
||||
}
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = float(fSampleRate);
|
||||
fConst1 = std::exp((0.0f - (2500.0f / fConst0)));
|
||||
fConst2 = (1.0f - fConst1);
|
||||
fConst3 = std::exp((0.0f - (1250.0f / fConst0)));
|
||||
fConst4 = (1.0f - fConst3);
|
||||
fConst5 = std::exp((0.0f - (2.0f / fConst0)));
|
||||
fConst6 = (1.0f - fConst5);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0f;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0f;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0f;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec5[l3] = 0.0f;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0f;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec3[l5] = 0.0f;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
float fTemp0 = float(input0[i]);
|
||||
float fTemp1 = float(input1[i]);
|
||||
float fTemp2 = std::fabs(fTemp0);
|
||||
fRec2[0] = std::max<float>(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2)));
|
||||
fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0]));
|
||||
fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f)));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0]));
|
||||
float fTemp3 = std::fabs(fTemp1);
|
||||
fRec5[0] = std::max<float>(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3)));
|
||||
fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0]));
|
||||
fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f)));
|
||||
output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0]));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
void instanceConstants(int sample_rate)
|
||||
{
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = (std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate))) * float(_oversampling));
|
||||
fConst1 = std::exp((0.0f - (2500.0f / fConst0)));
|
||||
fConst2 = (1.0f - fConst1);
|
||||
fConst3 = std::exp((0.0f - (1250.0f / fConst0)));
|
||||
fConst4 = (1.0f - fConst3);
|
||||
fConst5 = std::exp((0.0f - (2.0f / fConst0)));
|
||||
fConst6 = (1.0f - fConst5);
|
||||
}
|
||||
|
||||
void instanceResetUserInterface()
|
||||
{
|
||||
}
|
||||
|
||||
void instanceClear()
|
||||
{
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0f;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0f;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0f;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fRec5[l3] = 0.0f;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec4[l4] = 0.0f;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fRec3[l5] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void init(int sample_rate)
|
||||
{
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
}
|
||||
void instanceInit(int sample_rate)
|
||||
{
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
}
|
||||
|
||||
int getSampleRate()
|
||||
{
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
void compute(int count, const FAUSTFLOAT* const* inputs, FAUSTFLOAT* const* outputs)
|
||||
{
|
||||
const FAUSTFLOAT* input0 = inputs[0];
|
||||
const FAUSTFLOAT* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
float fTemp0 = float(input0[i]);
|
||||
float fTemp1 = float(input1[i]);
|
||||
float fTemp2 = std::fabs(fTemp0);
|
||||
fRec2[0] = std::max<float>(fTemp2, ((fConst5 * fRec2[1]) + (fConst6 * fTemp2)));
|
||||
fRec1[0] = ((fConst3 * fRec1[1]) + (fConst4 * fRec2[0]));
|
||||
fRec0[0] = ((fConst1 * fRec0[1]) + (fConst2 * ((fRec1[0] > 1.0f) ? (1.0f / fRec1[0]) : 1.0f)));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 * fRec0[0]));
|
||||
float fTemp3 = std::fabs(fTemp1);
|
||||
fRec5[0] = std::max<float>(fTemp3, ((fConst5 * fRec5[1]) + (fConst6 * fTemp3)));
|
||||
fRec4[0] = ((fConst3 * fRec4[1]) + (fConst4 * fRec5[0]));
|
||||
fRec3[0] = ((fConst1 * fRec3[1]) + (fConst2 * ((fRec4[0] > 1.0f) ? (1.0f / fRec4[0]) : 1.0f)));
|
||||
output1[i] = FAUSTFLOAT((fTemp1 * fRec3[0]));
|
||||
fRec2[1] = fRec2[0];
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
}
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chApf1p_H__
|
||||
|
|
@ -11,98 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chApf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -112,40 +89,41 @@ class faust2chApf1p : public sfzFilterDsp {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chApf1p* clone() {
|
||||
return new faust2chApf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec2[0] = (fTemp1 - (fRec1[0] * fRec2[1]));
|
||||
|
|
@ -154,8 +132,21 @@ class faust2chApf1p : public sfzFilterDsp {
|
|||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf1p_H__
|
||||
|
|
@ -11,100 +15,73 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -120,40 +97,41 @@ class faust2chBpf1p : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBpf1p* clone() {
|
||||
return new faust2chBpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
double fTemp2 = (1.0 - fRec2[0]);
|
||||
fRec0[0] = ((fRec1[0] * fTemp2) + (fRec2[0] * fRec0[1]));
|
||||
|
|
@ -169,8 +147,21 @@ class faust2chBpf1p : public sfzFilterDsp {
|
|||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2p_H__
|
||||
|
|
@ -11,34 +15,38 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fVec1[2];
|
||||
|
|
@ -52,71 +60,40 @@ class faust2chBpf2p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec8[2];
|
||||
double fRec7[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -162,38 +139,39 @@ class faust2chBpf2p : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec7[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBpf2p* clone() {
|
||||
return new faust2chBpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -238,8 +216,24 @@ class faust2chBpf2p : public sfzFilterDsp {
|
|||
fRec8[1] = fRec8[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf2pSv_H__
|
||||
|
|
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,38 +107,39 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
|||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBpf2pSv* clone() {
|
||||
return new faust2chBpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
|
|
@ -194,8 +172,24 @@ class faust2chBpf2pSv : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf4p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fRec5[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -62,71 +70,40 @@ class faust2chBpf4p : public sfzFilterDsp {
|
|||
double fVec11[2];
|
||||
double fRec10[2];
|
||||
double fRec9[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -202,38 +179,39 @@ class faust2chBpf4p : public sfzFilterDsp {
|
|||
for (int l24 = 0; (l24 < 2); l24 = (l24 + 1)) {
|
||||
fRec9[l24] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBpf4p* clone() {
|
||||
return new faust2chBpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -298,8 +276,24 @@ class faust2chBpf4p : public sfzFilterDsp {
|
|||
fRec10[1] = fRec10[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBpf6p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -72,71 +80,40 @@ class faust2chBpf6p : public sfzFilterDsp {
|
|||
double fVec17[2];
|
||||
double fRec12[2];
|
||||
double fRec11[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -242,38 +219,39 @@ class faust2chBpf6p : public sfzFilterDsp {
|
|||
for (int l34 = 0; (l34 < 2); l34 = (l34 + 1)) {
|
||||
fRec11[l34] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBpf6p* clone() {
|
||||
return new faust2chBpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -358,8 +336,24 @@ class faust2chBpf6p : public sfzFilterDsp {
|
|||
fRec12[1] = fRec12[0];
|
||||
fRec11[1] = fRec11[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf1p_H__
|
||||
|
|
@ -11,100 +15,73 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBrf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec4[2];
|
||||
double fRec3[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -120,40 +97,41 @@ class faust2chBrf1p : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBrf1p* clone() {
|
||||
return new faust2chBrf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
|
|
@ -166,8 +144,21 @@ class faust2chBrf1p : public sfzFilterDsp {
|
|||
fRec4[1] = fRec4[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBrf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -50,71 +58,40 @@ class faust2chBrf2p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec6[2];
|
||||
double fRec5[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -154,37 +131,38 @@ class faust2chBrf2p : public sfzFilterDsp {
|
|||
for (int l12 = 0; (l12 < 2); l12 = (l12 + 1)) {
|
||||
fRec5[l12] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBrf2p* clone() {
|
||||
return new faust2chBrf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (1.0 - fSlow0);
|
||||
double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4);
|
||||
|
|
@ -224,8 +202,24 @@ class faust2chBrf2p : public sfzFilterDsp {
|
|||
fRec6[1] = fRec6[0];
|
||||
fRec5[1] = fRec5[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chBrf2pSv_H__
|
||||
|
|
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chBrf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
double fRec9[2];
|
||||
double fRec10[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,38 +107,39 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
|||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec10[l6] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chBrf2pSv* clone() {
|
||||
return new faust2chBrf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
|
|
@ -196,8 +174,24 @@ class faust2chBrf2pSv : public sfzFilterDsp {
|
|||
fRec9[1] = fRec9[0];
|
||||
fRec10[1] = fRec10[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chEqHshelf_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
@ -21,26 +25,30 @@ static double faust2chEqHshelf_faustpower2_f(double value) {
|
|||
return (value * value);
|
||||
}
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chEqHshelf
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chEqHshelf : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -56,72 +64,41 @@ class faust2chEqHshelf : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec8[2];
|
||||
double fRec7[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -167,44 +144,45 @@ class faust2chEqHshelf : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec7[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chEqHshelf* clone() {
|
||||
return new faust2chEqHshelf();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = (faust2chEqHshelf_faustpower2_f(fSlow1) + 1.0);
|
||||
double fSlow6 = (fSlow1 + -1.0);
|
||||
double fSlow7 = faust2chEqHshelf_faustpower2_f(fSlow6);
|
||||
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = (fSlow3 * fSlow6);
|
||||
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = (fSlow6 * fSlow3);
|
||||
double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9));
|
||||
double fSlow11 = (1.0 - fSlow0);
|
||||
double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11);
|
||||
|
|
@ -249,8 +227,27 @@ class faust2chEqHshelf : public sfzFilterDsp {
|
|||
fRec8[1] = fRec8[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chEqLshelf_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
@ -21,26 +25,30 @@ static double faust2chEqLshelf_faustpower2_f(double value) {
|
|||
return (value * value);
|
||||
}
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chEqLshelf
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chEqLshelf : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -56,72 +64,41 @@ class faust2chEqLshelf : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec8[2];
|
||||
double fRec7[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -167,44 +144,45 @@ class faust2chEqLshelf : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec7[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chEqLshelf* clone() {
|
||||
return new faust2chEqLshelf();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = (fSlow1 + -1.0);
|
||||
double fSlow6 = (fSlow3 * fSlow5);
|
||||
double fSlow6 = (fSlow5 * fSlow3);
|
||||
double fSlow7 = (faust2chEqLshelf_faustpower2_f(fSlow1) + 1.0);
|
||||
double fSlow8 = faust2chEqLshelf_faustpower2_f(fSlow5);
|
||||
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
|
||||
double fSlow10 = (fSlow6 + fSlow9);
|
||||
double fSlow11 = ((fSlow1 + fSlow10) + 1.0);
|
||||
double fSlow12 = (1.0 - fSlow0);
|
||||
|
|
@ -249,8 +227,27 @@ class faust2chEqLshelf : public sfzFilterDsp {
|
|||
fRec8[1] = fRec8[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chEqPeak_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* link with : "" */
|
||||
#include <algorithm>
|
||||
|
|
@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chEqPeak
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chEqPeak : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst3;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -54,73 +62,42 @@ class faust2chEqPeak : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec7[2];
|
||||
double fRec6[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
fConst3 = (2.1775860903036022 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -163,45 +140,46 @@ class faust2chEqPeak : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec6[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chEqPeak* clone() {
|
||||
return new faust2chEqPeak();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
||||
double fSlow1 = std::max<double>(0.0, double(fHslider0));
|
||||
double fSlow2 = (fConst2 * fSlow1);
|
||||
double fSlow3 = std::sin(fSlow2);
|
||||
double fSlow4 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3)))))));
|
||||
double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow5 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3)))))));
|
||||
double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5)));
|
||||
double fSlow7 = (fSlow6 + 1.0);
|
||||
double fSlow8 = (1.0 - fSlow0);
|
||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4));
|
||||
double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5));
|
||||
double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8);
|
||||
|
|
@ -239,8 +217,27 @@ class faust2chEqPeak : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf1p_H__
|
||||
|
|
@ -11,98 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -112,40 +89,41 @@ class faust2chHpf1p : public sfzFilterDsp {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHpf1p* clone() {
|
||||
return new faust2chHpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (fRec1[0] + 1.0);
|
||||
double fTemp3 = (0.0 - (0.5 * fTemp2));
|
||||
|
|
@ -156,8 +134,21 @@ class faust2chHpf1p : public sfzFilterDsp {
|
|||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -51,71 +59,40 @@ class faust2chHpf2p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec7[2];
|
||||
double fRec6[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -158,38 +135,39 @@ class faust2chHpf2p : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec6[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHpf2p* clone() {
|
||||
return new faust2chHpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -232,8 +210,24 @@ class faust2chHpf2p : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf2pSv_H__
|
||||
|
|
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,38 +107,39 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
|||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHpf2pSv* clone() {
|
||||
return new faust2chHpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
|
|
@ -194,8 +172,24 @@ class faust2chHpf2pSv : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf4p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec5[2];
|
||||
|
|
@ -61,71 +69,40 @@ class faust2chHpf4p : public sfzFilterDsp {
|
|||
double fVec11[2];
|
||||
double fRec9[2];
|
||||
double fRec8[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -198,38 +175,39 @@ class faust2chHpf4p : public sfzFilterDsp {
|
|||
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
|
||||
fRec8[l23] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHpf4p* clone() {
|
||||
return new faust2chHpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -294,8 +272,24 @@ class faust2chHpf4p : public sfzFilterDsp {
|
|||
fRec9[1] = fRec9[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHpf6p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec7[2];
|
||||
|
|
@ -71,71 +79,40 @@ class faust2chHpf6p : public sfzFilterDsp {
|
|||
double fVec17[2];
|
||||
double fRec11[2];
|
||||
double fRec10[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -238,38 +215,39 @@ class faust2chHpf6p : public sfzFilterDsp {
|
|||
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
|
||||
fRec10[l33] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHpf6p* clone() {
|
||||
return new faust2chHpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -356,8 +334,24 @@ class faust2chHpf6p : public sfzFilterDsp {
|
|||
fRec11[1] = fRec11[0];
|
||||
fRec10[1] = fRec10[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chHsh_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chHsh : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -53,72 +61,41 @@ class faust2chHsh : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec8[2];
|
||||
double fRec7[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -164,48 +141,49 @@ class faust2chHsh : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec7[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chHsh* clone() {
|
||||
return new faust2chHsh();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
|
||||
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
|
||||
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
||||
double fSlow8 = (1.0 - fSlow0);
|
||||
double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (fSlow1 + fSlow6);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (fSlow6 + fSlow5);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8);
|
||||
double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
|
|
@ -243,8 +221,27 @@ class faust2chHsh : public sfzFilterDsp {
|
|||
fRec8[1] = fRec8[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider1; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf1p_H__
|
||||
|
|
@ -11,98 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -112,40 +89,41 @@ class faust2chLpf1p : public sfzFilterDsp {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec2[l2] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLpf1p* clone() {
|
||||
return new faust2chLpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp2 = (1.0 - fRec1[0]);
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * fTemp2));
|
||||
|
|
@ -155,8 +133,21 @@ class faust2chLpf1p : public sfzFilterDsp {
|
|||
fRec0[1] = fRec0[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2p_H__
|
||||
|
|
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -51,71 +59,40 @@ class faust2chLpf2p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec7[2];
|
||||
double fRec6[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -158,37 +135,38 @@ class faust2chLpf2p : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec6[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLpf2p* clone() {
|
||||
return new faust2chLpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -233,8 +211,24 @@ class faust2chLpf2p : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf2pSv_H__
|
||||
|
|
@ -11,104 +15,77 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fRec8[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,38 +107,39 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
|||
for (int l6 = 0; (l6 < 2); l6 = (l6 + 1)) {
|
||||
fRec8[l6] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLpf2pSv* clone() {
|
||||
return new faust2chLpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
|
|
@ -194,8 +172,24 @@ class faust2chLpf2pSv : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf4p_H__
|
||||
|
|
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -61,71 +69,40 @@ class faust2chLpf4p : public sfzFilterDsp {
|
|||
double fVec11[2];
|
||||
double fRec9[2];
|
||||
double fRec8[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -198,37 +175,38 @@ class faust2chLpf4p : public sfzFilterDsp {
|
|||
for (int l23 = 0; (l23 < 2); l23 = (l23 + 1)) {
|
||||
fRec8[l23] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLpf4p* clone() {
|
||||
return new faust2chLpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -295,8 +273,24 @@ class faust2chLpf4p : public sfzFilterDsp {
|
|||
fRec9[1] = fRec9[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLpf6p_H__
|
||||
|
|
@ -11,37 +15,41 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec7[2];
|
||||
double fVec1[2];
|
||||
double fVec0[2];
|
||||
double fRec8[2];
|
||||
double fVec1[2];
|
||||
double fVec2[2];
|
||||
double fRec9[2];
|
||||
double fRec6[2];
|
||||
|
|
@ -71,85 +79,54 @@ class faust2chLpf6p : public sfzFilterDsp {
|
|||
double fVec17[2];
|
||||
double fRec11[2];
|
||||
double fRec10[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fVec0[l1] = 0.0;
|
||||
fRec7[l1] = 0.0;
|
||||
}
|
||||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec7[l2] = 0.0;
|
||||
fVec0[l2] = 0.0;
|
||||
}
|
||||
for (int l3 = 0; (l3 < 2); l3 = (l3 + 1)) {
|
||||
fVec1[l3] = 0.0;
|
||||
fRec8[l3] = 0.0;
|
||||
}
|
||||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec8[l4] = 0.0;
|
||||
fVec1[l4] = 0.0;
|
||||
}
|
||||
for (int l5 = 0; (l5 < 2); l5 = (l5 + 1)) {
|
||||
fVec2[l5] = 0.0;
|
||||
|
|
@ -238,37 +215,38 @@ class faust2chLpf6p : public sfzFilterDsp {
|
|||
for (int l33 = 0; (l33 < 2); l33 = (l33 + 1)) {
|
||||
fRec10[l33] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLpf6p* clone() {
|
||||
return new faust2chLpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -281,14 +259,14 @@ class faust2chLpf6p : public sfzFilterDsp {
|
|||
double fTemp0 = double(input0[i]);
|
||||
double fTemp1 = double(input1[i]);
|
||||
fRec2[0] = (fSlow7 + (fSlow5 * fRec2[1]));
|
||||
fVec0[0] = (fTemp0 * fRec2[0]);
|
||||
fRec7[0] = ((fSlow5 * fRec7[1]) + fSlow8);
|
||||
double fTemp2 = (fTemp0 * fRec7[0]);
|
||||
fVec1[0] = fTemp2;
|
||||
fVec0[0] = fTemp2;
|
||||
fRec8[0] = ((fSlow5 * fRec8[1]) + fSlow9);
|
||||
fVec2[0] = (fVec1[1] - (fRec8[0] * fRec5[1]));
|
||||
fVec1[0] = (fVec0[1] - (fRec8[0] * fRec5[1]));
|
||||
fVec2[0] = (fTemp0 * fRec2[0]);
|
||||
fRec9[0] = ((fSlow5 * fRec9[1]) + fSlow10);
|
||||
fRec6[0] = ((fVec0[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1]));
|
||||
fRec6[0] = ((fVec1[1] + (fTemp2 + fVec2[1])) - (fRec9[0] * fRec6[1]));
|
||||
fRec5[0] = fRec6[0];
|
||||
fVec3[0] = (fRec2[0] * fRec5[0]);
|
||||
double fTemp3 = (fRec7[0] * fRec5[0]);
|
||||
|
|
@ -323,10 +301,10 @@ class faust2chLpf6p : public sfzFilterDsp {
|
|||
fRec10[0] = fRec11[0];
|
||||
output1[i] = FAUSTFLOAT(fRec10[0]);
|
||||
fRec2[1] = fRec2[0];
|
||||
fVec0[1] = fVec0[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
fVec1[1] = fVec1[0];
|
||||
fVec0[1] = fVec0[0];
|
||||
fRec8[1] = fRec8[0];
|
||||
fVec1[1] = fVec1[0];
|
||||
fVec2[1] = fVec2[0];
|
||||
fRec9[1] = fRec9[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
|
|
@ -357,8 +335,24 @@ class faust2chLpf6p : public sfzFilterDsp {
|
|||
fRec11[1] = fRec11[0];
|
||||
fRec10[1] = fRec10[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chLsh_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chLsh : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -53,72 +61,41 @@ class faust2chLsh : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec8[2];
|
||||
double fRec7[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -164,48 +141,49 @@ class faust2chLsh : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec7[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chLsh* clone() {
|
||||
return new faust2chLsh();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||
double fSlow7 = (fSlow1 + fSlow6);
|
||||
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
|
||||
double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
|
||||
double fSlow7 = (fSlow5 + fSlow6);
|
||||
double fSlow8 = ((fSlow1 + fSlow7) + 1.0);
|
||||
double fSlow9 = (1.0 - fSlow0);
|
||||
double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
|
||||
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
|
||||
double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9);
|
||||
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9);
|
||||
double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9);
|
||||
double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
|
|
@ -243,8 +221,27 @@ class faust2chLsh : public sfzFilterDsp {
|
|||
fRec8[1] = fRec8[0];
|
||||
fRec7[1] = fRec7[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider1; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPeq_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chPeq : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -52,72 +60,41 @@ class faust2chPeq : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec7[2];
|
||||
double fRec6[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -160,44 +137,45 @@ class faust2chPeq : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec6[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chPeq* clone() {
|
||||
return new faust2chPeq();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1)));
|
||||
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
|
||||
double fSlow6 = (fSlow5 + 1.0);
|
||||
double fSlow7 = (1.0 - fSlow0);
|
||||
double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7);
|
||||
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
|
||||
double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3));
|
||||
double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7);
|
||||
double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7);
|
||||
double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7);
|
||||
|
|
@ -235,8 +213,27 @@ class faust2chPeq : public sfzFilterDsp {
|
|||
fRec7[1] = fRec7[0];
|
||||
fRec6[1] = fRec6[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider1; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faust2chPink_H__
|
||||
|
|
@ -11,120 +15,94 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faust2chPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faust2chPink : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
double fRec0[4];
|
||||
double fRec1[4];
|
||||
int fSampleRate;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 2;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 4); l1 = (l1 + 1)) {
|
||||
fRec1[l1] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faust2chPink* clone() {
|
||||
return new faust2chPink();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
FAUSTFLOAT* input1 = inputs[1];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT const* input1 = inputs[1];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
FAUSTFLOAT* output1 = outputs[1];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
|
|
@ -141,8 +119,18 @@ class faust2chPink : public sfzFilterDsp {
|
|||
fRec1[j1] = fRec1[(j1 - 1)];
|
||||
}
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustApf1p_H__
|
||||
|
|
@ -11,133 +15,128 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustApf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustApf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustApf1p* clone() {
|
||||
return new faustApf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 - (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[1] + (fRec1[0] * fRec0[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf1p_H__
|
||||
|
|
@ -11,90 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -104,37 +89,38 @@ class faustBpf1p : public sfzFilterDsp {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBpf1p* clone() {
|
||||
return new faustBpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
|
||||
fRec1[0] = (fTemp0 + (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = ((fRec1[0] * (1.0 - fRec2[0])) + (fRec2[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec2[0] + 1.0);
|
||||
|
|
@ -143,8 +129,21 @@ class faustBpf1p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2p_H__
|
||||
|
|
@ -11,34 +15,38 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec3[2];
|
||||
double fRec4[2];
|
||||
double fVec1[2];
|
||||
|
|
@ -47,63 +55,40 @@ class faustBpf2p : public sfzFilterDsp {
|
|||
double fRec6[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -134,36 +119,37 @@ class faustBpf2p : public sfzFilterDsp {
|
|||
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
|
||||
fRec0[l9] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBpf2p* clone() {
|
||||
return new faustBpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -196,8 +182,24 @@ class faustBpf2p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf2pSv_H__
|
||||
|
|
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -114,36 +99,37 @@ class faustBpf2pSv : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBpf2pSv* clone() {
|
||||
return new faustBpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||
|
|
@ -164,8 +150,24 @@ class faustBpf2pSv : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf4p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fRec5[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -52,63 +60,40 @@ class faustBpf4p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -154,36 +139,37 @@ class faustBpf4p : public sfzFilterDsp {
|
|||
for (int l14 = 0; (l14 < 2); l14 = (l14 + 1)) {
|
||||
fRec0[l14] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBpf4p* clone() {
|
||||
return new faustBpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -226,8 +212,24 @@ class faustBpf4p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBpf6p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fRec7[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -57,63 +65,40 @@ class faustBpf6p : public sfzFilterDsp {
|
|||
double fVec8[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -174,36 +159,37 @@ class faustBpf6p : public sfzFilterDsp {
|
|||
for (int l19 = 0; (l19 < 2); l19 = (l19 + 1)) {
|
||||
fRec0[l19] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBpf6p* clone() {
|
||||
return new faustBpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = (0.5 * (fSlow2 / fSlow3));
|
||||
double fSlow5 = (fSlow4 + 1.0);
|
||||
double fSlow6 = (0.5 * (fSlow2 / (fSlow3 * fSlow5)));
|
||||
|
|
@ -256,8 +242,24 @@ class faustBpf6p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf1p_H__
|
||||
|
|
@ -11,90 +15,71 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBrf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -104,37 +89,38 @@ class faustBrf1p : public sfzFilterDsp {
|
|||
for (int l2 = 0; (l2 < 2); l2 = (l2 + 1)) {
|
||||
fRec0[l2] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBrf1p* clone() {
|
||||
return new faustBrf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (((fConst1 * double(fCutoff)) + -1.0) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (((fConst2 * double(fHslider0)) + -1.0) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec2[0] = (fSlow1 + (fSlow0 * fRec2[1]));
|
||||
fRec2[0] = ((fSlow0 * fRec2[1]) + fSlow1);
|
||||
fRec1[0] = (fTemp0 - (fRec2[0] * fRec1[1]));
|
||||
fRec0[0] = (fRec1[1] + (fRec2[0] * (fRec1[0] - fRec0[1])));
|
||||
output0[i] = FAUSTFLOAT((fTemp0 + (fRec0[1] + (fRec2[0] * fRec0[0]))));
|
||||
|
|
@ -142,8 +128,21 @@ class faustBrf1p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBrf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -45,63 +53,40 @@ class faustBrf2p : public sfzFilterDsp {
|
|||
double fVec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -126,35 +111,36 @@ class faustBrf2p : public sfzFilterDsp {
|
|||
for (int l7 = 0; (l7 < 2); l7 = (l7 + 1)) {
|
||||
fRec0[l7] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBrf2p* clone() {
|
||||
return new faustBrf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = (1.0 - fSlow0);
|
||||
double fSlow5 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow3) * fSlow4);
|
||||
|
|
@ -181,8 +167,24 @@ class faustBrf2p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustBrf2pSv_H__
|
||||
|
|
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustBrf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustBrf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec5[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec6[2];
|
||||
double fRec2[2];
|
||||
double fRec3[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec5[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -114,36 +99,37 @@ class faustBrf2pSv : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec3[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustBrf2pSv* clone() {
|
||||
return new faustBrf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec5[0] = ((fSlow0 * fRec5[1]) + fSlow2);
|
||||
|
|
@ -165,8 +151,24 @@ class faustBrf2pSv : public sfzFilterDsp {
|
|||
fRec2[1] = fRec2[0];
|
||||
fRec3[1] = fRec3[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustEqHshelf_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
@ -21,26 +25,30 @@ static double faustEqHshelf_faustpower2_f(double value) {
|
|||
return (value * value);
|
||||
}
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustEqHshelf
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustEqHshelf : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -51,64 +59,41 @@ class faustEqHshelf : public sfzFilterDsp {
|
|||
double fRec6[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -139,42 +124,43 @@ class faustEqHshelf : public sfzFilterDsp {
|
|||
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
|
||||
fRec0[l9] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustEqHshelf* clone() {
|
||||
return new faustEqHshelf();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = (faustEqHshelf_faustpower2_f(fSlow1) + 1.0);
|
||||
double fSlow6 = (fSlow1 + -1.0);
|
||||
double fSlow7 = faustEqHshelf_faustpower2_f(fSlow6);
|
||||
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = (fSlow3 * fSlow6);
|
||||
double fSlow8 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow5 / fSlow7) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow5) / fSlow7)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = (fSlow6 * fSlow3);
|
||||
double fSlow10 = ((fSlow1 + fSlow8) + (1.0 - fSlow9));
|
||||
double fSlow11 = (1.0 - fSlow0);
|
||||
double fSlow12 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow10) * fSlow11);
|
||||
|
|
@ -207,8 +193,27 @@ class faustEqHshelf : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustEqLshelf_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
|
@ -21,26 +25,30 @@ static double faustEqLshelf_faustpower2_f(double value) {
|
|||
return (value * value);
|
||||
}
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustEqLshelf
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustEqLshelf : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -51,64 +59,41 @@ class faustEqLshelf : public sfzFilterDsp {
|
|||
double fRec6[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -139,42 +124,43 @@ class faustEqLshelf : public sfzFilterDsp {
|
|||
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
|
||||
fRec0[l9] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustEqLshelf* clone() {
|
||||
return new faustEqLshelf();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = (fSlow1 + -1.0);
|
||||
double fSlow6 = (fSlow3 * fSlow5);
|
||||
double fSlow6 = (fSlow5 * fSlow3);
|
||||
double fSlow7 = (faustEqLshelf_faustpower2_f(fSlow1) + 1.0);
|
||||
double fSlow8 = faustEqLshelf_faustpower2_f(fSlow5);
|
||||
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fBandwidth) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
|
||||
double fSlow9 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, (1.0 / std::sqrt((((fSlow1 + (1.0 / fSlow1)) * ((1.0 / std::min<double>(((fSlow7 / fSlow8) + -0.01), std::max<double>(0.01, ((double(fVslider1) * fSlow7) / fSlow8)))) + -1.0)) + 2.0)))));
|
||||
double fSlow10 = (fSlow6 + fSlow9);
|
||||
double fSlow11 = ((fSlow1 + fSlow10) + 1.0);
|
||||
double fSlow12 = (1.0 - fSlow0);
|
||||
|
|
@ -207,8 +193,27 @@ class faustEqLshelf : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustEqPeak_H__
|
||||
|
|
@ -11,7 +15,7 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* link with : "" */
|
||||
#include <algorithm>
|
||||
|
|
@ -19,27 +23,31 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustEqPeak
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustEqPeak : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst3;
|
||||
FAUSTFLOAT fBandwidth;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -49,65 +57,42 @@ class faustEqPeak : public sfzFilterDsp {
|
|||
double fVec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
fConst3 = (2.1775860903036022 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fBandwidth = FAUSTFLOAT(1.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fVslider1 = FAUSTFLOAT(1.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -135,43 +120,44 @@ class faustEqPeak : public sfzFilterDsp {
|
|||
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
|
||||
fRec0[l8] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustEqPeak* clone() {
|
||||
return new faustEqPeak();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::max<double>(0.0, double(fCutoff));
|
||||
double fSlow1 = std::max<double>(0.0, double(fHslider0));
|
||||
double fSlow2 = (fConst2 * fSlow1);
|
||||
double fSlow3 = std::sin(fSlow2);
|
||||
double fSlow4 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fBandwidth)) / fSlow3)))))));
|
||||
double fSlow5 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow5 = std::max<double>(0.001, (0.5 / double(sinh(double((fConst3 * ((fSlow1 * double(fVslider1)) / fSlow3)))))));
|
||||
double fSlow6 = (0.5 * (fSlow3 / (fSlow4 * fSlow5)));
|
||||
double fSlow7 = (fSlow6 + 1.0);
|
||||
double fSlow8 = (1.0 - fSlow0);
|
||||
double fSlow9 = (((0.0 - (2.0 * std::cos(fSlow2))) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (0.5 * ((fSlow3 * fSlow5) / fSlow4));
|
||||
double fSlow10 = (0.5 * ((fSlow4 * fSlow3) / fSlow5));
|
||||
double fSlow11 = (((fSlow10 + 1.0) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((1.0 - fSlow10) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((1.0 - fSlow6) / fSlow7) * fSlow8);
|
||||
|
|
@ -197,8 +183,27 @@ class faustEqPeak : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getBandwidth() const { return fVslider1; }
|
||||
void setBandwidth(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf1p_H__
|
||||
|
|
@ -11,134 +15,129 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHpf1p* clone() {
|
||||
return new faustHpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
double fTemp1 = (fRec1[0] + 1.0);
|
||||
output0[i] = FAUSTFLOAT(((0.5 * (fRec0[0] * fTemp1)) + (fRec0[1] * (0.0 - (0.5 * fTemp1)))));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -46,63 +54,40 @@ class faustHpf2p : public sfzFilterDsp {
|
|||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,36 +115,37 @@ class faustHpf2p : public sfzFilterDsp {
|
|||
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
|
||||
fRec0[l8] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHpf2p* clone() {
|
||||
return new faustHpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -189,8 +175,24 @@ class faustHpf2p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf2pSv_H__
|
||||
|
|
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec4[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec3[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec4[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -114,36 +99,37 @@ class faustHpf2pSv : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHpf2pSv* clone() {
|
||||
return new faustHpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec4[0] = ((fSlow0 * fRec4[1]) + fSlow2);
|
||||
|
|
@ -164,8 +150,24 @@ class faustHpf2pSv : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf4p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec5[2];
|
||||
|
|
@ -51,63 +59,40 @@ class faustHpf4p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -150,36 +135,37 @@ class faustHpf4p : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec0[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHpf4p* clone() {
|
||||
return new faustHpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -220,8 +206,24 @@ class faustHpf4p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHpf6p_H__
|
||||
|
|
@ -11,32 +15,36 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec7[2];
|
||||
|
|
@ -56,63 +64,40 @@ class faustHpf6p : public sfzFilterDsp {
|
|||
double fVec8[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -170,36 +155,37 @@ class faustHpf6p : public sfzFilterDsp {
|
|||
for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
|
||||
fRec0[l18] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHpf6p* clone() {
|
||||
return new faustHpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::cos(fSlow1);
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))))));
|
||||
double fSlow3 = (0.5 * (std::sin(fSlow1) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow4 = (fSlow3 + 1.0);
|
||||
double fSlow5 = (1.0 - fSlow0);
|
||||
double fSlow6 = (((-1.0 - fSlow2) / fSlow4) * fSlow5);
|
||||
|
|
@ -251,8 +237,24 @@ class faustHpf6p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustHsh_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustHsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustHsh : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -48,64 +56,41 @@ class faustHsh : public sfzFilterDsp {
|
|||
double fRec6[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -136,46 +121,47 @@ class faustHsh : public sfzFilterDsp {
|
|||
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
|
||||
fRec0[l9] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustHsh* clone() {
|
||||
return new faustHsh();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
|
||||
double fSlow6 = ((fSlow1 + -1.0) * fSlow3);
|
||||
double fSlow7 = ((fSlow1 + fSlow5) + (1.0 - fSlow6));
|
||||
double fSlow8 = (1.0 - fSlow0);
|
||||
double fSlow9 = ((((0.0 - (2.0 * fSlow1)) * ((fSlow1 + fSlow4) + -1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (fSlow1 + fSlow6);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow5 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((fSlow1 * (fSlow10 + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((fSlow1 + (1.0 - (fSlow5 + fSlow6))) / fSlow7) * fSlow8);
|
||||
double fSlow10 = (fSlow6 + fSlow5);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow10) + 1.0)) / fSlow7) * fSlow8);
|
||||
double fSlow12 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow7) * fSlow8);
|
||||
double fSlow13 = (((fSlow1 + (1.0 - fSlow10)) / fSlow7) * fSlow8);
|
||||
double fSlow14 = ((2.0 * ((fSlow1 + (-1.0 - fSlow4)) / fSlow7)) * fSlow8);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
|
|
@ -201,8 +187,27 @@ class faustHsh : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider1; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf1p_H__
|
||||
|
|
@ -11,133 +15,128 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf1p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLpf1p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst1 = (1.0 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (1.0 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec1[l0] = 0.0;
|
||||
}
|
||||
for (int l1 = 0; (l1 < 2); l1 = (l1 + 1)) {
|
||||
fRec0[l1] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLpf1p* clone() {
|
||||
return new faustLpf1p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst1 * (0.0 - (6.2831853071795862 * double(fCutoff))))) * (1.0 - fSlow0));
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (std::exp((fConst2 * (0.0 - (6.2831853071795862 * double(fHslider0))))) * (1.0 - fSlow0));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec1[0] = (fSlow1 + (fSlow0 * fRec1[1]));
|
||||
fRec1[0] = ((fSlow0 * fRec1[1]) + fSlow1);
|
||||
fRec0[0] = (fTemp0 + (fRec1[0] * fRec0[1]));
|
||||
output0[i] = FAUSTFLOAT((fRec0[0] * (1.0 - fRec1[0])));
|
||||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2p_H__
|
||||
|
|
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLpf2p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -46,63 +54,40 @@ class faustLpf2p : public sfzFilterDsp {
|
|||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -130,35 +115,36 @@ class faustLpf2p : public sfzFilterDsp {
|
|||
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
|
||||
fRec0[l8] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLpf2p* clone() {
|
||||
return new faustLpf2p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -190,8 +176,24 @@ class faustLpf2p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf2pSv_H__
|
||||
|
|
@ -11,94 +15,75 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf2pSv
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLpf2pSv : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fHslider0;
|
||||
double fRec3[2];
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fRec4[2];
|
||||
double fRec5[2];
|
||||
double fRec1[2];
|
||||
double fRec2[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (3.1415926535897931 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec3[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -114,36 +99,37 @@ class faustLpf2pSv : public sfzFilterDsp {
|
|||
for (int l4 = 0; (l4 < 2); l4 = (l4 + 1)) {
|
||||
fRec2[l4] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLpf2pSv* clone() {
|
||||
return new faustLpf2pSv();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (1.0 - fSlow0);
|
||||
double fSlow2 = (std::tan((fConst2 * double(fCutoff))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow2 = (std::tan((fConst2 * double(fHslider0))) * fSlow1);
|
||||
double fSlow3 = (1.0 / std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
fRec3[0] = ((fSlow0 * fRec3[1]) + fSlow2);
|
||||
|
|
@ -164,8 +150,24 @@ class faustLpf2pSv : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec2[1] = fRec2[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf4p_H__
|
||||
|
|
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf4p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLpf4p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -51,63 +59,40 @@ class faustLpf4p : public sfzFilterDsp {
|
|||
double fVec5[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -150,35 +135,36 @@ class faustLpf4p : public sfzFilterDsp {
|
|||
for (int l13 = 0; (l13 < 2); l13 = (l13 + 1)) {
|
||||
fRec0[l13] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLpf4p* clone() {
|
||||
return new faustLpf4p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -221,8 +207,24 @@ class faustLpf4p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLpf6p_H__
|
||||
|
|
@ -11,31 +15,35 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLpf6p
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLpf6p : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
|
|
@ -56,63 +64,40 @@ class faustLpf6p : public sfzFilterDsp {
|
|||
double fVec8[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = (6.2831853071795862 / fConst0);
|
||||
fConst2 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -170,35 +155,36 @@ class faustLpf6p : public sfzFilterDsp {
|
|||
for (int l18 = 0; (l18 < 2); l18 = (l18 + 1)) {
|
||||
fRec0[l18] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLpf6p* clone() {
|
||||
return new faustLpf6p();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow0 = (fConst1 * std::max<double>(0.0, double(fHslider0)));
|
||||
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 fSlow2 = (0.5 * (std::sin(fSlow0) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))))));
|
||||
double fSlow3 = (fSlow2 + 1.0);
|
||||
double fSlow4 = ((1.0 - fSlow1) / fSlow3);
|
||||
double fSlow5 = (fSmoothEnable ? fConst2 : 0.0);
|
||||
|
|
@ -252,8 +238,24 @@ class faustLpf6p : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustLsh_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustLsh
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustLsh : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fVslider0;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -48,64 +56,41 @@ class faustLsh : public sfzFilterDsp {
|
|||
double fRec6[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -136,46 +121,47 @@ class faustLsh : public sfzFilterDsp {
|
|||
for (int l9 = 0; (l9 < 2); l9 = (l9 + 1)) {
|
||||
fRec0[l9] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustLsh* clone() {
|
||||
return new faustLsh();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = std::pow(10.0, (0.025000000000000001 * double(fVslider0)));
|
||||
double fSlow2 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow3 = std::cos(fSlow2);
|
||||
double fSlow4 = (fSlow3 * (fSlow1 + 1.0));
|
||||
double fSlow5 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ)))));
|
||||
double fSlow6 = (fSlow3 * (fSlow1 + -1.0));
|
||||
double fSlow7 = (fSlow1 + fSlow6);
|
||||
double fSlow8 = ((fSlow5 + fSlow7) + 1.0);
|
||||
double fSlow4 = ((fSlow1 + 1.0) * fSlow3);
|
||||
double fSlow5 = ((fSlow1 + -1.0) * fSlow3);
|
||||
double fSlow6 = ((std::sqrt(fSlow1) * std::sin(fSlow2)) / std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider1)))));
|
||||
double fSlow7 = (fSlow5 + fSlow6);
|
||||
double fSlow8 = ((fSlow1 + fSlow7) + 1.0);
|
||||
double fSlow9 = (1.0 - fSlow0);
|
||||
double fSlow10 = ((2.0 * ((fSlow1 * (fSlow1 + (-1.0 - fSlow4))) / fSlow8)) * fSlow9);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow5) + (1.0 - fSlow6))) / fSlow8) * fSlow9);
|
||||
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - (fSlow5 + fSlow6)))) / fSlow8) * fSlow9);
|
||||
double fSlow13 = (((fSlow7 + (1.0 - fSlow5)) / fSlow8) * fSlow9);
|
||||
double fSlow11 = (((fSlow1 * ((fSlow1 + fSlow6) + (1.0 - fSlow5))) / fSlow8) * fSlow9);
|
||||
double fSlow12 = (((fSlow1 * (fSlow1 + (1.0 - fSlow7))) / fSlow8) * fSlow9);
|
||||
double fSlow13 = ((((fSlow1 + fSlow5) + (1.0 - fSlow6)) / fSlow8) * fSlow9);
|
||||
double fSlow14 = (((0.0 - (2.0 * ((fSlow1 + fSlow4) + -1.0))) / fSlow8) * fSlow9);
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
|
|
@ -201,8 +187,27 @@ class faustLsh : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider1; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider0; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPeq_H__
|
||||
|
|
@ -11,33 +15,37 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPeq
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustPeq : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int fSampleRate;
|
||||
double fConst0;
|
||||
double fConst1;
|
||||
double fConst2;
|
||||
FAUSTFLOAT fCutoff;
|
||||
FAUSTFLOAT fQ;
|
||||
FAUSTFLOAT fPkShGain;
|
||||
FAUSTFLOAT fHslider0;
|
||||
FAUSTFLOAT fVslider0;
|
||||
FAUSTFLOAT fVslider1;
|
||||
double fRec2[2];
|
||||
double fVec0[2];
|
||||
double fRec3[2];
|
||||
|
|
@ -47,64 +55,41 @@ class faustPeq : public sfzFilterDsp {
|
|||
double fVec2[2];
|
||||
double fRec1[2];
|
||||
double fRec0[2];
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
fConst0 = std::min<double>(192000.0, std::max<double>(1.0, double(fSampleRate)));
|
||||
fConst0 = double(fSampleRate);
|
||||
fConst1 = std::exp((0.0 - (1000.0 / fConst0)));
|
||||
fConst2 = (6.2831853071795862 / fConst0);
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
fCutoff = FAUSTFLOAT(440.0);
|
||||
fQ = FAUSTFLOAT(0.0);
|
||||
fPkShGain = FAUSTFLOAT(0.0);
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
fHslider0 = FAUSTFLOAT(440.0);
|
||||
fVslider0 = FAUSTFLOAT(0.0);
|
||||
fVslider1 = FAUSTFLOAT(0.0);
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 2); l0 = (l0 + 1)) {
|
||||
fRec2[l0] = 0.0;
|
||||
}
|
||||
|
|
@ -132,42 +117,43 @@ class faustPeq : public sfzFilterDsp {
|
|||
for (int l8 = 0; (l8 < 2); l8 = (l8 + 1)) {
|
||||
fRec0[l8] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustPeq* clone() {
|
||||
return new faustPeq();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
double fSlow0 = (fSmoothEnable ? fConst1 : 0.0);
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fCutoff)));
|
||||
double fSlow1 = (fConst2 * std::max<double>(0.0, double(fHslider0)));
|
||||
double fSlow2 = std::sin(fSlow1);
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fQ))));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fPkShGain)));
|
||||
double fSlow3 = std::max<double>(0.001, std::pow(10.0, (0.050000000000000003 * double(fVslider0))));
|
||||
double fSlow4 = std::pow(10.0, (0.025000000000000001 * double(fVslider1)));
|
||||
double fSlow5 = (0.5 * (fSlow2 / (fSlow3 * fSlow4)));
|
||||
double fSlow6 = (fSlow5 + 1.0);
|
||||
double fSlow7 = (1.0 - fSlow0);
|
||||
double fSlow8 = (((0.0 - (2.0 * std::cos(fSlow1))) / fSlow6) * fSlow7);
|
||||
double fSlow9 = (0.5 * ((fSlow2 * fSlow4) / fSlow3));
|
||||
double fSlow9 = (0.5 * ((fSlow4 * fSlow2) / fSlow3));
|
||||
double fSlow10 = (((fSlow9 + 1.0) / fSlow6) * fSlow7);
|
||||
double fSlow11 = (((1.0 - fSlow9) / fSlow6) * fSlow7);
|
||||
double fSlow12 = (((1.0 - fSlow5) / fSlow6) * fSlow7);
|
||||
|
|
@ -193,8 +179,27 @@ class faustPeq : public sfzFilterDsp {
|
|||
fRec1[1] = fRec1[0];
|
||||
fRec0[1] = fRec0[0];
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
FAUSTFLOAT getCutoff() const { return fHslider0; }
|
||||
void setCutoff(FAUSTFLOAT value) { fHslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getResonance() const { return fVslider0; }
|
||||
void setResonance(FAUSTFLOAT value) { fVslider0 = value; }
|
||||
|
||||
FAUSTFLOAT getPeakShelfGain() const { return fVslider1; }
|
||||
void setPeakShelfGain(FAUSTFLOAT value) { fVslider1 = value; }
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#endif
|
||||
/* ------------------------------------------------------------
|
||||
author: "Jean Pierre Cimalando"
|
||||
license: "BSD-2-Clause"
|
||||
name: "sfz_filters"
|
||||
Code generated with Faust 2.20.2 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -double -ftz 0
|
||||
Code generated with Faust 2.30.5 (https://faust.grame.fr)
|
||||
Compilation options: -lang cpp -inpl -es 1 -double -ftz 0
|
||||
------------------------------------------------------------ */
|
||||
|
||||
#ifndef __faustPink_H__
|
||||
|
|
@ -11,107 +15,89 @@ Compilation options: -lang cpp -inpl -double -ftz 0
|
|||
|
||||
#ifndef FAUSTFLOAT
|
||||
#define FAUSTFLOAT float
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
|
||||
#ifndef FAUSTCLASS
|
||||
#ifndef FAUSTCLASS
|
||||
#define FAUSTCLASS faustPink
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#ifdef __APPLE__
|
||||
#define exp10f __exp10f
|
||||
#define exp10 __exp10
|
||||
#endif
|
||||
|
||||
|
||||
//[Before:class]
|
||||
class faustPink : public sfzFilterDsp {
|
||||
//[Begin:class]
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
double fRec0[4];
|
||||
int fSampleRate;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
void metadata(Meta* m) {
|
||||
}
|
||||
|
||||
virtual int getNumInputs() {
|
||||
static constexpr int getNumInputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getNumOutputs() {
|
||||
static constexpr int getNumOutputs() {
|
||||
return 1;
|
||||
}
|
||||
virtual int getInputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
virtual int getOutputRate(int channel) {
|
||||
int rate;
|
||||
switch ((channel)) {
|
||||
case 0: {
|
||||
rate = 1;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
rate = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
static void classInit(int sample_rate) {
|
||||
//[Begin:classInit]
|
||||
//[End:classInit]
|
||||
}
|
||||
|
||||
virtual void instanceConstants(int sample_rate) {
|
||||
|
||||
void instanceConstants(int sample_rate) {
|
||||
//[Begin:instanceConstants]
|
||||
fSampleRate = sample_rate;
|
||||
//[End:instanceConstants]
|
||||
}
|
||||
|
||||
virtual void instanceResetUserInterface() {
|
||||
|
||||
void instanceResetUserInterface() {
|
||||
//[Begin:instanceResetUserInterface]
|
||||
//[End:instanceResetUserInterface]
|
||||
}
|
||||
|
||||
virtual void instanceClear() {
|
||||
|
||||
void instanceClear() {
|
||||
//[Begin:instanceClear]
|
||||
for (int l0 = 0; (l0 < 4); l0 = (l0 + 1)) {
|
||||
fRec0[l0] = 0.0;
|
||||
}
|
||||
//[End:instanceClear]
|
||||
}
|
||||
|
||||
virtual void init(int sample_rate) {
|
||||
|
||||
void init(int sample_rate) {
|
||||
//[Begin:init]
|
||||
classInit(sample_rate);
|
||||
instanceInit(sample_rate);
|
||||
//[End:init]
|
||||
}
|
||||
virtual void instanceInit(int sample_rate) {
|
||||
void instanceInit(int sample_rate) {
|
||||
//[Begin:instanceInit]
|
||||
instanceConstants(sample_rate);
|
||||
instanceResetUserInterface();
|
||||
instanceClear();
|
||||
//[End:instanceInit]
|
||||
}
|
||||
|
||||
virtual faustPink* clone() {
|
||||
return new faustPink();
|
||||
}
|
||||
|
||||
virtual int getSampleRate() {
|
||||
|
||||
|
||||
int getSampleRate() {
|
||||
return fSampleRate;
|
||||
}
|
||||
|
||||
virtual void buildUserInterface(UI* ui_interface) {
|
||||
}
|
||||
|
||||
virtual void compute(int count, FAUSTFLOAT** inputs, FAUSTFLOAT** outputs) {
|
||||
FAUSTFLOAT* input0 = inputs[0];
|
||||
|
||||
|
||||
void compute(int count, FAUSTFLOAT const* const* inputs, FAUSTFLOAT* const* outputs) {
|
||||
//[Begin:compute]
|
||||
FAUSTFLOAT const* input0 = inputs[0];
|
||||
FAUSTFLOAT* output0 = outputs[0];
|
||||
for (int i = 0; (i < count); i = (i + 1)) {
|
||||
double fTemp0 = double(input0[i]);
|
||||
|
|
@ -121,8 +107,18 @@ class faustPink : public sfzFilterDsp {
|
|||
fRec0[j0] = fRec0[(j0 - 1)];
|
||||
}
|
||||
}
|
||||
//[End:compute]
|
||||
}
|
||||
|
||||
|
||||
//[End:class]
|
||||
};
|
||||
//[After:class]
|
||||
|
||||
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
#undef FAUSTFLOAT
|
||||
#undef FAUSTCLASS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue