1 //-----------------------------------------------------
3 // Code generated with Faust 0.9.58 (http://faust.grame.fr)
4 //-----------------------------------------------------
6 #define FAUSTFLOAT float
9 typedef long double quad
;
13 #define FAUSTCLASS mydsp
16 class mydsp
: public dsp
{
20 static void metadata(Meta
* m
) {
23 virtual int getNumInputs() { return 0; }
24 virtual int getNumOutputs() { return 1; }
25 static void classInit(int samplingFreq
) {
27 virtual void instanceInit(int samplingFreq
) {
28 fSamplingFreq
= samplingFreq
;
29 for (int i
=0; i
<2; i
++) iRec0
[i
] = 0;
31 virtual void init(int samplingFreq
) {
32 classInit(samplingFreq
);
33 instanceInit(samplingFreq
);
35 virtual void buildUserInterface(UI
* interface
) {
36 interface
->openVerticalBox("square.0.tmp");
37 interface
->closeBox();
39 virtual void compute (int count
, FAUSTFLOAT
** input
, FAUSTFLOAT
** output
) {
40 FAUSTFLOAT
* output0
= output
[0];
41 for (int i
=0; i
<count
; i
++) {
42 iRec0
[0] = (1 + (iRec0
[1] % 441));
43 output0
[i
] = (FAUSTFLOAT
)((2 * ((iRec0
[0] - 1) > 220.5f
)) - 1);