BirdNet-goMikrofon/Arduino-audio-tools-main/arduino-audio-tools-main/examples/examples-dsp/examples-faust/streams-i2s-faust_guitarix-i2s/guitarix.h

585 lines
74 KiB
C
Raw Normal View History

2026-09-26 01:20:55 +02:00
/* ------------------------------------------------------------
author: "Guitarix project (http://guitarix.sourceforge.net/)"
copyright: "Guitarix project"
license: "LGPL"
name: "guitarix"
version: "0.29"
Code generated with Faust 2.40.12 (https://faust.grame.fr)
Compilation options: -lang cpp -es 1 -mcd 16 -single -ftz 0
------------------------------------------------------------ */
#ifndef __mydsp_H__
#define __mydsp_H__
#ifndef FAUSTFLOAT
#define FAUSTFLOAT float
#endif
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <math.h>
#ifndef FAUSTCLASS
#define FAUSTCLASS mydsp
#endif
#ifdef __APPLE__
#define exp10f __exp10f
#define exp10 __exp10
#endif
#if defined(_WIN32)
#define RESTRICT __restrict
#else
#define RESTRICT __restrict__
#endif
static const float fmydspSIG0Wave0[2001] = {249.987076f,249.986847f,249.986633f,249.986404f,249.986176f,249.985947f,249.985703f,249.985458f,249.985214f,249.98497f,249.984711f,249.984451f,249.984192f,249.983932f,249.983658f,249.983383f,249.983109f,249.982819f,249.982529f,249.982239f,249.981934f,249.981628f,249.981323f,249.981003f,249.980682f,249.980362f,249.980026f,249.979691f,249.979355f,249.979004f,249.978653f,249.978287f,249.977921f,249.977554f,249.977173f,249.976791f,249.976395f,249.975998f,249.975601f,249.975189f,249.974762f,249.97435f,249.973907f,249.97348f,249.973022f,249.972565f,249.972107f,249.971634f,249.971161f,249.970673f,249.970184f,249.969681f,249.969177f,249.968658f,249.968124f,249.96759f,249.967041f,249.966492f,249.965927f,249.965347f,249.964767f,249.964172f,249.963577f,249.962967f,249.962341f,249.961716f,249.96106f,249.960403f,249.959747f,249.959061f,249.958374f,249.957687f,249.95697f,249.956253f,249.955505f,249.954758f,249.95401f,249.953232f,249.952438f,249.951645f,249.950836f,249.950012f,249.949173f,249.948318f,249.947449f,249.946564f,249.945663f,249.944763f,249.943832f,249.942886f,249.941925f,249.940964f,249.939972f,249.938965f,249.937943f,249.93689f,249.935837f,249.934753f,249.93367f,249.932556f,249.931427f,249.930283f,249.929108f,249.927917f,249.926712f,249.925491f,249.92424f,249.922974f,249.921677f,249.920364f,249.919037f,249.917679f,249.916306f,249.914902f,249.913483f,249.912033f,249.910553f,249.909058f,249.907547f,249.905991f,249.904419f,249.902832f,249.901199f,249.899551f,249.897873f,249.896164f,249.89444f,249.89267f,249.890884f,249.889053f,249.887207f,249.88533f,249.883408f,249.88147f,249.879486f,249.877487f,249.875443f,249.873367f,249.871262f,249.86911f,249.866928f,249.864716f,249.862457f,249.860168f,249.857849f,249.855484f,249.853073f,249.850632f,249.848145f,249.845627f,249.843048f,249.840454f,249.837799f,249.835098f,249.832367f,249.829575f,249.826752f,249.823883f,249.820953f,249.817993f,249.814972f,249.811905f,249.808777f,249.805618f,249.802399f,249.799118f,249.795792f,249.792419f,249.788986f,249.785492f,249.781952f,249.778336f,249.774673f,249.77095f,249.767166f,249.763321f,249.759415f,249.755447f,249.751419f,249.747314f,249.743149f,249.738922f,249.734619f,249.730255f,249.725815f,249.721298f,249.716721f,249.712051f,249.707321f,249.702515f,249.697632f,249.692673f,249.687622f,249.682495f,249.677292f,249.671997f,249.666626f,249.661163f,249.655624f,249.649994f,249.644257f,249.638443f,249.632538f,249.626541f,249.620438f,249.614243f,249.607956f,249.601562f,249.595062f,249.58847f,249.581772f,249.574966f,249.568054f,249.561035f,249.553909f,249.546661f,249.539307f,249.53183f,249.524246f,249.516541f,249.508698f,249.500748f,249.492676f,249.484482f,249.476151f,249.467697f,249.459106f,249.450378f,249.441528f,249.432526f,249.423401f,249.414124f,249.404709f,249.395142f,249.385437f,249.375565f,249.365555f,249.355392f,249.345078f,249.334595f,249.323959f,249.313171f,249.3022f,249.291077f,249.27977f,249.268311f,249.256668f,249.244843f,249.232849f,249.220673f,249.208298f,249.195755f,249.183014f,249.17009f,249.156967f,249.143661f,249.130142f,249.116425f,249.102509f,249.088379f,249.074051f,249.059494f,249.044739f,249.029755f,249.014557f,248.99913f,248.98349f,248.967606f,248.951508f,248.935165f,248.918579f,248.901749f,248.884689f,248.867371f,248.849808f,248.832001f,248.813919f,248.795593f,248.776993f,248.758133f,248.739014f,248.719604f,248.699936f,248.679977f,248.659744f,248.639221f,248.618408f,248.597305f,248.575912f,248.554214f,248.532211f,248.509903f,248.487289f,248.464355f,248.441116f,248.417557f,248.393661f,248.369446f,248.344894f,248.320023f,248.2948f,248.269226f,248.243317f,248.217072f,248.19046f,248.163483f,248.136154f,248.108459f,248.080399f,248.051956f,248.023148f,247.993958f,247.964386f,247.934418f,247.904068f,247.873306f,247.842163f,247.810608f,247.778641f,247.746262f,247.71347f,247.680267f,247.646622f,247.612564f,247.578064f,247.543137f,247.507767f,247.471954f,247.435699f,247.398987f,247.361816f,247.324173f,247.286087f,247.247513f,247.208481f,247.168976f,247.128983f,247.088501f,247.047531f,247.006073f
class mydspSIG0 {
private:
int fmydspSIG0Wave0_idx;
public:
int getNumInputsmydspSIG0() {
return 0;
}
int getNumOutputsmydspSIG0() {
return 1;
}
void instanceInitmydspSIG0(int sample_rate) {
fmydspSIG0Wave0_idx = 0;
}
void fillmydspSIG0(int count, float* table) {
for (int i1 = 0; i1 < count; i1 = i1 + 1) {
table[i1] = fmydspSIG0Wave0[fmydspSIG0Wave0_idx];
fmydspSIG0Wave0_idx = (1 + fmydspSIG0Wave0_idx) % 2001;
}
}
};
static mydspSIG0* newmydspSIG0() { return (mydspSIG0*)new mydspSIG0(); }
static void deletemydspSIG0(mydspSIG0* dsp) { delete dsp; }
static const float fmydspSIG1Wave0[2001] = {249.987076f,249.986847f,249.986633f,249.986404f,249.986176f,249.985947f,249.985703f,249.985458f,249.985214f,249.98497f,249.984711f,249.984451f,249.984192f,249.983932f,249.983658f,249.983383f,249.983109f,249.982819f,249.982529f,249.982239f,249.981934f,249.981628f,249.981323f,249.981003f,249.980682f,249.980362f,249.980026f,249.979691f,249.979355f,249.979004f,249.978653f,249.978287f,249.977921f,249.977554f,249.977173f,249.976791f,249.976395f,249.975998f,249.975601f,249.975189f,249.974762f,249.97435f,249.973907f,249.97348f,249.973022f,249.972565f,249.972107f,249.971634f,249.971161f,249.970673f,249.970184f,249.969681f,249.969177f,249.968658f,249.968124f,249.96759f,249.967041f,249.966492f,249.965927f,249.965347f,249.964767f,249.964172f,249.963577f,249.962967f,249.962341f,249.961716f,249.96106f,249.960403f,249.959747f,249.959061f,249.958374f,249.957687f,249.95697f,249.956253f,249.955505f,249.954758f,249.95401f,249.953232f,249.952438f,249.951645f,249.950836f,249.950012f,249.949173f,249.948318f,249.947449f,249.946564f,249.945663f,249.944763f,249.943832f,249.942886f,249.941925f,249.940964f,249.939972f,249.938965f,249.937943f,249.93689f,249.935837f,249.934753f,249.93367f,249.932556f,249.931427f,249.930283f,249.929108f,249.927917f,249.926712f,249.925491f,249.92424f,249.922974f,249.921677f,249.920364f,249.919037f,249.917679f,249.916306f,249.914902f,249.913483f,249.912033f,249.910553f,249.909058f,249.907547f,249.905991f,249.904419f,249.902832f,249.901199f,249.899551f,249.897873f,249.896164f,249.89444f,249.89267f,249.890884f,249.889053f,249.887207f,249.88533f,249.883408f,249.88147f,249.879486f,249.877487f,249.875443f,249.873367f,249.871262f,249.86911f,249.866928f,249.864716f,249.862457f,249.860168f,249.857849f,249.855484f,249.853073f,249.850632f,249.848145f,249.845627f,249.843048f,249.840454f,249.837799f,249.835098f,249.832367f,249.829575f,249.826752f,249.823883f,249.820953f,249.817993f,249.814972f,249.811905f,249.808777f,249.805618f,249.802399f,249.799118f,249.795792f,249.792419f,249.788986f,249.785492f,249.781952f,249.778336f,249.774673f,249.77095f,249.767166f,249.763321f,249.759415f,249.755447f,249.751419f,249.747314f,249.743149f,249.738922f,249.734619f,249.730255f,249.725815f,249.721298f,249.716721f,249.712051f,249.707321f,249.702515f,249.697632f,249.692673f,249.687622f,249.682495f,249.677292f,249.671997f,249.666626f,249.661163f,249.655624f,249.649994f,249.644257f,249.638443f,249.632538f,249.626541f,249.620438f,249.614243f,249.607956f,249.601562f,249.595062f,249.58847f,249.581772f,249.574966f,249.568054f,249.561035f,249.553909f,249.546661f,249.539307f,249.53183f,249.524246f,249.516541f,249.508698f,249.500748f,249.492676f,249.484482f,249.476151f,249.467697f,249.459106f,249.450378f,249.441528f,249.432526f,249.423401f,249.414124f,249.404709f,249.395142f,249.385437f,249.375565f,249.365555f,249.355392f,249.345078f,249.334595f,249.323959f,249.313171f,249.3022f,249.291077f,249.27977f,249.268311f,249.256668f,249.244843f,249.232849f,249.220673f,249.208298f,249.195755f,249.183014f,249.17009f,249.156967f,249.143661f,249.130142f,249.116425f,249.102509f,249.088379f,249.074051f,249.059494f,249.044739f,249.029755f,249.014557f,248.99913f,248.98349f,248.967606f,248.951508f,248.935165f,248.918579f,248.901749f,248.884689f,248.867371f,248.849808f,248.832001f,248.813919f,248.795593f,248.776993f,248.758133f,248.739014f,248.719604f,248.699936f,248.679977f,248.659744f,248.639221f,248.618408f,248.597305f,248.575912f,248.554214f,248.532211f,248.509903f,248.487289f,248.464355f,248.441116f,248.417557f,248.393661f,248.369446f,248.344894f,248.320023f,248.2948f,248.269226f,248.243317f,248.217072f,248.19046f,248.163483f,248.136154f,248.108459f,248.080399f,248.051956f,248.023148f,247.993958f,247.964386f,247.934418f,247.904068f,247.873306f,247.842163f,247.810608f,247.778641f,247.746262f,247.71347f,247.680267f,247.646622f,247.612564f,247.578064f,247.543137f,247.507767f,247.471954f,247.435699f,247.398987f,247.361816f,247.324173f,247.286087f,247.247513f,247.208481f,247.168976f,247.128983f,247.088501f,247.047531f,247.006073f
class mydspSIG1 {
private:
int fmydspSIG1Wave0_idx;
public:
int getNumInputsmydspSIG1() {
return 0;
}
int getNumOutputsmydspSIG1() {
return 1;
}
void instanceInitmydspSIG1(int sample_rate) {
fmydspSIG1Wave0_idx = 0;
}
void fillmydspSIG1(int count, float* table) {
for (int i2 = 0; i2 < count; i2 = i2 + 1) {
table[i2] = fmydspSIG1Wave0[fmydspSIG1Wave0_idx];
fmydspSIG1Wave0_idx = (1 + fmydspSIG1Wave0_idx) % 2001;
}
}
};
static mydspSIG1* newmydspSIG1() { return (mydspSIG1*)new mydspSIG1(); }
static void deletemydspSIG1(mydspSIG1* dsp) { delete dsp; }
static const float fmydspSIG2Wave0[100] = {0.0f,-0.0296990145f,-0.0599780679f,-0.0908231661f,-0.122163236f,-0.15376009f,-0.184938014f,-0.214177266f,-0.239335433f,-0.259232581f,-0.274433911f,-0.286183298f,-0.295538545f,-0.303222328f,-0.309706241f,-0.315301329f,-0.320218444f,-0.324604988f,-0.328567117f,-0.332183361f,-0.335513115f,-0.338602364f,-0.341487259f,-0.344196707f,-0.346754223f,-0.349179149f,-0.351487488f,-0.35369277f,-0.35580641f,-0.357838273f,-0.359796762f,-0.36168924f,-0.363522142f,-0.365301102f,-0.367031157f,-0.368716747f,-0.370361924f,-0.371970236f,-0.373544991f,-0.375089139f,-0.376605392f,-0.378096253f,-0.379564017f,-0.38101083f,-0.38243863f,-0.383849323f,-0.385244638f,-0.386626214f,-0.38799566f,-0.389354438f,-0.390703976f,-0.392045677f,-0.393380851f,-0.394710839f,-0.396036893f,-0.397360265f,-0.398682207f,-0.40000397f,-0.401326776f,-0.402651846f,-0.403980494f,-0.405313969f,-0.406653613f,-0.408000737f,-0.409356743f,-0.41072312f,-0.412101358f,-0.413493067f,-0.414899886f,-0.416323662f,-0.417766303f,-0.419229805f,-0.420716405f,-0.422228485f,-0.42376864f,-0.425339758f,-0.426944911f,-0.428587586f,-0.430271626f,-0.432001382f,-0.433781654f,-0.435617924f,-0.437516481f,-0.439484537f,-0.441530377f,-0.443663776f,-0.445896149f,-0.448241174f,-0.450715303f,-0.453338623f,-0.456136048f,-0.45913893f,-0.462387681f,-0.465935349f,-0.469853997f,-0.474244624f,-0.479255259f,-0.485115886f,-0.492212713f,-0.501272738f};
class mydspSIG2 {
private:
int fmydspSIG2Wave0_idx;
public:
int getNumInputsmydspSIG2() {
return 0;
}
int getNumOutputsmydspSIG2() {
return 1;
}
void instanceInitmydspSIG2(int sample_rate) {
fmydspSIG2Wave0_idx = 0;
}
void fillmydspSIG2(int count, float* table) {
for (int i3 = 0; i3 < count; i3 = i3 + 1) {
table[i3] = fmydspSIG2Wave0[fmydspSIG2Wave0_idx];
fmydspSIG2Wave0_idx = (1 + fmydspSIG2Wave0_idx) % 100;
}
}
};
static mydspSIG2* newmydspSIG2() { return (mydspSIG2*)new mydspSIG2(); }
static void deletemydspSIG2(mydspSIG2* dsp) { delete dsp; }
static float mydsp_faustpower2_f(float value) {
return value * value;
}
static float ftbl0mydspSIG0[2001];
static float ftbl1mydspSIG1[2001];
static float ftbl2mydspSIG2[100];
class mydsp : public dsp {
private:
FAUSTFLOAT fVslider0;
int fSampleRate;
float fConst1;
FAUSTFLOAT fVslider1;
FAUSTFLOAT fVslider2;
float fConst2;
FAUSTFLOAT fVslider3;
float fConst6;
float fConst8;
float fConst9;
float fRec3[2];
float fConst11;
float fConst12;
float fConst13;
FAUSTFLOAT fVslider4;
float fConst14;
float fRec5[2];
float fConst16;
float fConst17;
float fRec8[2];
float fConst19;
float fConst20;
float fRec12[2];
float fConst21;
FAUSTFLOAT fVslider5;
float fVec0[2];
float fConst23;
float fConst24;
float fConst25;
FAUSTFLOAT fVslider6;
float fRec14[2];
float fVec1[2];
float fRec13[2];
FAUSTFLOAT fVslider7;
float fRec15[2];
float fRec11[3];
float fConst26;
float fConst27;
float fRec10[2];
float fVec2[2];
float fRec9[2];
float fRec7[3];
float fRec6[2];
float fVec3[2];
float fRec4[2];
float fRec2[3];
float fRec1[2];
FAUSTFLOAT fVslider8;
float fRec16[2];
float fConst28;
float fRec0[4];
int IOTA0;
float fVec4[256];
public:
void metadata(Meta* m) {
m->declare("author", "Guitarix project (http://guitarix.sourceforge.net/)");
m->declare("basics_lib_name", "Faust Basic Element Library");
m->declare("basics_lib_version", "0.6");
m->declare("compilation_options", "-single -scal -I libraries/ -I project/ -lang wasm");
m->declare("compile_options", "-lang cpp -es 1 -mcd 16 -single -ftz 0");
m->declare("copyright", "Guitarix project");
m->declare("filename", "guitarix.dsp");
m->declare("filters_lib_conv_author", "Julius O. Smith III");
m->declare("filters_lib_conv_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_conv_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_fir_author", "Julius O. Smith III");
m->declare("filters_lib_fir_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_fir_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_highpass_author", "Julius O. Smith III");
m->declare("filters_lib_highpass_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_iir_author", "Julius O. Smith III");
m->declare("filters_lib_iir_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_iir_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_lowpass0_highpass1", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_lowpass0_highpass1_author", "Julius O. Smith III");
m->declare("filters_lib_lowpass_author", "Julius O. Smith III");
m->declare("filters_lib_lowpass_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_lowpass_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_name", "Faust Filters Library");
m->declare("filters_lib_tf1_author", "Julius O. Smith III");
m->declare("filters_lib_tf1_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_tf1_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_tf1s_author", "Julius O. Smith III");
m->declare("filters_lib_tf1s_copyright", "Copyright (C) 2003-2019 by Julius O. Smith III <jos@ccrma.stanford.edu>");
m->declare("filters_lib_tf1s_license", "MIT-style STK-4.3 license");
m->declare("filters_lib_version", "0.3");
m->declare("library_path0", "/libraries/tonestacks.lib");
m->declare("library_path1", "/libraries/tubes.lib");
m->declare("library_path2", "/libraries/filters.lib");
m->declare("library_path3", "/libraries/maths.lib");
m->declare("library_path4", "/libraries/platform.lib");
m->declare("library_path5", "/libraries/basics.lib");
m->declare("library_path6", "/libraries/signals.lib");
m->declare("license", "LGPL");
m->declare("maths_lib_author", "GRAME");
m->declare("maths_lib_copyright", "GRAME");
m->declare("maths_lib_license", "LGPL with exception");
m->declare("maths_lib_name", "Faust Math Library");
m->declare("maths_lib_version", "2.5");
m->declare("name", "guitarix");
m->declare("platform_lib_name", "Generic Platform Library");
m->declare("platform_lib_version", "0.2");
m->declare("signals_lib_name", "Faust Signal Routing Library");
m->declare("signals_lib_version", "0.1");
m->declare("tonestacks_lib_author", "Guitarix project (<http://guitarix.sourceforge.net/>)");
m->declare("tonestacks_lib_copyright", "Guitarix project");
m->declare("tonestacks_lib_license", "LGPL");
m->declare("tonestacks_lib_name", "Faust Tonestack Emulation Library");
m->declare("tonestacks_lib_version", "0.28");
m->declare("version", "0.29");
}
virtual int getNumInputs() {
return 1;
}
virtual int getNumOutputs() {
return 1;
}
static void classInit(int sample_rate) {
mydspSIG0* sig0 = newmydspSIG0();
sig0->instanceInitmydspSIG0(sample_rate);
sig0->fillmydspSIG0(2001, ftbl0mydspSIG0);
mydspSIG1* sig1 = newmydspSIG1();
sig1->instanceInitmydspSIG1(sample_rate);
sig1->fillmydspSIG1(2001, ftbl1mydspSIG1);
mydspSIG2* sig2 = newmydspSIG2();
sig2->instanceInitmydspSIG2(sample_rate);
sig2->fillmydspSIG2(100, ftbl2mydspSIG2);
deletemydspSIG0(sig0);
deletemydspSIG1(sig1);
deletemydspSIG2(sig2);
}
virtual void instanceConstants(int sample_rate) {
fSampleRate = sample_rate;
float fConst0 = std::min<float>(192000.0f, std::max<float>(1.0f, float(fSampleRate)));
fConst1 = 2.0f * fConst0;
fConst2 = mydsp_faustpower2_f(fConst1);
float fConst3 = std::tan(97.3893738f / fConst0);
float fConst4 = 1.0f / fConst3;
float fConst5 = fConst4 + 1.0f;
fConst6 = 1.0f / (fConst3 * fConst5);
float fConst7 = 1.0f / std::tan(609.468994f / fConst0);
fConst8 = 1.0f / (fConst7 + 1.0f);
fConst9 = 1.0f - fConst7;
float fConst10 = 1.0f / std::tan(20517.7422f / fConst0);
fConst11 = 1.0f / (fConst10 + 1.0f);
fConst12 = 1.0f - fConst10;
fConst13 = 44.0999985f / fConst0;
fConst14 = 1.0f - fConst13;
float fConst15 = 1.0f / std::tan(414.690216f / fConst0);
fConst16 = 1.0f / (fConst15 + 1.0f);
fConst17 = 1.0f - fConst15;
float fConst18 = 1.0f / std::tan(270.176971f / fConst0);
fConst19 = 1.0f / (fConst18 + 1.0f);
fConst20 = 1.0f - fConst18;
fConst21 = 3.14159274f / fConst0;
float fConst22 = 0.000441799988f * fConst0;
fConst23 = 1.0f / (fConst22 + 1.0f);
fConst24 = 1.0f - fConst22;
fConst25 = 9.40000007e-08f * fConst0;
fConst26 = 0.0f - fConst6;
fConst27 = (1.0f - fConst4) / fConst5;
fConst28 = 3.0f * fConst1;
}
virtual void instanceResetUserInterface() {
fVslider0 = FAUSTFLOAT(100.0f);
fVslider1 = FAUSTFLOAT(0.5f);
fVslider2 = FAUSTFLOAT(0.5f);
fVslider3 = FAUSTFLOAT(0.5f);
fVslider4 = FAUSTFLOAT(-6.0f);
fVslider5 = FAUSTFLOAT(400.0f);
fVslider6 = FAUSTFLOAT(0.5f);
fVslider7 = FAUSTFLOAT(-16.0f);
fVslider8 = FAUSTFLOAT(-6.0f);
}
virtual void instanceClear() {
for (int l0 = 0; l0 < 2; l0 = l0 + 1) {
fRec3[l0] = 0.0f;
}
for (int l1 = 0; l1 < 2; l1 = l1 + 1) {
fRec5[l1] = 0.0f;
}
for (int l2 = 0; l2 < 2; l2 = l2 + 1) {
fRec8[l2] = 0.0f;
}
for (int l3 = 0; l3 < 2; l3 = l3 + 1) {
fRec12[l3] = 0.0f;
}
for (int l4 = 0; l4 < 2; l4 = l4 + 1) {
fVec0[l4] = 0.0f;
}
for (int l5 = 0; l5 < 2; l5 = l5 + 1) {
fRec14[l5] = 0.0f;
}
for (int l6 = 0; l6 < 2; l6 = l6 + 1) {
fVec1[l6] = 0.0f;
}
for (int l7 = 0; l7 < 2; l7 = l7 + 1) {
fRec13[l7] = 0.0f;
}
for (int l8 = 0; l8 < 2; l8 = l8 + 1) {
fRec15[l8] = 0.0f;
}
for (int l9 = 0; l9 < 3; l9 = l9 + 1) {
fRec11[l9] = 0.0f;
}
for (int l10 = 0; l10 < 2; l10 = l10 + 1) {
fRec10[l10] = 0.0f;
}
for (int l11 = 0; l11 < 2; l11 = l11 + 1) {
fVec2[l11] = 0.0f;
}
for (int l12 = 0; l12 < 2; l12 = l12 + 1) {
fRec9[l12] = 0.0f;
}
for (int l13 = 0; l13 < 3; l13 = l13 + 1) {
fRec7[l13] = 0.0f;
}
for (int l14 = 0; l14 < 2; l14 = l14 + 1) {
fRec6[l14] = 0.0f;
}
for (int l15 = 0; l15 < 2; l15 = l15 + 1) {
fVec3[l15] = 0.0f;
}
for (int l16 = 0; l16 < 2; l16 = l16 + 1) {
fRec4[l16] = 0.0f;
}
for (int l17 = 0; l17 < 3; l17 = l17 + 1) {
fRec2[l17] = 0.0f;
}
for (int l18 = 0; l18 < 2; l18 = l18 + 1) {
fRec1[l18] = 0.0f;
}
for (int l19 = 0; l19 < 2; l19 = l19 + 1) {
fRec16[l19] = 0.0f;
}
for (int l20 = 0; l20 < 4; l20 = l20 + 1) {
fRec0[l20] = 0.0f;
}
IOTA0 = 0;
for (int l21 = 0; l21 < 256; l21 = l21 + 1) {
fVec4[l21] = 0.0f;
}
}
virtual void init(int sample_rate) {
classInit(sample_rate);
instanceInit(sample_rate);
}
virtual void instanceInit(int sample_rate) {
instanceConstants(sample_rate);
instanceResetUserInterface();
instanceClear();
}
virtual mydsp* clone() {
return new mydsp();
}
virtual int getSampleRate() {
return fSampleRate;
}
virtual void buildUserInterface(UI* ui_interface) {
ui_interface->openHorizontalBox("Guitarix");
ui_interface->declare(0, "0", "");
ui_interface->openHorizontalBox("TubeScreamer");
ui_interface->declare(&fVslider6, "name", "Drive");
ui_interface->declare(&fVslider6, "style", "knob");
ui_interface->addVerticalSlider("drive", &fVslider6, FAUSTFLOAT(0.5f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.00999999978f));
ui_interface->declare(&fVslider7, "name", "Level");
ui_interface->declare(&fVslider7, "style", "knob");
ui_interface->addVerticalSlider("level", &fVslider7, FAUSTFLOAT(-16.0f), FAUSTFLOAT(-20.0f), FAUSTFLOAT(4.0f), FAUSTFLOAT(0.100000001f));
ui_interface->declare(&fVslider5, "log", "");
ui_interface->declare(&fVslider5, "name", "Tone");
ui_interface->declare(&fVslider5, "style", "knob");
ui_interface->addVerticalSlider("tone", &fVslider5, FAUSTFLOAT(400.0f), FAUSTFLOAT(100.0f), FAUSTFLOAT(1000.0f), FAUSTFLOAT(1.02999997f));
ui_interface->closeBox();
ui_interface->declare(0, "1", "");
ui_interface->openHorizontalBox("preamp: 12AX7");
ui_interface->declare(&fVslider4, "0", "");
ui_interface->declare(&fVslider4, "style", "knob");
ui_interface->addVerticalSlider("Pregain", &fVslider4, FAUSTFLOAT(-6.0f), FAUSTFLOAT(-20.0f), FAUSTFLOAT(20.0f), FAUSTFLOAT(0.100000001f));
ui_interface->declare(&fVslider8, "1", "");
ui_interface->declare(&fVslider8, "style", "knob");
ui_interface->addVerticalSlider("Gain", &fVslider8, FAUSTFLOAT(-6.0f), FAUSTFLOAT(-20.0f), FAUSTFLOAT(20.0f), FAUSTFLOAT(0.100000001f));
ui_interface->closeBox();
ui_interface->declare(0, "2", "");
ui_interface->openHorizontalBox("tonestack: jcm2000");
ui_interface->declare(&fVslider3, "2", "");
ui_interface->declare(&fVslider3, "style", "knob");
ui_interface->addVerticalSlider("Treble", &fVslider3, FAUSTFLOAT(0.5f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.00999999978f));
ui_interface->declare(&fVslider1, "3", "");
ui_interface->declare(&fVslider1, "style", "knob");
ui_interface->addVerticalSlider("Middle", &fVslider1, FAUSTFLOAT(0.5f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.00999999978f));
ui_interface->declare(&fVslider2, "4", "");
ui_interface->declare(&fVslider2, "style", "knob");
ui_interface->addVerticalSlider("Bass", &fVslider2, FAUSTFLOAT(0.5f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.00999999978f));
ui_interface->closeBox();
ui_interface->declare(0, "3", "");
ui_interface->openHorizontalBox("Cabinet");
ui_interface->declare(&fVslider0, "5", "");
ui_interface->declare(&fVslider0, "style", "knob");
ui_interface->addVerticalSlider("amount", &fVslider0, FAUSTFLOAT(100.0f), FAUSTFLOAT(0.0f), FAUSTFLOAT(100.0f), FAUSTFLOAT(1.0f));
ui_interface->closeBox();
ui_interface->closeBox();
}
virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) {
FAUSTFLOAT* input0 = inputs[0];
FAUSTFLOAT* output0 = outputs[0];
float fSlow0 = float(fVslider0);
float fSlow1 = float(fVslider1);
float fSlow2 = std::exp(3.4000001f * (float(fVslider2) + -1.0f));
float fSlow3 = 0.000549999997f * fSlow1 + 0.0225000009f * fSlow2;
float fSlow4 = fConst1 * (fSlow3 + 0.0031514999f);
float fSlow5 = 3.09374997e-07f * fSlow1;
float fSlow6 = fSlow1 * ((1.23749996e-05f * fSlow2 + -2.99475005e-07f) - fSlow5) + 3.10860014e-05f * fSlow2 + 1.08514996e-06f;
float fSlow7 = 1.8513e-09f * fSlow2 - 4.62824987e-11f * fSlow1;
float fSlow8 = 3.3880001e-09f * fSlow2;
float fSlow9 = fSlow1 * (fSlow7 + -3.84174983e-11f) + fSlow8 + 8.4699997e-11f;
float fSlow10 = fConst1 * fSlow9;
float fSlow11 = -1.0f - (fSlow4 + fConst2 * (fSlow6 + fSlow10));
float fSlow12 = (1.0f - 0.00999999978f * fSlow0 + 4.88281012e-06f * fSlow0) / fSlow11;
float fSlow13 = float(fVslider3);
float fSlow14 = fConst1 * (fSlow3 + 0.000125000006f * fSlow13 + 0.000562499976f);
float fSlow15 = 3.08000011e-07f * fSlow13 + fSlow1 * (3.78125009e-07f - fSlow5) + fSlow2 * (1.23749996e-05f * fSlow1 + 3.98200018e-06f) + 9.95500002e-08f;
float fSlow16 = fSlow1 * (fSlow7 + 4.62824987e-11f) + fSlow13 * (fSlow8 - 8.4699997e-11f * (fSlow1 + -1.0f));
float fSlow17 = fConst1 * fSlow16;
float fSlow18 = 0.0f - (fSlow14 + fConst2 * (fSlow15 + fSlow17));
float fSlow19 = fConst13 * std::pow(10.0f, 0.0500000007f * float(fVslider4));
float fSlow20 = 1.0f / std::tan(fConst21 * float(fVslider5));
float fSlow21 = 1.0f / (fSlow20 + 1.0f);
float fSlow22 = 1.0f - fSlow20;
float fSlow23 = fConst25 * (500000.0f * float(fVslider6) + 55700.0f);
float fSlow24 = fSlow23 + 1.0f;
float fSlow25 = 1.0f - fSlow23;
float fSlow26 = fConst13 * std::pow(10.0f, 0.0500000007f * float(fVslider7));
float fSlow27 = fConst13 * std::pow(10.0f, 0.0500000007f * float(fVslider8));
float fSlow28 = 1.0f / fSlow11;
float fSlow29 = fConst28 * fSlow9;
float fSlow30 = fConst2 * (fSlow6 + fSlow29) + -3.0f - fSlow4;
float fSlow31 = fSlow4 + fConst2 * (fSlow6 - fSlow29) + -3.0f;
float fSlow32 = fSlow4 + -1.0f - fConst2 * (fSlow6 - fSlow10);
float fSlow33 = fConst28 * fSlow16;
float fSlow34 = fConst2 * (fSlow15 + fSlow33) - fSlow14;
float fSlow35 = fSlow14 + fConst2 * (fSlow15 - fSlow33);
float fSlow36 = fSlow14 - fConst2 * (fSlow15 - fSlow17);
float fSlow37 = 0.00999999978f * fSlow0 / fSlow11;
for (int i0 = 0; i0 < count; i0 = i0 + 1) {
fRec3[0] = fConst8 * (0.00820000004f * (fRec2[1] + fRec2[2]) - fConst9 * fRec3[1]);
fRec5[0] = fSlow19 + fConst14 * fRec5[1];
fRec8[0] = fConst16 * (0.0149999997f * (fRec7[1] + fRec7[2]) - fConst17 * fRec8[1]);
fRec12[0] = fConst19 * (0.0270000007f * (fRec11[1] + fRec11[2]) - fConst20 * fRec12[1]);
float fTemp0 = float(input0[i0]);
fVec0[0] = fTemp0;
fRec14[0] = 0.0f - fConst23 * (fConst24 * fRec14[1] - (fSlow24 * fTemp0 + fSlow25 * fVec0[1]));
float fTemp1 = fRec14[0] - fTemp0;
float fTemp2 = std::fabs(fTemp1);
float fTemp3 = 101.970001f * fTemp2 / (fTemp2 + 3.0f);
float fTemp4 = std::max<float>(0.0f, std::min<float>(98.0f, std::floor(fTemp3)));
float fElse2 = fTemp3 - fTemp4;
float fThen3 = ((fTemp4 < 98.0f) ? fElse2 : 98.0f);
float fTemp5 = ((0.0f < fTemp4) ? 0.0f : fThen3);
float fTemp6 = fTemp0 - float(((fTemp2 * float(((fTemp1 < 0.0f) ? 1 : -1)) < 0.0f) ? -1 : 1)) * std::fabs(ftbl2mydspSIG2[int(fTemp4)] * (1.0f - fTemp5) + fTemp5 * ftbl2mydspSIG2[int(fTemp4 + 1.0f)]);
fVec1[0] = fTemp6;
fRec13[0] = 0.0f - fSlow21 * (fSlow22 * fRec13[1] - (fTemp6 + fVec1[1]));
fRec15[0] = fSlow26 + fConst14 * fRec15[1];
float fTemp7 = 200.0f * (fRec12[0] + fRec13[0] * fRec15[0] + 3.41834402f);
float fTemp8 = std::max<float>(0.0f, std::min<float>(1999.0f, std::floor(fTemp7)));
float fElse4 = fTemp7 - fTemp8;
float fThen5 = ((fTemp8 < 1999.0f) ? fElse4 : 1999.0f);
float fTemp9 = ((0.0f < fTemp8) ? 0.0f : fThen5);
fRec11[0] = ftbl1mydspSIG1[int(fTemp8)] * (1.0f - fTemp9) + fTemp9 * ftbl1mydspSIG1[int(fTemp8 + 1.0f)] + -191.420151f;
fRec10[0] = 0.0250000004f * (fConst6 * fRec11[0] + fConst26 * fRec11[1]) - fConst27 * fRec10[1];
float fTemp10 = fRec10[0] * fRec5[0];
fVec2[0] = fTemp10;
fRec9[0] = 0.0f - fConst11 * (fConst12 * fRec9[1] - (fTemp10 + fVec2[1]));
float fTemp11 = 200.0f * (fRec8[0] + fRec9[0] + 3.79571509f);
float fTemp12 = std::max<float>(0.0f, std::min<float>(1999.0f, std::floor(fTemp11)));
float fElse6 = fTemp11 - fTemp12;
float fThen7 = ((fTemp12 < 1999.0f) ? fElse6 : 1999.0f);
float fTemp13 = ((0.0f < fTemp12) ? 0.0f : fThen7);
fRec7[0] = ftbl0mydspSIG0[int(fTemp12)] * (1.0f - fTemp13) + fTemp13 * ftbl0mydspSIG0[int(fTemp12 + 1.0f)] + -169.71434f;
fRec6[0] = 0.0250000004f * (fConst6 * fRec7[0] + fConst26 * fRec7[1]) - fConst27 * fRec6[1];
float fTemp14 = fRec5[0] * fRec6[0];
fVec3[0] = fTemp14;
fRec4[0] = 0.0f - fConst11 * (fConst12 * fRec4[1] - (fTemp14 + fVec3[1]));
float fTemp15 = 200.0f * (fRec3[0] + fRec4[0] + 4.15929699f);
float fTemp16 = std::max<float>(0.0f, std::min<float>(1999.0f, std::floor(fTemp15)));
float fElse8 = fTemp15 - fTemp16;
float fThen9 = ((fTemp16 < 1999.0f) ? fElse8 : 1999.0f);
float fTemp17 = ((0.0f < fTemp16) ? 0.0f : fThen9);
fRec2[0] = ftbl0mydspSIG0[int(fTemp16)] * (1.0f - fTemp17) + fTemp17 * ftbl0mydspSIG0[int(fTemp16 + 1.0f)] + -147.47525f;
fRec1[0] = 0.0250000004f * (fConst6 * fRec2[0] + fConst26 * fRec2[1]) - fConst27 * fRec1[1];
fRec16[0] = fSlow27 + fConst14 * fRec16[1];
fRec0[0] = fRec1[0] * fRec16[0] - fSlow28 * (fSlow30 * fRec0[1] + fSlow31 * fRec0[2] + fSlow32 * fRec0[3]);
float fTemp18 = fSlow18 * fRec0[0] + fSlow34 * fRec0[1] + fSlow35 * fRec0[2] + fSlow36 * fRec0[3];
float fTemp19 = fSlow37 * fTemp18;
fVec4[IOTA0 & 255] = fTemp19;
output0[i0] = FAUSTFLOAT((fSlow12 * fTemp18 + 0.75f * (fVec4[(IOTA0 - 24) & 255] + fVec4[(IOTA0 - 88) & 255]) + 0.000720214972f * fVec4[(IOTA0 - 63) & 255] + 0.000402831996f * fVec4[(IOTA0 - 62) & 255] + 0.00170897995f * fVec4[(IOTA0 - 61) & 255] + 0.00140380999f * fVec4[(IOTA0 - 60) & 255] + 0.00294188992f * fVec4[(IOTA0 - 59) & 255] + 0.00272216997f * fVec4[(IOTA0 - 58) & 255] + 0.00455321977f * fVec4[(IOTA0 - 57) & 255] + 0.00458983984f * fVec4[(IOTA0 - 56) & 255] + 0.00677490002f * fVec4[(IOTA0 - 55) & 255] + 0.0071899402f * fVec4[(IOTA0 - 54) & 255] + 0.00942382962f * fVec4[(IOTA0 - 53) & 255] + 0.0103882002f * fVec4[(IOTA0 - 52) & 255] + 0.0130005004f * fVec4[(IOTA0 - 51) & 255] + 0.0157226995f * fVec4[(IOTA0 - 50) & 255] + 0.0182006992f * fVec4[(IOTA0 - 49) & 255] + 0.0217285007f * fVec4[(IOTA0 - 48) & 255] + 0.0232299995f * fVec4[(IOTA0 - 47) & 255] + 0.0320556983f * fVec4[(IOTA0 - 46) & 255] + 0.0339844003f * fVec4[(IOTA0 - 45) & 255] + 0.0429931991f * fVec4[(IOTA0 - 44) & 255] + 0.0400390998f * fVec4[(IOTA0 - 43) & 255] + 0.0661742985f * fVec4[(IOTA0 - 42) & 255] + 0.0591797009f * fVec4[(IOTA0 - 41) & 255] + 0.0739867985f * fVec4[(IOTA0 - 40) & 255] + 0.0805054009f * fVec4[(IOTA0 - 39) & 255] + 0.123303004f * fVec4[(IOTA0 - 38) & 255] + 0.0540039018f * fVec4[(IOTA0 - 37) & 255] + 0.186620995f * fVec4[(IOTA0 - 36) & 255] + 0.0443480983f * fVec4[(IOTA0 - 35) & 255] + 0.164684996f * fVec4[(IOTA0 - 34) & 255] + 0.0312134009f * fVec4[(IOTA0 - 33) & 255] + 0.0267334003f * fVec4[(IOTA0 - 32) & 255] + 0.200696006f * fVec4[(IOTA0 - 27) & 255] + 0.399962991f * fVec4[(IOTA0 - 26) & 255] + 0.312427014f * fVec4[(IOTA0 - 23) & 255] + 0.0953003019f * fVec4[(IOTA0 - 21) & 255] + 0.0202147998f * fVec4[(IOTA0 - 19) & 255] + 0.00706786988f * fVec4[(IOTA0 - 17) & 255] + 0.000146484002f * fVec4[(IOTA0 - 8) & 255] + 0.000512694998f * fVec4[(IOTA0 - 6) & 255] + 0.000561523018f * fVec4[(IOTA0 - 2) & 255] + 0.000634766009f * fVec4[(IOTA0 - 4) & 255]) - (0.00252685999f * (fVec4[(IOTA0 - 84) & 255] + fVec4[(IOTA0 - 103) & 255] + fVec4[(IOTA0 - 105) & 255] + fVec4[(IOTA0 - 121) & 255] + fVec4[(IOTA0 - 123) & 255] + fVec4[(IOTA0 - 125) & 255] + fVec4[(IOTA0 - 127) & 255] + fVec4[(IOTA0 - 129) & 255] + fVec4[(IOTA0 - 131) & 255]) + 0.00251465011f * (fVec4[(IOTA0 - 97) & 255] + fVec4[(IOTA0 - 99) & 255] + fVec4[(IOTA0 - 101) & 255] + fVec4[(IOTA0 - 107) & 255] + fVec4[(IOTA0 - 109) & 255] + fVec4[(IOTA0 - 111) & 255] + fVec4[(IOTA0 - 113) & 255] + fVec4[(IOTA0 - 115) & 255] + fVec4[(IOTA0 - 117) & 255] + fVec4[(IOTA0 - 119) & 255]) + 0.00257567992f * fVec4[(IOTA0 - 108) & 255] + 0.00258789002f * (fVec4[(IOTA0 - 104) & 255] + fVec4[(IOTA0 - 106) & 255]) + 0.00260009989f * (fVec4[(IOTA0 - 90) & 255] + fVec4[(IOTA0 - 92) & 255] + fVec4[(IOTA0 - 94) & 255] + fVec4[(IOTA0 - 96) & 255] + fVec4[(IOTA0 - 98) & 255] + fVec4[(IOTA0 - 100) & 255] + fVec4[(IOTA0 - 102) & 255]) + 0.00250244001f * fVec4[(IOTA0 - 95) & 255] + 0.0024902299f * fVec4[(IOTA0 - 93) & 255] + 0.00247803004f * ((fVec4[(IOTA0 - 5) & 255] + fVec4[(IOTA0 - 7) & 255]) - fVec4[(IOTA0 - 15) & 255] + fVec4[(IOTA0 - 82) & 255] + fVec4[(IOTA0 - 91) & 255]) + 0.00246581994f * fVec4[(IOTA0 - 89) & 255] + 0.0024292001f * (fVec4[(IOTA0 - 80) & 255] + fVec4[(IOTA0 - 87) & 255]) + 0.00238036993f * fVec4[(IOTA0 - 85) & 255] + 0.00233153999f * fVec4[(IOTA0 - 83) & 255] + 0.00225830008f * fVec4[(IOTA0 - 81) & 255] + 0.00217285007f * fVec4[(IOTA0 - 79) & 255] + 0.00235595996f * fVec4[(IOTA0 - 78) & 255] + 0.00203856989f * fVec4[(IOTA0 - 77) & 255] + 0.00224608998f * fVec4[(IOTA0 - 76) & 255] + 0.00187987997f * fVec4[(IOTA0 - 75) & 255] + 0.00208740006f * fVec4[(IOTA0 - 74) & 255] + 0.00190429995f * fVec4[(IOTA0 - 72) & 255] + 0.0013916f * fVec4[(IOTA0 - 71) & 255] + 0.00104979996f * fVec4[(IOTA0 - 69) & 255] + 0.00134276995f * fVec4[(IOTA0 - 68) & 255] + 0.000610352028f * fVec4[(IOTA0 - 67) & 255] + 0.000915526995f * fVec4[(IOTA0 - 66) & 255] + 2.44140992e-05f * (fVec4[(IOTA0 - 13) & 255] + fVec4[(IOTA0 - 65) & 255]) + 0.000354004005f * fVec4[(IOTA0 - 64) & 255] + 0.00166016002f * (fVec4[(IOTA0
fRec3[1] = fRec3[0];
fRec5[1] = fRec5[0];
fRec8[1] = fRec8[0];
fRec12[1] = fRec12[0];
fVec0[1] = fVec0[0];
fRec14[1] = fRec14[0];
fVec1[1] = fVec1[0];
fRec13[1] = fRec13[0];
fRec15[1] = fRec15[0];
fRec11[2] = fRec11[1];
fRec11[1] = fRec11[0];
fRec10[1] = fRec10[0];
fVec2[1] = fVec2[0];
fRec9[1] = fRec9[0];
fRec7[2] = fRec7[1];
fRec7[1] = fRec7[0];
fRec6[1] = fRec6[0];
fVec3[1] = fVec3[0];
fRec4[1] = fRec4[0];
fRec2[2] = fRec2[1];
fRec2[1] = fRec2[0];
fRec1[1] = fRec1[0];
fRec16[1] = fRec16[0];
for (int j0 = 3; j0 > 0; j0 = j0 - 1) {
fRec0[j0] = fRec0[j0 - 1];
}
IOTA0 = IOTA0 + 1;
}
}
};
#endif