annotate of/testApp.h @ 48:f33398343f18

header file and ableton max patch - recieves controller data too, filters the note in information and sends some to the mopho on channel b and the rest to ableton on midi channel a
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 04 Mar 2011 19:05:05 +0000
parents 763d56955d10
children 0eeda0223db3
rev   line source
rebecca@13 1 #ifndef _TEST_APP
rebecca@13 2 #define _TEST_APP
rebecca@13 3
rebecca@13 4 // uncomment this for OF 007 compatibility
rebecca@13 5 //#define OFX_OPENNI_BETA
rebecca@13 6
rebecca@13 7 #include "ofMain.h"
rebecca@13 8 #include "ofxOpenNI.h"
andrew@31 9 #include "ofxOsc.h"
andrew@38 10 #define NUMBER_OF_USERS 6
andrew@48 11
andrew@38 12 #define STOPPORT 12343
andrew@45 13 #define STOPHOST "localhost"
andrew@45 14
andrew@45 15 #define HERESY_PORT 12346
andrew@48 16 #define HERESY_HOST "169.254.51.147"//JOE's address??
andrew@48 17
andrew@48 18 //#define HOST "169.254.51.147"//Was Tim's ADDRESS - not used any more - use Joe's heresy_host below
andrew@48 19 //#define PORT 12344
rebecca@13 20
rebecca@13 21 class testApp : public ofBaseApp{
rebecca@13 22
rebecca@13 23 public:
rebecca@13 24 void setup();
rebecca@13 25 void update();
rebecca@13 26 void draw();
rebecca@13 27
andrew@31 28 void getCoordinates(int userID);
andrew@31 29 void sendDataViaOSC(int userID);
andrew@32 30
rebecca@13 31 void keyPressed (int key);
rebecca@13 32 void keyReleased(int key);
rebecca@13 33 void mouseMoved(int x, int y );
rebecca@13 34 void mouseDragged(int x, int y, int button);
rebecca@13 35 void mousePressed(int x, int y, int button);
rebecca@13 36 void mouseReleased(int x, int y, int button);
rebecca@13 37 void windowResized(int w, int h);
andrew@44 38 void bezierFunctionStuff(int i);
andrew@44 39 void drawAcidSmiley(int userID);
rebecca@13 40 ofxOpenNIContext context;
rebecca@13 41 ofxDepthGenerator depth;
rebecca@13 42 ofxUserGenerator user;
rebecca@13 43 ofxImageGenerator image;
rebecca@13 44 //ofImage Davy;
andrew@38 45 void sendStopMessageForUser(int userID);
andrew@45 46 void sendInformationToHeresy(int userID);
andrew@45 47 void sendNoteMessageToHeresy(int noteNumber, int onOrOff, int velocity, int channel);
andrew@31 48
andrew@31 49 ofImage anubis;
andrew@48 50 ofImage secondUserImage, thirdUserImage;
rebecca@13 51 bool drawIt;
andrew@38 52
andrew@38 53 float maxTorsoValues[3];
andrew@48 54 float leftMaximum[3];
andrew@48 55 float rightMaximum[3];
andrew@48 56
andrew@48 57 int ControlChangeData[NUMBER_OF_USERS][4];//userId, leftX, leftR, rightX, right Y
andrew@48 58 void sendControlChangeDataToMax(int userID);
andrew@48 59
andrew@38 60 void checkTorsoMaxima(int id);
andrew@44 61 int typeOfFaceToUse[NUMBER_OF_USERS];
andrew@44 62 double lastRecordedTime[NUMBER_OF_USERS];//x,y,and z of the head
andrew@32 63 float torso[6][3];//x,y,and z of the head
andrew@31 64 bool userPresent[6];
andrew@45 65 bool notePlayingArray[NUMBER_OF_USERS][16];
andrew@45 66 int pitchPlaying[NUMBER_OF_USERS];
andrew@31 67
andrew@45 68 bool nowPlaying[NUMBER_OF_USERS][16];
andrew@45 69 bool lastPlaying[NUMBER_OF_USERS][16];
andrew@45 70
andrew@45 71 float rightHandPosition[NUMBER_OF_USERS][3];
andrew@45 72 float leftHandPosition[NUMBER_OF_USERS][3];
andrew@45 73 double minMaxValues[NUMBER_OF_USERS][2];
andrew@17 74 ofTrueTypeFont franklinBook;
andrew@17 75 string outputString;
andrew@45 76 ofxOscSender sender, stopSender, heresySender;
andrew@31 77
andrew@48 78 string userInfoString[3];
andrew@48 79
rebecca@13 80 };
rebecca@13 81 #endif