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
{
21 static void metadata(Meta
* m
) {
24 virtual int getNumInputs() { return 2; }
25 virtual int getNumOutputs() { return 1; }
26 static void classInit(int samplingFreq
) {
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;
33 virtual void init(int samplingFreq
) {
34 classInit(samplingFreq
);
35 instanceInit(samplingFreq
);
37 virtual void buildUserInterface(UI
* interface
) {
38 interface
->openVerticalBox("matrix_mul.22.tmp");
39 interface
->closeBox();
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]));