Mercurial > hg > midi-score-follower
comparison src/testApp.cpp @ 1:1a32ce016bb9
Changed bestEstimate timing to work via time sent from Max not the elapsed time. This had caused some problems, but this version now working surprisingly well on MIDI files with variable timing.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Thu, 18 Aug 2011 23:27:42 +0100 |
parents | b299a65a3ad0 |
children | 5581023e0de4 |
comparison
equal
deleted
inserted
replaced
0:b299a65a3ad0 | 1:1a32ce016bb9 |
---|---|
112 } | 112 } |
113 | 113 |
114 if (key == 'l') | 114 if (key == 'l') |
115 midiEvents.bayesStruct.decaySpeedDistribution(100); | 115 midiEvents.bayesStruct.decaySpeedDistribution(100); |
116 | 116 |
117 if (key == 't') | |
118 midiEvents.drawTempoMode = !midiEvents.drawTempoMode; | |
119 | |
117 if (key == 'o'){ | 120 if (key == 'o'){ |
118 //open audio file | 121 //open audio file |
119 string *filePtr; | 122 string *filePtr; |
120 filePtr = &midiFileName; | 123 filePtr = &midiFileName; |
121 | 124 |
132 | 135 |
133 } | 136 } |
134 | 137 |
135 //-------------------------------------------------------------- | 138 //-------------------------------------------------------------- |
136 void testApp::mouseMoved(int x, int y ){ | 139 void testApp::mouseMoved(int x, int y ){ |
137 | 140 midiEvents.mouseX = midiEvents.getEventTimeMillis((x * midiEvents.ticksPerScreen)/ screenWidth); |
138 } | 141 } |
139 | 142 |
140 //-------------------------------------------------------------- | 143 //-------------------------------------------------------------- |
141 void testApp::mouseDragged(int x, int y, int button){ | 144 void testApp::mouseDragged(int x, int y, int button){ |
142 | 145 |
201 | 204 |
202 | 205 |
203 int testApp::cannamMainFunction(){ | 206 int testApp::cannamMainFunction(){ |
204 | 207 |
205 | 208 |
206 midiEvents.recordedNoteOnMatrix.clear();//where we store the note ons | 209 midiEvents.clearAllEvents(); |
207 | 210 |
208 //int main(int argc, char **argv) | 211 //int main(int argc, char **argv) |
209 //{ | 212 //{ |
210 // if (argc != 2) { | 213 // if (argc != 2) { |
211 // cerr << "Usage: midifile <file.mid>" << endl; | 214 // cerr << "Usage: midifile <file.mid>" << endl; |