Mercurial > hg > midi-score-follower
comparison hackday/testApp.h @ 25:2a025ea7c793
hackday work to get live midi input, follow the notes, output measure, read measure in with midi file
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Sat, 03 Dec 2011 21:09:13 +0000 |
parents | 5a11b19906c7 |
children | 179365726f07 |
comparison
equal
deleted
inserted
replaced
24:5a11b19906c7 | 25:2a025ea7c793 |
---|---|
30 #include "ofxOsc.h" | 30 #include "ofxOsc.h" |
31 #include "MidiInputStream.h" | 31 #include "MidiInputStream.h" |
32 | 32 |
33 | 33 |
34 #define PORT 12121 | 34 #define PORT 12121 |
35 #define SEND_PORT 5282 | |
36 #define HOST "localhost" | |
37 | |
35 | 38 |
36 using namespace std; | 39 using namespace std; |
37 using namespace MIDIConstants; | 40 using namespace MIDIConstants; |
38 | 41 |
39 class testApp : public ofBaseApp{ | 42 class testApp : public ofBaseApp{ |
80 int value; | 83 int value; |
81 double timestamp; | 84 double timestamp; |
82 char msg[255]; | 85 char msg[255]; |
83 string portName; | 86 string portName; |
84 | 87 |
88 void checkNewScoreNote(); | |
89 void sendNoteToMuseScore(); | |
90 void sendMeasureToMuseScore(); | |
91 void findMeasure(); | |
85 // midi addon | 92 // midi addon |
86 ofxMidiIn midiIn; | 93 ofxMidiIn midiIn; |
87 // this is your listener function | 94 // this is your listener function |
88 void newMessage(ofxMidiEventArgs &args); | 95 void newMessage(ofxMidiEventArgs &args); |
89 | 96 |
91 | 98 |
92 double firstNoteTime; | 99 double firstNoteTime; |
93 bool liveInputPlaying; | 100 bool liveInputPlaying; |
94 double timePlayed; | 101 double timePlayed; |
95 int transpose; | 102 int transpose; |
103 int lastScoreIndexSent; | |
104 int lastMeasureSent; | |
96 private: | 105 private: |
97 ofxOscReceiver receiver; | 106 ofxOscReceiver receiver; |
98 | 107 ofxOscSender sender; |
99 | 108 |
100 | 109 |
101 }; | 110 }; |
102 | 111 |
103 #endif | 112 #endif |