hekeus@6
|
1
|
hekeus@6
|
2
|
hekeus@6
|
3 #include "ofMain.h"
|
hekeus@6
|
4 #include "Voice.h"
|
hekeus@6
|
5
|
hekeus@6
|
6 #include "ofxOsc.h"
|
hekeus@6
|
7
|
hekeus@6
|
8
|
hekeus@6
|
9
|
hekeus@6
|
10
|
hekeus@6
|
11
|
hekeus@6
|
12 class melodyTriangle : public ofBaseApp{
|
hekeus@6
|
13
|
hekeus@6
|
14 public:
|
hekeus@8
|
15 melodyTriangle(const char *host, int port, int numVoices, bool enableKeys, int voiceIdOffset, int receivePort);
|
hekeus@6
|
16
|
hekeus@6
|
17 void setup();
|
hekeus@6
|
18 void update();
|
hekeus@6
|
19 void draw();
|
hekeus@6
|
20
|
hekeus@6
|
21 void keyPressed(int key);
|
hekeus@6
|
22 void keyReleased(int key);
|
hekeus@6
|
23 void mouseMoved(int x, int y );
|
hekeus@6
|
24 void mouseDragged(int x, int y, int button);
|
hekeus@6
|
25 void mousePressed(int x, int y, int button);
|
hekeus@6
|
26 void mouseReleased(int x, int y, int button);
|
hekeus@6
|
27 void windowResized(int w, int h);
|
hekeus@6
|
28 int numVoices;
|
hekeus@6
|
29 int voiceIdOffset;
|
hekeus@6
|
30 bool enableKeys;
|
hekeus@6
|
31 float counter;
|
hekeus@6
|
32 bool bSmooth;
|
hekeus@6
|
33 Voice *voices[10];
|
hekeus@6
|
34
|
hekeus@6
|
35 int x1,y1,x2,y2,x3,y3;//Triangle Coords
|
hekeus@6
|
36 int triangleHeight;
|
hekeus@6
|
37 int voiceGrabbed;
|
samer@14
|
38 void sendPosition(Voice v);
|
samer@12
|
39 void sendCalibrate();
|
samer@12
|
40 void sendPeriod(int id, int num, int den);
|
samer@12
|
41 void sendShift(int id, int num, int den);
|
samer@12
|
42 void sendOctave(int id, int oct);
|
samer@13
|
43 void sendAmplitude(int id, float amp);
|
hekeus@6
|
44
|
hekeus@6
|
45
|
hekeus@6
|
46 private:
|
hekeus@6
|
47 ofxOscSender sender;
|
hekeus@8
|
48 ofxOscReceiver receiver;
|
samer@15
|
49 int DX13, DY13, SQLEN13;
|
samer@15
|
50
|
samer@15
|
51 bool clipToTriangle(int *cx, int *cy);
|
hekeus@6
|
52 };
|