Test commit into the README file.
[Faustine.git] / dsp_files / matrix_mul.22.tmp.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 float fVec0[2];
19 float fRec0[2];
20 public:
21 static void metadata(Meta* m) {
22 }
23
24 virtual int getNumInputs() { return 2; }
25 virtual int getNumOutputs() { return 1; }
26 static void classInit(int samplingFreq) {
27 }
28 virtual void instanceInit(int samplingFreq) {
29 fSamplingFreq = samplingFreq;
30 for (int i=0; i<2; i++) fVec0[i] = 0;
31 for (int i=0; i<2; i++) fRec0[i] = 0;
32 }
33 virtual void init(int samplingFreq) {
34 classInit(samplingFreq);
35 instanceInit(samplingFreq);
36 }
37 virtual void buildUserInterface(UI* interface) {
38 interface->openVerticalBox("matrix_mul.22.tmp");
39 interface->closeBox();
40 }
41 virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) {
42 FAUSTFLOAT* input0 = input[0];
43 FAUSTFLOAT* input1 = input[1];
44 FAUSTFLOAT* output0 = output[0];
45 for (int i=0; i<count; i++) {
46 fVec0[0] = ((float)input0[i] / (float)input1[i]);
47 float fTemp0 = (fVec0[1] + fRec0[1]);
48 fRec0[0] = (0 - (fTemp0 - floorf(fTemp0)));
49 output0[i] = (FAUSTFLOAT)int((400 * fRec0[1]));
50 // post processing
51 fRec0[1] = fRec0[0];
52 fVec0[1] = fVec0[0];
53 }
54 }
55 };
56
57