comparison hackday/testApp.h @ 24:5a11b19906c7

hackday code is added.
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Sat, 03 Dec 2011 17:19:43 +0000
parents
children 2a025ea7c793
comparison
equal deleted inserted replaced
23:032edf186a68 24:5a11b19906c7
1 #ifndef _TEST_APP
2 #define _TEST_APP
3
4
5 //midieventholder - newMidiEvents() sent there
6 //create cannamMidiLoader for cannamMainfunction
7
8
9 //check new prior offset function - how is used?
10
11
12
13 //check the widening function - adding decay noise
14 //ticksperscreen could be better as millis per screen
15
16
17
18 //uses ftmMidiPlay in max5 via osc to communicate notes in
19
20 #include "ofMain.h"
21
22 #include "MIDIFileReader.h"
23 #include "ofxFileDialogOSX.h"
24 #include "drawMidiNotes.h"
25 #include "DynamicBayesianArray.h"
26 #include "CannamMidiFileLoader.h"
27 #include <iostream>
28 #include "midiEventHolder.h"
29 #include "ofxMidiIn.h"
30 #include "ofxOsc.h"
31 #include "MidiInputStream.h"
32
33
34 #define PORT 12121
35
36 using namespace std;
37 using namespace MIDIConstants;
38
39 class testApp : public ofBaseApp{
40
41 public:
42 void setup();
43 void update();
44 void draw();
45
46 void keyPressed (int key);
47 void keyReleased(int key);
48 void mouseMoved(int x, int y );
49 void mouseDragged(int x, int y, int button);
50 void mousePressed(int x, int y, int button);
51 void mouseReleased(int x, int y, int button);
52 void windowResized(int w, int h);
53
54 void startPlaying();
55 void stopPlaying();
56 bool getFilenameFromDialogBox(string* fileNameToSave);
57
58 typedef std::vector<int> IntVector;
59 typedef std::vector<double> DoubleVector;
60 // typedef std::vector<IntVector> IntMatrix;
61 IntVector v;
62
63 midiEventHolder midiEvents;
64
65 int cannamMainFunction();
66 string midiFileName;
67
68 bool playing;
69 //drawMidiNotes drawer;
70
71 // BayesianArrayStructure bayesStruct;
72
73 int screenWidth, screenHeight;
74 CannamMidiFileLoader fileLoader;
75
76 //MIDI INPUT
77 // vars
78 int port;
79 int id;
80 int value;
81 double timestamp;
82 char msg[255];
83 string portName;
84
85 // midi addon
86 ofxMidiIn midiIn;
87 // this is your listener function
88 void newMessage(ofxMidiEventArgs &args);
89
90 MidiInputStream noteInStream;
91
92 double firstNoteTime;
93 bool liveInputPlaying;
94 double timePlayed;
95 int transpose;
96 private:
97 ofxOscReceiver receiver;
98
99
100
101 };
102
103 #endif