Last active
August 26, 2023 11:31
-
-
Save sletz/992d1f0ce6096600542c3ca1eb4fff34 to your computer and use it in GitHub Desktop.
Ciaramella log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ------------------------------------------------------------ | |
name: "test1" | |
Code generated with Faust 2.66.10 (https://faust.grame.fr) | |
Compilation options: -lang cpp -ct 1 -cn lp_filter -es 1 -mcd 16 -single -ftz 0 | |
------------------------------------------------------------ */ | |
#ifndef __lp_filter_H__ | |
#define __lp_filter_H__ | |
#ifndef FAUSTFLOAT | |
#define FAUSTFLOAT float | |
#endif | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdint> | |
#include <math.h> | |
#ifndef FAUSTCLASS | |
#define FAUSTCLASS lp_filter | |
#endif | |
#ifdef __APPLE__ | |
#define exp10f __exp10f | |
#define exp10 __exp10 | |
#endif | |
#if defined(_WIN32) | |
#define RESTRICT __restrict | |
#else | |
#define RESTRICT __restrict__ | |
#endif | |
class lp_filter : public dsp { | |
private: | |
int fSampleRate; | |
float fConst1; | |
FAUSTFLOAT fVslider0; | |
float fConst2; | |
float fRec5[2]; | |
public: | |
lp_filter() {} | |
void metadata(Meta* m) { | |
m->declare("compile_options", "-lang cpp -ct 1 -cn lp_filter -es 1 -mcd 16 -single -ftz 0"); | |
m->declare("name", "test1"); | |
} | |
virtual int getNumInputs() { | |
return 1; | |
} | |
virtual int getNumOutputs() { | |
return 1; | |
} | |
static void classInit(int sample_rate) { | |
} | |
virtual void instanceConstants(int sample_rate) { | |
fSampleRate = sample_rate; | |
float fConst0 = float(fSampleRate); | |
fConst1 = 159154.94f / fConst0; | |
fConst2 = 5e+05f / fConst0; | |
} | |
virtual void instanceResetUserInterface() { | |
fVslider0 = FAUSTFLOAT(0.8f); | |
} | |
virtual void instanceClear() { | |
for (int l0 = 0; l0 < 2; l0 = l0 + 1) { | |
fRec5[l0] = 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 lp_filter* clone() { | |
return new lp_filter(); | |
} | |
virtual int getSampleRate() { | |
return fSampleRate; | |
} | |
virtual void buildUserInterface(UI* ui_interface) { | |
ui_interface->openVerticalBox("test1"); | |
ui_interface->addVerticalSlider("cutoff", &fVslider0, FAUSTFLOAT(0.8f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); | |
ui_interface->closeBox(); | |
} | |
virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) { | |
FAUSTFLOAT* input0 = inputs[0]; | |
FAUSTFLOAT* output0 = outputs[0]; | |
float fSlow0 = fConst1 / (0.3f * float(fVslider0) + 0.1f); | |
for (int i0 = 0; i0 < count; i0 = i0 + 1) { | |
float fRec0 = 0.0f; | |
float fRec1 = fSlow0; | |
float fRec2 = fRec5[1]; | |
float fRec3 = fConst2; | |
float fRec4 = -1.0f * (fRec0 + fRec2); | |
float fTemp0 = fRec2 + 2.0f * float(input0[i0]) + fRec0 - fRec4; | |
float fTemp1 = fRec1 + fRec3; | |
fRec5[0] = fRec2 - fRec3 * fTemp0 / fTemp1; | |
output0[i0] = FAUSTFLOAT(0.5f * (fRec5[0] + fRec2)); | |
fRec5[1] = fRec5[0]; | |
} | |
} | |
}; | |
#endif | |
Render one buffer | |
chan 0 out -0.0000029690 chan 1 out -0.0000029690 | |
chan 0 out 0.1781011373 chan 1 out 0.1781011373 | |
chan 0 out 0.5312812924 chan 1 out 0.5312812924 | |
chan 0 out 0.5094150305 chan 1 out 0.5094150305 | |
chan 0 out 0.0959469676 chan 1 out 0.0959469080 | |
chan 0 out 0.1913723350 chan 1 out 0.1913723350 | |
chan 0 out -0.0095285177 chan 1 out -0.0095286071 | |
chan 0 out -0.0472731888 chan 1 out -0.0472732335 | |
chan 0 out 0.5322723389 chan 1 out 0.5322724581 | |
chan 0 out 0.1753027439 chan 1 out 0.1753027737 | |
chan 0 out 0.1848808229 chan 1 out 0.1848809123 | |
chan 0 out -0.1092661023 chan 1 out -0.1092660725 | |
chan 0 out 0.0044756532 chan 1 out 0.0044756234 | |
chan 0 out 0.2733092308 chan 1 out 0.2733091414 | |
chan 0 out -0.4951840043 chan 1 out -0.4951841533 | |
chan 0 out -0.7238877416 chan 1 out -0.7238878012 | |
chan 0 out -0.8941643834 chan 1 out -0.8941644430 | |
chan 0 out -0.3777178526 chan 1 out -0.3777178526 | |
chan 0 out 0.3921424150 chan 1 out 0.3921424150 | |
chan 0 out -0.0146018863 chan 1 out -0.0146019459 | |
chan 0 out -0.0844745934 chan 1 out -0.0844745934 | |
chan 0 out 0.5835661888 chan 1 out 0.5835662484 | |
chan 0 out 0.0045923591 chan 1 out 0.0045922697 | |
chan 0 out -0.7336331606 chan 1 out -0.7336332798 | |
chan 0 out -0.8516654968 chan 1 out -0.8516654968 | |
chan 0 out -0.1312917471 chan 1 out -0.1312916577 | |
chan 0 out 0.6372754574 chan 1 out 0.6372755766 | |
chan 0 out 0.4160127640 chan 1 out 0.4160127342 | |
chan 0 out -0.2452401966 chan 1 out -0.2452403009 | |
chan 0 out 0.0531824827 chan 1 out 0.0531824529 | |
chan 0 out 0.4173749685 chan 1 out 0.4173749685 | |
chan 0 out -0.4260440469 chan 1 out -0.4260441661 | |
chan 0 out -0.4114255011 chan 1 out -0.4114254713 | |
chan 0 out 0.2001893669 chan 1 out 0.2001894712 | |
chan 0 out 0.0744235218 chan 1 out 0.0744234920 | |
chan 0 out -0.4167462587 chan 1 out -0.4167463183 | |
chan 0 out -0.0232901573 chan 1 out -0.0232900679 | |
chan 0 out 0.5623452663 chan 1 out 0.5623453856 | |
chan 0 out 0.7148302794 chan 1 out 0.7148303390 | |
chan 0 out 0.0649848580 chan 1 out 0.0649847984 | |
chan 0 out -0.7058377862 chan 1 out -0.7058378458 | |
chan 0 out -0.5043151975 chan 1 out -0.5043151975 | |
chan 0 out -0.1261479706 chan 1 out -0.1261479259 | |
chan 0 out 0.1043465957 chan 1 out 0.1043466181 | |
chan 0 out 0.3970234096 chan 1 out 0.3970234394 | |
chan 0 out 0.4543457627 chan 1 out 0.4543457925 | |
chan 0 out 0.5891035795 chan 1 out 0.5891036391 | |
chan 0 out 0.6348174810 chan 1 out 0.6348174810 | |
chan 0 out -0.1019205153 chan 1 out -0.1019205898 | |
chan 0 out -0.1252231300 chan 1 out -0.1252230853 | |
chan 0 out -0.3077576160 chan 1 out -0.3077575564 | |
chan 0 out -0.1452468634 chan 1 out -0.1452468336 | |
chan 0 out -0.1135835648 chan 1 out -0.1135835946 | |
chan 0 out -0.7455470562 chan 1 out -0.7455471754 | |
chan 0 out 0.2132743001 chan 1 out 0.2132743597 | |
chan 0 out 0.8239094019 chan 1 out 0.8239094019 | |
chan 0 out 0.7555435896 chan 1 out 0.7555435896 | |
chan 0 out 0.1456350088 chan 1 out 0.1456349492 | |
chan 0 out 0.0311293602 chan 1 out 0.0311293900 | |
chan 0 out 0.2468542159 chan 1 out 0.2468542457 | |
chan 0 out 0.0158459246 chan 1 out 0.0158458874 | |
chan 0 out 0.0635885149 chan 1 out 0.0635885075 | |
chan 0 out 0.4328312874 chan 1 out 0.4328313470 | |
chan 0 out 0.3562181592 chan 1 out 0.3562181592 | |
chan 0 out -0.5774328113 chan 1 out -0.5774328709 | |
chan 0 out -0.7285866737 chan 1 out -0.7285866737 | |
chan 0 out -0.5121347308 chan 1 out -0.5121346712 | |
chan 0 out 0.0865221024 chan 1 out 0.0865222514 | |
chan 0 out 0.2676868141 chan 1 out 0.2676869333 | |
chan 0 out -0.2946102023 chan 1 out -0.2946102619 | |
chan 0 out -0.3837862015 chan 1 out -0.3837862313 | |
chan 0 out -0.3414274454 chan 1 out -0.3414274752 | |
chan 0 out -0.2468619645 chan 1 out -0.2468619645 | |
chan 0 out -0.5434904695 chan 1 out -0.5434905291 | |
chan 0 out -0.3628992438 chan 1 out -0.3628992438 | |
chan 0 out 0.4115923047 chan 1 out 0.4115923643 | |
chan 0 out 0.5030680895 chan 1 out 0.5030680895 | |
chan 0 out 0.1969875693 chan 1 out 0.1969875544 | |
chan 0 out -0.5133361220 chan 1 out -0.5133361816 | |
chan 0 out -0.0449951887 chan 1 out -0.0449950993 | |
chan 0 out 0.7717430592 chan 1 out 0.7717431784 | |
chan 0 out 0.4405900836 chan 1 out 0.4405900836 | |
chan 0 out 0.2598286867 chan 1 out 0.2598286569 | |
chan 0 out 0.2227133662 chan 1 out 0.2227133512 | |
chan 0 out -0.0151489675 chan 1 out -0.0151489824 | |
chan 0 out -0.4548115730 chan 1 out -0.4548116028 | |
chan 0 out -0.3727528155 chan 1 out -0.3727527559 | |
chan 0 out -0.5266283751 chan 1 out -0.5266283154 | |
chan 0 out -0.5103318691 chan 1 out -0.5103318691 | |
chan 0 out 0.4347110093 chan 1 out 0.4347110987 | |
chan 0 out -0.0943216980 chan 1 out -0.0943217874 | |
chan 0 out -0.8600051999 chan 1 out -0.8600052595 | |
chan 0 out -0.3413842916 chan 1 out -0.3413842022 | |
chan 0 out -0.1336886883 chan 1 out -0.1336886585 | |
chan 0 out 0.0660313293 chan 1 out 0.0660313293 | |
chan 0 out 0.6190581918 chan 1 out 0.6190582514 | |
chan 0 out -0.0550047159 chan 1 out -0.0550048351 | |
chan 0 out -0.1778940558 chan 1 out -0.1778940856 | |
chan 0 out -0.1496801972 chan 1 out -0.1496801972 | |
chan 0 out -0.1813263297 chan 1 out -0.1813263297 | |
chan 0 out 0.6971498132 chan 1 out 0.6971499324 | |
chan 0 out 0.0057942271 chan 1 out 0.0057941973 | |
chan 0 out -0.4054166973 chan 1 out -0.4054166675 | |
chan 0 out -0.3999743760 chan 1 out -0.3999743462 | |
chan 0 out -0.5496540666 chan 1 out -0.5496540666 | |
chan 0 out 0.3160774708 chan 1 out 0.3160774708 | |
chan 0 out 0.3263182640 chan 1 out 0.3263182342 | |
chan 0 out 0.1607568860 chan 1 out 0.1607569158 | |
chan 0 out 0.6696527600 chan 1 out 0.6696528196 | |
chan 0 out 0.5023213625 chan 1 out 0.5023213029 | |
chan 0 out 0.2647823691 chan 1 out 0.2647823393 | |
chan 0 out 0.5099310875 chan 1 out 0.5099310875 | |
chan 0 out 0.2458335757 chan 1 out 0.2458335310 | |
chan 0 out 0.0528707206 chan 1 out 0.0528707057 | |
chan 0 out 0.3741234243 chan 1 out 0.3741234541 | |
chan 0 out -0.2604581714 chan 1 out -0.2604582608 | |
chan 0 out -0.0405117869 chan 1 out -0.0405117571 | |
chan 0 out 0.8545237780 chan 1 out 0.8545238972 | |
chan 0 out 0.1312262416 chan 1 out 0.1312261522 | |
chan 0 out -0.2860812247 chan 1 out -0.2860812843 | |
chan 0 out -0.2070147246 chan 1 out -0.2070147097 | |
chan 0 out -0.4113493562 chan 1 out -0.4113493562 | |
chan 0 out -0.2129593641 chan 1 out -0.2129593343 | |
chan 0 out -0.1716627330 chan 1 out -0.1716627330 | |
chan 0 out -0.5165110230 chan 1 out -0.5165110230 | |
chan 0 out 0.0440043211 chan 1 out 0.0440044403 | |
chan 0 out 0.7349776626 chan 1 out 0.7349777222 | |
chan 0 out 0.6080372930 chan 1 out 0.6080372334 | |
/* ------------------------------------------------------------ | |
name: "test3" | |
Code generated with Faust 2.66.10 (https://faust.grame.fr) | |
Compilation options: -lang cpp -ct 1 -cn lp_filter3 -es 1 -mcd 16 -single -ftz 0 | |
------------------------------------------------------------ */ | |
#ifndef __lp_filter3_H__ | |
#define __lp_filter3_H__ | |
#ifndef FAUSTFLOAT | |
#define FAUSTFLOAT float | |
#endif | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdint> | |
#include <math.h> | |
#ifndef FAUSTCLASS | |
#define FAUSTCLASS lp_filter3 | |
#endif | |
#ifdef __APPLE__ | |
#define exp10f __exp10f | |
#define exp10 __exp10 | |
#endif | |
#if defined(_WIN32) | |
#define RESTRICT __restrict | |
#else | |
#define RESTRICT __restrict__ | |
#endif | |
class lp_filter3 : public dsp { | |
private: | |
FAUSTFLOAT fVslider0; | |
int fSampleRate; | |
float fConst1; | |
FAUSTFLOAT fVslider1; | |
float fConst2; | |
float fRec17[2]; | |
float fRec11[2]; | |
float fRec5[2]; | |
public: | |
lp_filter3() {} | |
void metadata(Meta* m) { | |
m->declare("compile_options", "-lang cpp -ct 1 -cn lp_filter3 -es 1 -mcd 16 -single -ftz 0"); | |
m->declare("name", "test3"); | |
} | |
virtual int getNumInputs() { | |
return 1; | |
} | |
virtual int getNumOutputs() { | |
return 1; | |
} | |
static void classInit(int sample_rate) { | |
} | |
virtual void instanceConstants(int sample_rate) { | |
fSampleRate = sample_rate; | |
float fConst0 = float(fSampleRate); | |
fConst1 = 159154.94f / fConst0; | |
fConst2 = 5e+05f / fConst0; | |
} | |
virtual void instanceResetUserInterface() { | |
fVslider0 = FAUSTFLOAT(0.9f); | |
fVslider1 = FAUSTFLOAT(0.8f); | |
} | |
virtual void instanceClear() { | |
for (int l0 = 0; l0 < 2; l0 = l0 + 1) { | |
fRec17[l0] = 0.0f; | |
} | |
for (int l1 = 0; l1 < 2; l1 = l1 + 1) { | |
fRec11[l1] = 0.0f; | |
} | |
for (int l2 = 0; l2 < 2; l2 = l2 + 1) { | |
fRec5[l2] = 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 lp_filter3* clone() { | |
return new lp_filter3(); | |
} | |
virtual int getSampleRate() { | |
return fSampleRate; | |
} | |
virtual void buildUserInterface(UI* ui_interface) { | |
ui_interface->openVerticalBox("test3"); | |
ui_interface->addVerticalSlider("cutoff", &fVslider1, FAUSTFLOAT(0.8f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); | |
ui_interface->addVerticalSlider("vol", &fVslider0, FAUSTFLOAT(0.9f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); | |
ui_interface->closeBox(); | |
} | |
virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) { | |
FAUSTFLOAT* input0 = inputs[0]; | |
FAUSTFLOAT* output0 = outputs[0]; | |
float fSlow0 = 0.5f * float(fVslider0); | |
float fSlow1 = fConst1 / (0.3f * float(fVslider1) + 0.1f); | |
for (int i0 = 0; i0 < count; i0 = i0 + 1) { | |
float fRec0 = 0.0f; | |
float fRec1 = fSlow1; | |
float fRec2 = fRec5[1]; | |
float fRec3 = fConst2; | |
float fTemp0 = fRec0 + fRec2; | |
float fRec4 = -1.0f * fTemp0; | |
float fRec6 = 0.0f; | |
float fRec7 = fSlow1; | |
float fRec8 = fRec11[1]; | |
float fRec9 = fConst2; | |
float fTemp1 = fRec6 + fRec8; | |
float fRec10 = -1.0f * fTemp1; | |
float fRec12 = 0.0f; | |
float fRec13 = fSlow1; | |
float fRec14 = fRec17[1]; | |
float fRec15 = fConst2; | |
float fRec16 = -1.0f * (fRec12 + fRec14); | |
float fTemp2 = fRec14 + 2.0f * float(input0[i0]) + fRec12 - fRec16; | |
float fTemp3 = fRec13 + fRec15; | |
fRec17[0] = fRec14 - fRec15 * fTemp2 / fTemp3; | |
float fTemp4 = fRec14 + fTemp1 + fRec17[0] - fRec10; | |
float fTemp5 = fRec7 + fRec9; | |
fRec11[0] = fRec8 - fRec9 * fTemp4 / fTemp5; | |
float fTemp6 = fRec8 + fTemp0 + fRec11[0] - fRec4; | |
float fTemp7 = fRec1 + fRec3; | |
fRec5[0] = fRec2 - fRec3 * fTemp6 / fTemp7; | |
output0[i0] = FAUSTFLOAT(fSlow0 * (fRec5[0] + fRec2)); | |
fRec17[1] = fRec17[0]; | |
fRec11[1] = fRec11[0]; | |
fRec5[1] = fRec5[0]; | |
} | |
} | |
}; | |
#endif | |
Render one buffer | |
chan 0 out -0.0000007128 chan 1 out -0.0000007128 | |
chan 0 out 0.0427555181 chan 1 out 0.0427555330 | |
chan 0 out 0.2102408409 chan 1 out 0.2102408856 | |
chan 0 out 0.4062424898 chan 1 out 0.4062425494 | |
chan 0 out 0.3681726158 chan 1 out 0.3681726158 | |
chan 0 out 0.1896045953 chan 1 out 0.1896045357 | |
chan 0 out 0.0997384936 chan 1 out 0.0997384489 | |
chan 0 out 0.0232407469 chan 1 out 0.0232406817 | |
chan 0 out 0.1011579931 chan 1 out 0.1011580154 | |
chan 0 out 0.2796112299 chan 1 out 0.2796113193 | |
chan 0 out 0.2378026396 chan 1 out 0.2378026843 | |
chan 0 out 0.0886486396 chan 1 out 0.0886486694 | |
chan 0 out -0.0131040085 chan 1 out -0.0131039955 | |
chan 0 out 0.0422981903 chan 1 out 0.0422982052 | |
chan 0 out 0.0106493086 chan 1 out 0.0106492750 | |
chan 0 out -0.3466770053 chan 1 out -0.3466771543 | |
chan 0 out -0.6582777500 chan 1 out -0.6582779288 | |
chan 0 out -0.6500347257 chan 1 out -0.6500348449 | |
chan 0 out -0.2583295107 chan 1 out -0.2583294213 | |
chan 0 out 0.1118280441 chan 1 out 0.1118281409 | |
chan 0 out 0.0597625114 chan 1 out 0.0597624592 | |
chan 0 out 0.0919724703 chan 1 out 0.0919724479 | |
chan 0 out 0.2548916042 chan 1 out 0.2548916638 | |
chan 0 out -0.0507179946 chan 1 out -0.0507180914 | |
chan 0 out -0.5525401831 chan 1 out -0.5525403023 | |
chan 0 out -0.5800981522 chan 1 out -0.5800980926 | |
chan 0 out -0.0756813437 chan 1 out -0.0756811425 | |
chan 0 out 0.3799526393 chan 1 out 0.3799529076 | |
chan 0 out 0.2689060569 chan 1 out 0.2689060569 | |
chan 0 out -0.0232422985 chan 1 out -0.0232424475 | |
chan 0 out 0.0680993572 chan 1 out 0.0680993274 | |
chan 0 out 0.1064236835 chan 1 out 0.1064236686 | |
chan 0 out -0.2102201581 chan 1 out -0.2102202624 | |
chan 0 out -0.2380265445 chan 1 out -0.2380265445 | |
chan 0 out 0.0311281886 chan 1 out 0.0311282948 | |
chan 0 out -0.0180480070 chan 1 out -0.0180480145 | |
chan 0 out -0.1866661757 chan 1 out -0.1866662055 | |
chan 0 out 0.0360916965 chan 1 out 0.0360918455 | |
chan 0 out 0.4338484704 chan 1 out 0.4338486791 | |
chan 0 out 0.4651954472 chan 1 out 0.4651955068 | |
chan 0 out 0.0022351921 chan 1 out 0.0022350042 | |
chan 0 out -0.4450249076 chan 1 out -0.4450251460 | |
chan 0 out -0.4125553370 chan 1 out -0.4125553370 | |
chan 0 out -0.1289207637 chan 1 out -0.1289206743 | |
chan 0 out 0.1240737438 chan 1 out 0.1240738258 | |
chan 0 out 0.3167172670 chan 1 out 0.3167173266 | |
chan 0 out 0.4338856339 chan 1 out 0.4338856637 | |
chan 0 out 0.5153943896 chan 1 out 0.5153944492 | |
chan 0 out 0.3873273134 chan 1 out 0.3873272538 | |
chan 0 out 0.0473195575 chan 1 out 0.0473194346 | |
chan 0 out -0.1620153189 chan 1 out -0.1620153785 | |
chan 0 out -0.2020744234 chan 1 out -0.2020744383 | |
chan 0 out -0.1573990285 chan 1 out -0.1573990136 | |
chan 0 out -0.2577985823 chan 1 out -0.2577986121 | |
chan 0 out -0.3168766797 chan 1 out -0.3168766797 | |
chan 0 out 0.1423752755 chan 1 out 0.1423754394 | |
chan 0 out 0.6191403866 chan 1 out 0.6191405058 | |
chan 0 out 0.5545738935 chan 1 out 0.5545738339 | |
chan 0 out 0.2215662599 chan 1 out 0.2215661705 | |
chan 0 out 0.0939693153 chan 1 out 0.0939693078 | |
chan 0 out 0.1233696789 chan 1 out 0.1233696789 | |
chan 0 out 0.0739049464 chan 1 out 0.0739049241 | |
chan 0 out 0.1332418621 chan 1 out 0.1332419068 | |
chan 0 out 0.2997433841 chan 1 out 0.2997435033 | |
chan 0 out 0.1164239869 chan 1 out 0.1164239645 | |
chan 0 out -0.3746417761 chan 1 out -0.3746419549 | |
chan 0 out -0.5868372917 chan 1 out -0.5868374109 | |
chan 0 out -0.3609612584 chan 1 out -0.3609611392 | |
chan 0 out 0.0072810976 chan 1 out 0.0072812652 | |
chan 0 out 0.0784837827 chan 1 out 0.0784838498 | |
chan 0 out -0.1745064557 chan 1 out -0.1745065451 | |
chan 0 out -0.3255518377 chan 1 out -0.3255518675 | |
chan 0 out -0.2936917841 chan 1 out -0.2936917543 | |
chan 0 out -0.3112652004 chan 1 out -0.3112652004 | |
chan 0 out -0.3865084052 chan 1 out -0.3865084052 | |
chan 0 out -0.1801006794 chan 1 out -0.1801005900 | |
chan 0 out 0.2435606718 chan 1 out 0.2435608059 | |
chan 0 out 0.3717921376 chan 1 out 0.3717921376 | |
chan 0 out 0.0673528165 chan 1 out 0.0673526973 | |
chan 0 out -0.2148270756 chan 1 out -0.2148271650 | |
chan 0 out 0.0545150936 chan 1 out 0.0545152389 | |
chan 0 out 0.4621577859 chan 1 out 0.4621579647 | |
chan 0 out 0.4286824465 chan 1 out 0.4286824465 | |
chan 0 out 0.2552441955 chan 1 out 0.2552441657 | |
chan 0 out 0.1483894885 chan 1 out 0.1483894438 | |
chan 0 out -0.0730490685 chan 1 out -0.0730491430 | |
chan 0 out -0.3068454266 chan 1 out -0.3068454564 | |
chan 0 out -0.3942901492 chan 1 out -0.3942901194 | |
chan 0 out -0.4385438859 chan 1 out -0.4385438859 | |
chan 0 out -0.2377718985 chan 1 out -0.2377718687 | |
chan 0 out 0.0797075853 chan 1 out 0.0797076523 | |
chan 0 out -0.1523828655 chan 1 out -0.1523829848 | |
chan 0 out -0.5075698495 chan 1 out -0.5075700283 | |
chan 0 out -0.3688575029 chan 1 out -0.3688574135 | |
chan 0 out -0.1054364368 chan 1 out -0.1054363251 | |
chan 0 out 0.1555757821 chan 1 out 0.1555758715 | |
chan 0 out 0.2897454500 chan 1 out 0.2897455096 | |
chan 0 out 0.0602385923 chan 1 out 0.0602384694 | |
chan 0 out -0.1388372928 chan 1 out -0.1388374120 | |
chan 0 out -0.1490226239 chan 1 out -0.1490226388 | |
chan 0 out 0.0543399453 chan 1 out 0.0543399975 | |
chan 0 out 0.2891716361 chan 1 out 0.2891716957 | |
chan 0 out 0.0537043661 chan 1 out 0.0537043400 | |
chan 0 out -0.2931415737 chan 1 out -0.2931416035 | |
chan 0 out -0.4020704925 chan 1 out -0.4020704925 | |
chan 0 out -0.2572399378 chan 1 out -0.2572398782 | |
chan 0 out 0.1155332029 chan 1 out 0.1155333221 | |
chan 0 out 0.2638191283 chan 1 out 0.2638191879 | |
chan 0 out 0.2987796664 chan 1 out 0.2987796366 | |
chan 0 out 0.4607392251 chan 1 out 0.4607392251 | |
chan 0 out 0.4348308146 chan 1 out 0.4348308146 | |
chan 0 out 0.3409915268 chan 1 out 0.3409914970 | |
chan 0 out 0.3444811404 chan 1 out 0.3444811702 | |
chan 0 out 0.2300771177 chan 1 out 0.2300770879 | |
chan 0 out 0.1586839110 chan 1 out 0.1586838663 | |
chan 0 out 0.1190901548 chan 1 out 0.1190901175 | |
chan 0 out -0.0529862717 chan 1 out -0.0529863536 | |
chan 0 out 0.1265288293 chan 1 out 0.1265288293 | |
chan 0 out 0.4237903059 chan 1 out 0.4237903655 | |
chan 0 out 0.1714101881 chan 1 out 0.1714100987 | |
chan 0 out -0.1673095226 chan 1 out -0.1673096269 | |
chan 0 out -0.2559902370 chan 1 out -0.2559902370 | |
chan 0 out -0.2812791765 chan 1 out -0.2812791765 | |
chan 0 out -0.2234017849 chan 1 out -0.2234017700 | |
chan 0 out -0.2425203919 chan 1 out -0.2425203919 | |
chan 0 out -0.2624219358 chan 1 out -0.2624219060 | |
chan 0 out 0.0911317021 chan 1 out 0.0911318436 | |
chan 0 out 0.5037093759 chan 1 out 0.5037094951 | |
/* ------------------------------------------------------------ | |
name: "test5" | |
Code generated with Faust 2.66.10 (https://faust.grame.fr) | |
Compilation options: -lang cpp -ct 1 -cn lowshelffilter -es 1 -mcd 16 -single -ftz 0 | |
------------------------------------------------------------ */ | |
#ifndef __lowshelffilter_H__ | |
#define __lowshelffilter_H__ | |
#ifndef FAUSTFLOAT | |
#define FAUSTFLOAT float | |
#endif | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdint> | |
#include <math.h> | |
#ifndef FAUSTCLASS | |
#define FAUSTCLASS lowshelffilter | |
#endif | |
#ifdef __APPLE__ | |
#define exp10f __exp10f | |
#define exp10 __exp10 | |
#endif | |
#if defined(_WIN32) | |
#define RESTRICT __restrict | |
#else | |
#define RESTRICT __restrict__ | |
#endif | |
class lowshelffilter : public dsp { | |
private: | |
FAUSTFLOAT fVslider0; | |
int fSampleRate; | |
float fConst1; | |
float fVec0[2]; | |
float fRec0[2]; | |
public: | |
lowshelffilter() {} | |
void metadata(Meta* m) { | |
m->declare("compile_options", "-lang cpp -ct 1 -cn lowshelffilter -es 1 -mcd 16 -single -ftz 0"); | |
m->declare("name", "test5"); | |
} | |
virtual int getNumInputs() { | |
return 1; | |
} | |
virtual int getNumOutputs() { | |
return 1; | |
} | |
static void classInit(int sample_rate) { | |
} | |
virtual void instanceConstants(int sample_rate) { | |
fSampleRate = sample_rate; | |
float fConst0 = 628.31854f / float(fSampleRate); | |
fConst1 = (fConst0 + -1.0f) / (fConst0 + 1.0f); | |
} | |
virtual void instanceResetUserInterface() { | |
fVslider0 = FAUSTFLOAT(0.5f); | |
} | |
virtual void instanceClear() { | |
for (int l0 = 0; l0 < 2; l0 = l0 + 1) { | |
fVec0[l0] = 0.0f; | |
} | |
for (int l1 = 0; l1 < 2; l1 = l1 + 1) { | |
fRec0[l1] = 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 lowshelffilter* clone() { | |
return new lowshelffilter(); | |
} | |
virtual int getSampleRate() { | |
return fSampleRate; | |
} | |
virtual void buildUserInterface(UI* ui_interface) { | |
ui_interface->openVerticalBox("test5"); | |
ui_interface->addVerticalSlider("gain", &fVslider0, FAUSTFLOAT(0.5f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); | |
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 = 0.5f * (fSlow0 + -1.0f); | |
float fSlow2 = 0.5f * (fSlow0 + 1.0f); | |
for (int i0 = 0; i0 < count; i0 = i0 + 1) { | |
float fTemp0 = float(input0[i0]); | |
fVec0[0] = fTemp0; | |
fRec0[0] = fSlow1 * (fConst1 * fTemp0 + fVec0[1]) - fConst1 * fRec0[1]; | |
output0[i0] = FAUSTFLOAT(fRec0[0] + fSlow2 * fTemp0); | |
fVec0[1] = fVec0[0]; | |
fRec0[1] = fRec0[0]; | |
} | |
} | |
}; | |
#endif | |
Render one buffer | |
chan 0 out 0.0000057082 chan 1 out 0.0000057082 | |
chan 0 out -0.3424239159 chan 1 out -0.3424239457 | |
chan 0 out -0.6855268478 chan 1 out -0.6855268478 | |
chan 0 out -0.3084861040 chan 1 out -0.3084861040 | |
chan 0 out 0.1243897378 chan 1 out 0.1243897304 | |
chan 0 out -0.4636538327 chan 1 out -0.4636538625 | |
chan 0 out 0.5088387728 chan 1 out 0.5088387728 | |
chan 0 out -0.3795412183 chan 1 out -0.3795412183 | |
chan 0 out -0.6053465605 chan 1 out -0.6053465605 | |
chan 0 out 0.2832943201 chan 1 out 0.2832942903 | |
chan 0 out -0.5973458290 chan 1 out -0.5973458290 | |
chan 0 out 0.8518539667 chan 1 out 0.8518539667 | |
chan 0 out -0.8017373085 chan 1 out -0.8017372489 | |
chan 0 out 0.3263559043 chan 1 out 0.3263559043 | |
chan 0 out 0.6646610498 chan 1 out 0.6646610498 | |
chan 0 out 0.8001253605 chan 1 out 0.8001253009 | |
chan 0 out 0.9855031371 chan 1 out 0.9855031371 | |
chan 0 out -0.2072097808 chan 1 out -0.2072097808 | |
chan 0 out -0.5381413102 chan 1 out -0.5381413102 | |
chan 0 out 0.5366447568 chan 1 out 0.5366447568 | |
chan 0 out -0.3779501319 chan 1 out -0.3779501319 | |
chan 0 out -0.7454562187 chan 1 out -0.7454562187 | |
chan 0 out 0.7086360455 chan 1 out 0.7086359859 | |
chan 0 out 0.7109233141 chan 1 out 0.7109232545 | |
chan 0 out 0.9623970389 chan 1 out 0.9623969793 | |
chan 0 out -0.6897849441 chan 1 out -0.6897849441 | |
chan 0 out -0.5642129779 chan 1 out -0.5642130375 | |
chan 0 out -0.2950542569 chan 1 out -0.2950542867 | |
chan 0 out 0.7333871722 chan 1 out 0.7333871722 | |
chan 0 out -0.8329330683 chan 1 out -0.8329330683 | |
chan 0 out 0.0158544388 chan 1 out 0.0158544388 | |
chan 0 out 0.7771152854 chan 1 out 0.7771152854 | |
chan 0 out 0.0301116332 chan 1 out 0.0301116332 | |
chan 0 out -0.4108122587 chan 1 out -0.4108122587 | |
chan 0 out 0.2387858480 chan 1 out 0.2387858629 | |
chan 0 out 0.5441100597 chan 1 out 0.5441100597 | |
chan 0 out -0.4972886145 chan 1 out -0.4972885847 | |
chan 0 out -0.6070688367 chan 1 out -0.6070688367 | |
chan 0 out -0.8118025661 chan 1 out -0.8118025064 | |
chan 0 out 0.6525852680 chan 1 out 0.6525853276 | |
chan 0 out 0.7134163380 chan 1 out 0.7134163380 | |
chan 0 out 0.2947275639 chan 1 out 0.2947275937 | |
chan 0 out -0.0403904878 chan 1 out -0.0403904729 | |
chan 0 out -0.1756407619 chan 1 out -0.1756407619 | |
chan 0 out -0.6143493652 chan 1 out -0.6143493652 | |
chan 0 out -0.2930864990 chan 1 out -0.2930864990 | |
chan 0 out -0.8642858863 chan 1 out -0.8642859459 | |
chan 0 out -0.3734264970 chan 1 out -0.3734264970 | |
chan 0 out 0.5662544966 chan 1 out 0.5662544966 | |
chan 0 out -0.2851693630 chan 1 out -0.2851693630 | |
chan 0 out 0.9142727852 chan 1 out 0.9142727852 | |
chan 0 out -0.5952423215 chan 1 out -0.5952423811 | |
chan 0 out 0.8383655548 chan 1 out 0.8383654952 | |
chan 0 out 0.6141578555 chan 1 out 0.6141578555 | |
chan 0 out -0.9854666591 chan 1 out -0.9854667187 | |
chan 0 out -0.6152914762 chan 1 out -0.6152915359 | |
chan 0 out -0.8703349829 chan 1 out -0.8703349829 | |
chan 0 out 0.5821034908 chan 1 out 0.5821034908 | |
chan 0 out -0.6080906391 chan 1 out -0.6080906391 | |
chan 0 out 0.1743560433 chan 1 out 0.1743560284 | |
chan 0 out -0.1721743494 chan 1 out -0.1721743643 | |
chan 0 out 0.0964858457 chan 1 out 0.0964858308 | |
chan 0 out -0.8847244382 chan 1 out -0.8847244382 | |
chan 0 out 0.2307085395 chan 1 out 0.2307085395 | |
chan 0 out 0.9234698415 chan 1 out 0.9234698415 | |
chan 0 out 0.5634211302 chan 1 out 0.5634211302 | |
chan 0 out 0.4954530597 chan 1 out 0.4954531193 | |
chan 0 out -0.6164383292 chan 1 out -0.6164383292 | |
chan 0 out 0.1107266992 chan 1 out 0.1107267141 | |
chan 0 out 0.4600110054 chan 1 out 0.4600110054 | |
chan 0 out 0.3095348477 chan 1 out 0.3095348775 | |
chan 0 out 0.3733029962 chan 1 out 0.3733030260 | |
chan 0 out 0.1154854447 chan 1 out 0.1154854745 | |
chan 0 out 0.9309002757 chan 1 out 0.9309003353 | |
chan 0 out -0.2273246199 chan 1 out -0.2273245901 | |
chan 0 out -0.5789912343 chan 1 out -0.5789911747 | |
chan 0 out -0.4404739738 chan 1 out -0.4404739439 | |
chan 0 out 0.0182765089 chan 1 out 0.0182765089 | |
chan 0 out 0.9506407976 chan 1 out 0.9506407976 | |
chan 0 out -0.8505983949 chan 1 out -0.8505983949 | |
chan 0 out -0.6504198313 chan 1 out -0.6504197717 | |
chan 0 out -0.2444381416 chan 1 out -0.2444381118 | |
chan 0 out -0.2694436014 chan 1 out -0.2694435716 | |
chan 0 out -0.1546538621 chan 1 out -0.1546538323 | |
chan 0 out 0.1958477199 chan 1 out 0.1958477497 | |
chan 0 out 0.7047669888 chan 1 out 0.7047670484 | |
chan 0 out 0.0530132502 chan 1 out 0.0530132800 | |
chan 0 out 0.9846672416 chan 1 out 0.9846673012 | |
chan 0 out 0.0169332437 chan 1 out 0.0169332735 | |
chan 0 out -0.8470979929 chan 1 out -0.8470979929 | |
chan 0 out 0.9861469865 chan 1 out 0.9861469269 | |
chan 0 out 0.6567914486 chan 1 out 0.6567914486 | |
chan 0 out 0.0148638226 chan 1 out 0.0148638077 | |
chan 0 out 0.2158077806 chan 1 out 0.2158077657 | |
chan 0 out -0.3848144412 chan 1 out -0.3848144412 | |
chan 0 out -0.8570246100 chan 1 out -0.8570246100 | |
chan 0 out 0.8941034675 chan 1 out 0.8941034079 | |
chan 0 out -0.5781577826 chan 1 out -0.5781578422 | |
chan 0 out 0.8436552286 chan 1 out 0.8436552286 | |
chan 0 out -0.5223307610 chan 1 out -0.5223307610 | |
chan 0 out -0.8472654819 chan 1 out -0.8472654819 | |
chan 0 out 0.7709051967 chan 1 out 0.7709051967 | |
chan 0 out -0.0115109142 chan 1 out -0.0115109142 | |
chan 0 out 0.7761770487 chan 1 out 0.7761769891 | |
chan 0 out 0.2656783462 chan 1 out 0.2656783462 | |
chan 0 out -0.8927645683 chan 1 out -0.8927645087 | |
chan 0 out 0.2006620169 chan 1 out 0.2006620169 | |
chan 0 out -0.5648181438 chan 1 out -0.5648181438 | |
chan 0 out -0.7616906166 chan 1 out -0.7616906166 | |
chan 0 out -0.2564320564 chan 1 out -0.2564320564 | |
chan 0 out -0.2800554335 chan 1 out -0.2800554335 | |
chan 0 out -0.7052886486 chan 1 out -0.7052886486 | |
chan 0 out 0.2257472277 chan 1 out 0.2257472277 | |
chan 0 out -0.3112381697 chan 1 out -0.3112381697 | |
chan 0 out -0.3789282143 chan 1 out -0.3789282441 | |
chan 0 out 0.8976293802 chan 1 out 0.8976293802 | |
chan 0 out -0.7694240808 chan 1 out -0.7694240212 | |
chan 0 out -0.8393712044 chan 1 out -0.8393711448 | |
chan 0 out 0.5864883065 chan 1 out 0.5864883661 | |
chan 0 out 0.0115347123 chan 1 out 0.0115347719 | |
chan 0 out 0.4517715275 chan 1 out 0.4517716169 | |
chan 0 out 0.3922515213 chan 1 out 0.3922515810 | |
chan 0 out 0.0709505528 chan 1 out 0.0709506199 | |
chan 0 out 0.2934343517 chan 1 out 0.2934344411 | |
chan 0 out 0.7259645462 chan 1 out 0.7259646058 | |
chan 0 out -0.7768086791 chan 1 out -0.7768086195 | |
chan 0 out -0.6373171806 chan 1 out -0.6373171210 | |
chan 0 out -0.5568231940 chan 1 out -0.5568230748 | |
/* ------------------------------------------------------------ | |
name: "test7" | |
Code generated with Faust 2.66.10 (https://faust.grame.fr) | |
Compilation options: -lang cpp -ct 1 -cn lp_filter2 -es 1 -mcd 16 -single -ftz 0 | |
------------------------------------------------------------ */ | |
#ifndef __lp_filter2_H__ | |
#define __lp_filter2_H__ | |
#ifndef FAUSTFLOAT | |
#define FAUSTFLOAT float | |
#endif | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdint> | |
#include <math.h> | |
#ifndef FAUSTCLASS | |
#define FAUSTCLASS lp_filter2 | |
#endif | |
#ifdef __APPLE__ | |
#define exp10f __exp10f | |
#define exp10 __exp10 | |
#endif | |
#if defined(_WIN32) | |
#define RESTRICT __restrict | |
#else | |
#define RESTRICT __restrict__ | |
#endif | |
class lp_filter2 : public dsp { | |
private: | |
int fSampleRate; | |
float fConst1; | |
FAUSTFLOAT fVslider0; | |
float fConst2; | |
float fRec10[2]; | |
float fRec14[2]; | |
public: | |
lp_filter2() {} | |
void metadata(Meta* m) { | |
m->declare("compile_options", "-lang cpp -ct 1 -cn lp_filter2 -es 1 -mcd 16 -single -ftz 0"); | |
m->declare("name", "test7"); | |
} | |
virtual int getNumInputs() { | |
return 1; | |
} | |
virtual int getNumOutputs() { | |
return 1; | |
} | |
static void classInit(int sample_rate) { | |
} | |
virtual void instanceConstants(int sample_rate) { | |
fSampleRate = sample_rate; | |
float fConst0 = float(fSampleRate); | |
fConst1 = 159154.94f / fConst0; | |
fConst2 = 5e+05f / fConst0; | |
} | |
virtual void instanceResetUserInterface() { | |
fVslider0 = FAUSTFLOAT(0.8f); | |
} | |
virtual void instanceClear() { | |
for (int l0 = 0; l0 < 2; l0 = l0 + 1) { | |
fRec10[l0] = 0.0f; | |
} | |
for (int l1 = 0; l1 < 2; l1 = l1 + 1) { | |
fRec14[l1] = 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 lp_filter2* clone() { | |
return new lp_filter2(); | |
} | |
virtual int getSampleRate() { | |
return fSampleRate; | |
} | |
virtual void buildUserInterface(UI* ui_interface) { | |
ui_interface->openVerticalBox("test7"); | |
ui_interface->addVerticalSlider("cutoff", &fVslider0, FAUSTFLOAT(0.8f), FAUSTFLOAT(0.0f), FAUSTFLOAT(1.0f), FAUSTFLOAT(0.01f)); | |
ui_interface->closeBox(); | |
} | |
virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) { | |
FAUSTFLOAT* input0 = inputs[0]; | |
FAUSTFLOAT* output0 = outputs[0]; | |
float fSlow0 = fConst1 / (0.3f * float(fVslider0) + 0.01f); | |
for (int i0 = 0; i0 < count; i0 = i0 + 1) { | |
float fRec0 = 2.0f * float(input0[i0]) - fRec15; | |
float fRec1 = 0.0f; | |
float fRec2 = fSlow0; | |
float fRec3 = fRec14[1]; | |
float fRec4 = fConst2; | |
float fRec5 = 0.0f; | |
float fRec6 = fSlow0; | |
float fRec7 = fRec10[1]; | |
float fRec8 = fConst2; | |
float fTemp0 = fRec5 + fRec7; | |
float fRec9 = -1.0f * fTemp0; | |
float fTemp1 = fTemp0 + fRec13; | |
float fTemp2 = fRec6 + fRec8; | |
fRec10[0] = fRec7 - fRec8 * fTemp1 / fTemp2; | |
float fRec11 = fTemp2; | |
float fTemp3 = fRec11 + fRec4; | |
float fTemp4 = fRec11 * (1.0f / fRec4 + (fTemp3 / fRec4 + 1.0f) / fRec11); | |
float fTemp5 = 2.0f * (fRec9 / fTemp4); | |
float fTemp6 = 2.0f / fTemp4; | |
float fTemp7 = fRec3 * (1.0f - fTemp6); | |
float fRec12 = fTemp5 + fTemp7; | |
float fRec13 = fRec9 * (fTemp6 + -1.0f) + fRec16 + fTemp7; | |
fRec14[0] = fRec3 * (0.0f - fTemp6) + fRec16 + fTemp5; | |
float fTemp8 = fRec1 + fRec12; | |
float fRec15 = -1.0f * fTemp8; | |
float fTemp9 = fTemp8 + fRec0; | |
float fTemp10 = fRec15 + fRec2; | |
float fRec16 = fRec12 - fRec15 * fTemp9 / fTemp10; | |
output0[i0] = FAUSTFLOAT(0.5f * (fRec10[0] + fRec7)); | |
fRec10[1] = fRec10[0]; | |
fRec14[1] = fRec14[0]; | |
} | |
} | |
}; | |
#endif | |
/* ------------------------------------------------------------ | |
name: "test9" | |
Code generated with Faust 2.66.10 (https://faust.grame.fr) | |
Compilation options: -lang cpp -ct 1 -cn diode_clipper -es 1 -mcd 16 -single -ftz 0 | |
------------------------------------------------------------ */ | |
#ifndef __diode_clipper_H__ | |
#define __diode_clipper_H__ | |
#ifndef FAUSTFLOAT | |
#define FAUSTFLOAT float | |
#endif | |
#include <algorithm> | |
#include <cmath> | |
#include <cstdint> | |
#include <math.h> | |
#ifndef FAUSTCLASS | |
#define FAUSTCLASS diode_clipper | |
#endif | |
#ifdef __APPLE__ | |
#define exp10f __exp10f | |
#define exp10 __exp10 | |
#endif | |
#if defined(_WIN32) | |
#define RESTRICT __restrict | |
#else | |
#define RESTRICT __restrict__ | |
#endif | |
class diode_clipper : public dsp { | |
private: | |
int fSampleRate; | |
float fConst1; | |
float fRec0[2]; | |
float fConst3; | |
float fConst4; | |
float fConst5; | |
public: | |
diode_clipper() {} | |
void metadata(Meta* m) { | |
m->declare("compile_options", "-lang cpp -ct 1 -cn diode_clipper -es 1 -mcd 16 -single -ftz 0"); | |
m->declare("name", "test9"); | |
} | |
virtual int getNumInputs() { | |
return 1; | |
} | |
virtual int getNumOutputs() { | |
return 1; | |
} | |
static void classInit(int sample_rate) { | |
} | |
virtual void instanceConstants(int sample_rate) { | |
fSampleRate = sample_rate; | |
float fConst0 = float(fSampleRate); | |
fConst1 = 0.0f - 4.0f * fConst0; | |
float fConst2 = 4.4e-05f * fConst0 + 1.0f; | |
fConst3 = 1.0f / fConst2; | |
fConst4 = std::log(8.461539e-12f / fConst2); | |
fConst5 = 38.46154f / fConst2; | |
} | |
virtual void instanceResetUserInterface() { | |
} | |
virtual void instanceClear() { | |
for (int l0 = 0; l0 < 2; l0 = l0 + 1) { | |
fRec0[l0] = 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 diode_clipper* clone() { | |
return new diode_clipper(); | |
} | |
virtual int getSampleRate() { | |
return fSampleRate; | |
} | |
virtual void buildUserInterface(UI* ui_interface) { | |
ui_interface->openVerticalBox("test9"); | |
ui_interface->closeBox(); | |
} | |
virtual void compute(int count, FAUSTFLOAT** RESTRICT inputs, FAUSTFLOAT** RESTRICT outputs) { | |
FAUSTFLOAT* input0 = inputs[0]; | |
FAUSTFLOAT* output0 = outputs[0]; | |
for (int i0 = 0; i0 < count; i0 = i0 + 1) { | |
float fTemp0 = float(input0[i0]); | |
fRec0[0] = fConst1 * fTemp0 - fRec0[1]; | |
float fTemp1 = 45454.547f * fTemp0 - fRec0[1]; | |
float fTemp2 = ((fTemp1 < 0.0f) ? -1.0f : ((fTemp1 > 0.0f) ? 1.0f : 0.0f)); | |
float fTemp3 = 2.2e-13f * fTemp2 + 2.2e-05f * fTemp1; | |
float fRec1 = fConst3 * fTemp3 - 0.026f * fTemp2 * std::max<float>(0.0f, fConst4 + fConst5 * fTemp2 * fTemp3); | |
output0[i0] = FAUSTFLOAT(fRec1); | |
fRec0[1] = fRec0[0]; | |
} | |
} | |
}; | |
#endif | |
Render one buffer | |
chan 0 out 0.0000019550 chan 1 out 0.0000019550 | |
chan 0 out -0.1172709987 chan 1 out -0.1172709987 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248829 | |
chan 0 out -0.5729205012 chan 1 out -0.5729205012 | |
chan 0 out 0.0696952119 chan 1 out 0.0696952045 | |
chan 0 out -0.0568772145 chan 1 out -0.0568772070 | |
chan 0 out -0.5790352225 chan 1 out -0.5790352821 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248829 | |
chan 0 out -0.6909251213 chan 1 out -0.6909247041 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248233 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248233 | |
chan 0 out 0.2010078728 chan 1 out 0.2010076940 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248829 | |
chan 0 out -0.6909248829 chan 1 out -0.6909247041 | |
chan 0 out 0.6909251213 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.6909248829 chan 1 out 0.6909246445 | |
chan 0 out -0.6909250617 chan 1 out -0.6909247637 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248233 | |
chan 0 out -0.6909248829 chan 1 out -0.6909247637 | |
chan 0 out 0.6909250021 chan 1 out 0.6909246445 | |
chan 0 out -0.6909248829 chan 1 out -0.6909247041 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out -0.1474985927 chan 1 out -0.1474985480 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out 0.6397650242 chan 1 out 0.6397650838 | |
chan 0 out 0.3070639372 chan 1 out 0.3070638180 | |
chan 0 out -0.6909248829 chan 1 out -0.6909248233 | |
chan 0 out 0.6909251213 chan 1 out 0.6909246445 | |
chan 0 out -0.6540307999 chan 1 out -0.6540306807 | |
chan 0 out 0.5855204463 chan 1 out 0.5855202675 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248233 | |
chan 0 out 0.6909248829 chan 1 out 0.6909247041 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out -0.0011512304 chan 1 out -0.0011514621 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248233 | |
chan 0 out 0.1399110854 chan 1 out 0.1399107724 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248829 | |
chan 0 out 0.1170976087 chan 1 out 0.1170972586 | |
chan 0 out 0.3793792725 chan 1 out 0.3793796003 | |
chan 0 out -0.4829959869 chan 1 out -0.4829963446 | |
chan 0 out 0.0009111204 chan 1 out 0.0009114709 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.3263865709 chan 1 out 0.3263868093 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248233 | |
chan 0 out -0.6376562119 chan 1 out -0.6376563311 | |
chan 0 out 0.4469265938 chan 1 out 0.4469267428 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248829 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.6909248829 chan 1 out 0.6909246445 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247041 | |
chan 0 out 0.6208066344 chan 1 out 0.6208066344 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6736056209 chan 1 out 0.6736055613 | |
chan 0 out 0.0421693772 chan 1 out 0.0421694033 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909251213 chan 1 out -0.6909248829 | |
chan 0 out 0.6909248829 chan 1 out 0.6909245849 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909248829 chan 1 out 0.6909247041 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247041 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909251213 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909251213 chan 1 out 0.6909246445 | |
chan 0 out -0.6909251213 chan 1 out -0.6909245849 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247041 | |
chan 0 out -0.6909251213 chan 1 out -0.6909246445 | |
chan 0 out 0.6909248829 chan 1 out 0.6909245849 | |
chan 0 out -0.6909251213 chan 1 out -0.6909247637 | |
chan 0 out 0.3513566554 chan 1 out 0.3513571620 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248829 | |
chan 0 out -0.6909249425 chan 1 out -0.6909247637 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247041 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909251213 chan 1 out 0.6909246445 | |
chan 0 out -0.6909248829 chan 1 out -0.6909246445 | |
chan 0 out 0.6909251213 chan 1 out 0.6909247637 | |
chan 0 out -0.4765478075 chan 1 out -0.4765482843 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909246445 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.2223689556 chan 1 out -0.2223694175 | |
chan 0 out -0.4158200920 chan 1 out -0.4158196151 | |
chan 0 out 0.6909250617 chan 1 out 0.6909248233 | |
chan 0 out -0.6909248829 chan 1 out -0.6909246445 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.3732426763 chan 1 out -0.3732421994 | |
chan 0 out 0.6503080130 chan 1 out 0.6503075361 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248829 | |
chan 0 out -0.5809359550 chan 1 out -0.5809364915 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248829 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909249425 chan 1 out 0.6909248829 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.5983362794 chan 1 out 0.5983358026 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909251213 chan 1 out -0.6909248233 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out -0.5217220783 chan 1 out -0.5217224956 | |
chan 0 out -0.6909249425 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248233 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909250021 chan 1 out -0.6909247637 | |
chan 0 out 0.6909251213 chan 1 out 0.6909248233 | |
chan 0 out -0.6909250021 chan 1 out -0.6909248829 | |
chan 0 out 0.6909250021 chan 1 out 0.6909247637 | |
chan 0 out -0.6909248829 chan 1 out -0.6909247041 | |
chan 0 out 0.6909248829 chan 1 out 0.6909248233 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment