Test commit into the README file.
[Faustine.git] / dsp_files / import_test.1.tmp.cpp
1 //-----------------------------------------------------
2 // name: " noise "
3 // copyright: " ( c ) GRAME 2006 "
4 //
5 // Code generated with Faust 0.9.58 (http://faust.grame.fr)
6 //-----------------------------------------------------
7 #ifndef FAUSTFLOAT
8 #define FAUSTFLOAT float
9 #endif
10
11 typedef long double quad;
12 /* link with */
13
14 #ifndef FAUSTCLASS
15 #define FAUSTCLASS mydsp
16 #endif
17
18 class mydsp : public dsp {
19 private:
20 int iRec0[2];
21 public:
22 static void metadata(Meta* m) {
23 m->declare("name", " noise ");
24 m->declare("copyright", " ( c ) GRAME 2006 ");
25 m->declare("music.lib/name", "Music Library");
26 m->declare("music.lib/author", "GRAME");
27 m->declare("music.lib/copyright", "GRAME");
28 m->declare("music.lib/version", "1.0");
29 m->declare("music.lib/license", "LGPL with exception");
30 m->declare("math.lib/name", "Math Library");
31 m->declare("math.lib/author", "GRAME");
32 m->declare("math.lib/copyright", "GRAME");
33 m->declare("math.lib/version", "1.0");
34 m->declare("math.lib/license", "LGPL with exception");
35 }
36
37 virtual int getNumInputs() { return 0; }
38 virtual int getNumOutputs() { return 1; }
39 static void classInit(int samplingFreq) {
40 }
41 virtual void instanceInit(int samplingFreq) {
42 fSamplingFreq = samplingFreq;
43 for (int i=0; i<2; i++) iRec0[i] = 0;
44 }
45 virtual void init(int samplingFreq) {
46 classInit(samplingFreq);
47 instanceInit(samplingFreq);
48 }
49 virtual void buildUserInterface(UI* interface) {
50 interface->openVerticalBox("import_test.1.tmp");
51 interface->closeBox();
52 }
53 virtual void compute (int count, FAUSTFLOAT** input, FAUSTFLOAT** output) {
54 FAUSTFLOAT* output0 = output[0];
55 for (int i=0; i<count; i++) {
56 iRec0[0] = (12345 + (1103515245 * iRec0[1]));
57 output0[i] = (FAUSTFLOAT)(4.656612875245797e-10f * iRec0[0]);
58 // post processing
59 iRec0[1] = iRec0[0];
60 }
61 }
62 };
63
64