Test commit into the README file.
[Faustine.git] / dsp_files / make_init.cpp
1 //-----------------------------------------------------
2 //
3 // Code generated with Faust 0.9.58 (http://faust.grame.fr)
4 //-----------------------------------------------------
5 #ifndef FAUSTFLOAT
6 #define FAUSTFLOAT float
7 #endif
8
9 typedef long double quad;
10 /* link with */
11
12 #ifndef FAUSTCLASS
13 #define FAUSTCLASS mydsp
14 #endif
15
16 class mydsp : public dsp {
17 private:
18 int iVec0[2];
19 int M0;
20 float fRec0[2];
21 public:
22 static void metadata(Meta* m) {
23 }
24
25 virtual int getNumInputs() { return 0; }
26 virtual int getNumOutputs() { return 1; }
27 static void classInit(int samplingFreq) {
28 }
29 virtual void instanceInit(int samplingFreq) {
30 fSamplingFreq = samplingFreq;
31 for (int i=0; i<2; i++) iVec0[i] = 0;
32 M0 = 0;
33 for (int i=0; i<2; i++) fRec0[i] = 0;
34 }
35 virtual void init(int samplingFreq) {
36 classInit(samplingFreq);
37 instanceInit(samplingFreq);
38 }
39 virtual void buildUserInterface(UI* interface) {
40 interface->openVerticalBox("make_init");
41 interface->closeBox();
42 }
43 virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) {
44 FAUSTFLOAT* output0 = output[0];
45 for (int i=0; i<count; i++) {
46 iVec0[0] = 1;
47 int T0 = M0;
48 M0 = 1;
49 fRec0[0] = (2.000001f + ((int(T0))?fRec0[1]:2));
50 output0[i] = (FAUSTFLOAT)fRec0[0];
51 // post processing
52 fRec0[1] = fRec0[0];
53 iVec0[1] = iVec0[0];
54 }
55 }
56 };
57
58