hekeus@6: hekeus@6: hekeus@6: #include "ofMain.h" hekeus@6: #include "Voice.h" hekeus@6: hekeus@6: #include "ofxOsc.h" hekeus@6: hekeus@6: hekeus@6: hekeus@6: hekeus@6: hekeus@6: class melodyTriangle : public ofBaseApp{ hekeus@6: hekeus@6: public: hekeus@8: melodyTriangle(const char *host, int port, int numVoices, bool enableKeys, int voiceIdOffset, int receivePort); hekeus@6: hekeus@6: void setup(); hekeus@6: void update(); hekeus@6: void draw(); hekeus@6: hekeus@6: void keyPressed(int key); hekeus@6: void keyReleased(int key); hekeus@6: void mouseMoved(int x, int y ); hekeus@6: void mouseDragged(int x, int y, int button); hekeus@6: void mousePressed(int x, int y, int button); hekeus@6: void mouseReleased(int x, int y, int button); hekeus@6: void windowResized(int w, int h); hekeus@6: int numVoices; hekeus@6: int voiceIdOffset; hekeus@6: bool enableKeys; hekeus@6: float counter; hekeus@6: bool bSmooth; hekeus@6: Voice *voices[10]; hekeus@6: hekeus@6: int x1,y1,x2,y2,x3,y3;//Triangle Coords hekeus@6: int triangleHeight; hekeus@6: int voiceGrabbed; samer@14: void sendPosition(Voice v); samer@12: void sendCalibrate(); samer@12: void sendPeriod(int id, int num, int den); samer@12: void sendShift(int id, int num, int den); samer@12: void sendOctave(int id, int oct); samer@13: void sendAmplitude(int id, float amp); hekeus@6: hekeus@6: hekeus@6: private: hekeus@6: ofxOscSender sender; hekeus@8: ofxOscReceiver receiver; samer@15: int DX13, DY13, SQLEN13; samer@15: samer@15: bool clipToTriangle(int *cx, int *cy); hekeus@6: };