andrew@49
|
1 #include "testApp.h"
|
andrew@51
|
2 const int totalNumberFiles = 61;
|
andrew@49
|
3 //--------------------------------------------------------------
|
andrew@49
|
4 void testApp::setup(){
|
andrew@49
|
5 //fixed stuff
|
andrew@49
|
6 annotationRoot = "/Users/andrew/Documents/work/Alignment/MuseScore/RWC/ANNOTATION/RM-C0";
|
andrew@52
|
7 jnmrPlayerRoot = "/Users/andrew/Documents/work/programming/of_preRelease_v007_osx/apps/myOpenFrameworks007/JNMR_MidiFollower/bin/data/FilesOut/";
|
andrew@52
|
8
|
andrew@52
|
9 //set which parameter set to test
|
andrew@52
|
10 jnmrPlayerRoot += "rwc_output_likelihood0pt6";//width 100ms
|
andrew@52
|
11 // jnmrPlayerRoot += "rwcOutput_likelihood0pt8_width50";
|
andrew@52
|
12 // jnmrPlayerRoot += "completeTestsTempoMAPestimate_likelihood0pt2";
|
andrew@52
|
13
|
andrew@52
|
14 jnmrPlayerRoot += "/rwcOutputData_RM-C0";
|
andrew@51
|
15 // matchRoot = "/Users/andrew/Documents/work/programming/Shell Scripts/MatchAudioToMidiOutput/RWCmatch_RM-C";//ACTUAL AUDIO VERSION OF WARPED
|
andrew@51
|
16 matchRoot = "/Users/andrew/Documents/work/programming/Shell Scripts/MatchMidiToMidiOutput/RWCmatch_RM-C";//MIDI VERSION OF WARPED
|
andrew@51
|
17
|
andrew@49
|
18 createRWCfilenameStrings();
|
andrew@49
|
19
|
andrew@51
|
20 fileNumberToTest = 0;
|
andrew@51
|
21
|
andrew@51
|
22 while (fileNumberToTest < totalNumberFiles){
|
andrew@51
|
23 loadAnnotation(fileNumberToTest);
|
andrew@51
|
24 getResults(fileNumberToTest);
|
andrew@51
|
25 fileNumberToTest++;
|
andrew@51
|
26 }
|
andrew@51
|
27 calculateOverallPercentiles();
|
andrew@51
|
28 calculateOverallMatchPercentiles();
|
andrew@51
|
29 }
|
andrew@51
|
30
|
andrew@51
|
31 void testApp::calculateOverallPercentiles(){
|
andrew@51
|
32
|
andrew@51
|
33 int numberToCount = 61;//totalNumberFiles;
|
andrew@51
|
34 printf("\nFINAL PERCENTILES for %i files\n", numberToCount);
|
andrew@51
|
35 final_JNMR_Midi.count = 0;
|
andrew@51
|
36 for (int i =0;i < numberToCount;i++){
|
andrew@51
|
37 for (int k = 0;k < 7;k++){
|
andrew@51
|
38 final_JNMR_Midi.percentileCount[k] += JNMR_MidiMatcher_results[i].percentileCount[k];
|
andrew@51
|
39 //printf("file %i, precentile count[%i] is %f\n", i, k, JNMR_MidiMatcher_results[i].percentileCount[k]);
|
andrew@51
|
40 }
|
andrew@51
|
41 final_JNMR_Midi.count += JNMR_MidiMatcher_results[i].count;
|
andrew@51
|
42 }
|
andrew@51
|
43
|
andrew@51
|
44 for (int p = 0;p < 7;p++){
|
andrew@51
|
45 final_JNMR_Midi.percentiles[p] = final_JNMR_Midi.percentileCount[p] / final_JNMR_Midi.count;
|
andrew@51
|
46 printf("final JNMR percentile [%i] = %.2f, count %i, perc count %.1f\n", p, final_JNMR_Midi.percentiles[p]*100.0, final_JNMR_Midi.count, final_JNMR_Midi.percentileCount[p]);
|
andrew@51
|
47
|
andrew@51
|
48
|
andrew@51
|
49 }
|
andrew@51
|
50
|
andrew@51
|
51 for (int i = 0;i < 7;i++){
|
andrew@51
|
52 printf("%.1f &", final_JNMR_Midi.percentiles[i]*100.0);
|
andrew@51
|
53 }
|
andrew@51
|
54 }
|
andrew@51
|
55
|
andrew@51
|
56
|
andrew@51
|
57 void testApp::calculateOverallMatchPercentiles(){
|
andrew@51
|
58
|
andrew@51
|
59 int numberToCount = 61;//totalNumberFiles;
|
andrew@51
|
60 printf("\n FINAL MATCH FORWARDS PERCENTILES for %i files\n", numberToCount);
|
andrew@51
|
61 final_Match_OF.count = 0;
|
andrew@51
|
62 final_Match_OB.count = 0;
|
andrew@51
|
63
|
andrew@51
|
64 for (int i =0;i < numberToCount;i++){
|
andrew@51
|
65 for (int k = 0;k < 7;k++){
|
andrew@51
|
66 final_Match_OF.percentileCount[k] += matchOF_results[i].percentileCount[k];
|
andrew@51
|
67 final_Match_OB.percentileCount[k] += matchOB_results[i].percentileCount[k];
|
andrew@51
|
68 }
|
andrew@51
|
69 final_Match_OF.count += matchOF_results[i].count;
|
andrew@51
|
70 final_Match_OB.count += matchOB_results[i].count;
|
andrew@51
|
71 }
|
andrew@51
|
72
|
andrew@51
|
73 for (int p = 0;p < 7;p++){
|
andrew@51
|
74
|
andrew@51
|
75 final_Match_OF.percentiles[p] = final_Match_OF.percentileCount[p] / final_Match_OF.count;
|
andrew@51
|
76 final_Match_OB.percentiles[p] = final_Match_OB.percentileCount[p] / final_Match_OB.count;
|
andrew@51
|
77
|
andrew@51
|
78 printf("final Match_OF percentile [%i] = %.2f, count %i, perc count %.1f\n", p, final_Match_OF.percentiles[p]*100.,
|
andrew@51
|
79 final_Match_OF.count, final_Match_OF.percentileCount[p]);
|
andrew@51
|
80 }
|
andrew@51
|
81 printf("\n FINAL MATCH BACKWARDS PERCENTILES for %i files\n", numberToCount);
|
andrew@51
|
82 for (int p = 0;p < 7;p++){
|
andrew@51
|
83 printf("final Match_OB percentile [%i] = %.2f, count %i, perc count %.1f\n", p, final_Match_OB.percentiles[p]*100.,
|
andrew@51
|
84 final_Match_OB.count, final_Match_OB.percentileCount[p]);
|
andrew@51
|
85 }
|
andrew@51
|
86 printf("\nOB: ");
|
andrew@51
|
87 for (int i = 0;i < 7;i++){
|
andrew@51
|
88 printf("%.1f &", final_Match_OB.percentiles[i]*100.0);
|
andrew@51
|
89 }
|
andrew@51
|
90 printf("\nOF: ");
|
andrew@51
|
91 for (int i = 0;i < 7;i++){
|
andrew@51
|
92 printf("%.1f &", final_Match_OF.percentiles[i]*100.0);
|
andrew@51
|
93 }
|
andrew@50
|
94 }
|
andrew@50
|
95
|
andrew@50
|
96 void testApp::getResults(const int& fileID){
|
andrew@49
|
97
|
andrew@49
|
98 std::string txtEnd = ".txt";
|
andrew@49
|
99 //naming convention
|
andrew@49
|
100 //match output must also follow the RWC ID
|
andrew@49
|
101 //01, 02, 03 etc
|
andrew@49
|
102
|
andrew@50
|
103 std::string matchEnd = "_ob.out";
|
andrew@50
|
104 matchPath = makeMatchFilename(fileID, matchEnd);//makeRWCfilename(matchRoot, fileID, matchEnd);
|
andrew@50
|
105 printf("MATCH PATH OB: %s\n", matchPath.c_str());
|
andrew@50
|
106 matchNotations.readInMatchFile(matchPath);
|
andrew@50
|
107 TimingResult matchObResult;
|
andrew@50
|
108 calculateMatchErrors(matchObResult);
|
andrew@50
|
109 matchOB_results.push_back(matchObResult);
|
andrew@49
|
110
|
andrew@50
|
111 matchEnd = "_of.out";
|
andrew@50
|
112 matchPath = makeMatchFilename(fileID, matchEnd);//makeRWCfilename(matchRoot, fileID, matchEnd);
|
andrew@50
|
113 printf("MATCH PATH OF: %s\n", matchPath.c_str());
|
andrew@50
|
114 matchNotations.readInMatchFile(matchPath);
|
andrew@50
|
115 TimingResult matchOfResult;
|
andrew@50
|
116 calculateMatchForwardErrors(matchOfResult);
|
andrew@50
|
117 matchOF_results.push_back(matchOfResult);
|
andrew@49
|
118
|
andrew@49
|
119
|
andrew@49
|
120 jnmrPlayerPath = makeRWCfilename(jnmrPlayerRoot, fileID, txtEnd);//+ "rwcOutputData_RM-C003.txt";
|
andrew@49
|
121 jnmrPlayerAnnotations.readInjnmrMidiPlayerFile(jnmrPlayerPath);
|
andrew@49
|
122
|
andrew@49
|
123 printf("JNMR DIFFERENCES\n");
|
andrew@50
|
124 TimingResult jnmrResult;
|
andrew@50
|
125 sortDifferenceVector(jnmrPlayerAnnotations.differences, jnmrResult);
|
andrew@50
|
126 JNMR_MidiMatcher_results.push_back(jnmrResult);
|
andrew@50
|
127
|
andrew@50
|
128 printf("\n");
|
andrew@50
|
129 }
|
andrew@50
|
130
|
andrew@50
|
131
|
andrew@50
|
132 std::string testApp::makeMatchFilename( const int& fileID, std::string matchEnd){
|
andrew@50
|
133
|
andrew@50
|
134 string rootToUse = matchRoot;
|
andrew@50
|
135 if (fileID > 8){
|
andrew@50
|
136 rootToUse += "0";
|
andrew@50
|
137 }
|
andrew@50
|
138 string matchName = makeRWCfilename(rootToUse, fileID, matchEnd);
|
andrew@50
|
139 return matchName;
|
andrew@49
|
140 }
|
andrew@49
|
141
|
andrew@49
|
142
|
andrew@49
|
143 std::string testApp::makeRWCfilename(std::string& root, const int& fileID, std::string& endPart){
|
andrew@49
|
144 std::string pathName;
|
andrew@49
|
145 if (fileID >= 0 && fileID <= 64){
|
andrew@49
|
146
|
andrew@49
|
147 pathName = root + rwcFileNameStrings[fileID]+endPart;
|
andrew@49
|
148 /*
|
andrew@49
|
149 if (fileID >= 10)
|
andrew@49
|
150 pathName = root + ofToString(fileID)+endPart;
|
andrew@49
|
151 else
|
andrew@49
|
152 pathName = root + "0"+ofToString(fileID)+endPart;
|
andrew@49
|
153 */
|
andrew@49
|
154 //printf("RWC PATH:%s\n", pathName.c_str());
|
andrew@49
|
155 }
|
andrew@49
|
156 return pathName;
|
andrew@49
|
157 }
|
andrew@49
|
158
|
andrew@49
|
159 void testApp::createRWCfilenameStrings(){
|
andrew@49
|
160 rwcFileNameStrings.clear();
|
andrew@49
|
161 for (int i = 1;i< 10;i++){
|
andrew@49
|
162 rwcFileNameStrings.push_back("0"+ofToString(i));
|
andrew@49
|
163 }
|
andrew@49
|
164 for (int i = 10;i< 23;i++){
|
andrew@49
|
165 rwcFileNameStrings.push_back(ofToString(i));
|
andrew@49
|
166 }
|
andrew@49
|
167 rwcFileNameStrings.push_back("23A");
|
andrew@49
|
168 rwcFileNameStrings.push_back("23B");
|
andrew@49
|
169 rwcFileNameStrings.push_back("23C");
|
andrew@49
|
170 rwcFileNameStrings.push_back("23D");
|
andrew@49
|
171 rwcFileNameStrings.push_back("23E");
|
andrew@49
|
172
|
andrew@49
|
173 rwcFileNameStrings.push_back("24A");
|
andrew@49
|
174 rwcFileNameStrings.push_back("24B");
|
andrew@49
|
175 rwcFileNameStrings.push_back("24C");
|
andrew@49
|
176
|
andrew@49
|
177 rwcFileNameStrings.push_back("25A");
|
andrew@49
|
178 rwcFileNameStrings.push_back("25B");
|
andrew@49
|
179 rwcFileNameStrings.push_back("25C");
|
andrew@49
|
180 rwcFileNameStrings.push_back("25D");
|
andrew@49
|
181
|
andrew@49
|
182 for (int i = 26;i< 35;i++){
|
andrew@49
|
183 rwcFileNameStrings.push_back(ofToString(i));
|
andrew@49
|
184 }
|
andrew@49
|
185 rwcFileNameStrings.push_back("35A");
|
andrew@49
|
186 rwcFileNameStrings.push_back("35B");
|
andrew@49
|
187 rwcFileNameStrings.push_back("35C");
|
andrew@49
|
188 for (int i = 36;i< 51;i++){
|
andrew@49
|
189 rwcFileNameStrings.push_back(ofToString(i));
|
andrew@49
|
190 }
|
andrew@49
|
191
|
andrew@49
|
192 // for (int i = 0;i < rwcFileNameStrings.size();i++) {
|
andrew@49
|
193 // printf("RWC{%i}:'%s'\n", i, rwcFileNameStrings[i].c_str());
|
andrew@49
|
194 // }
|
andrew@49
|
195
|
andrew@49
|
196 }
|
andrew@49
|
197
|
andrew@49
|
198 void testApp::loadAnnotation(const int& fileID){
|
andrew@49
|
199
|
andrew@49
|
200 string annotationEnding = "_annotation+WavPos.csv";
|
andrew@49
|
201 string path = makeRWCfilename(annotationRoot, fileID, annotationEnding );
|
andrew@49
|
202 //printf("read in annotations from\n%s\n", path.c_str());
|
andrew@49
|
203 rwcAnnotations.readInRWCfile(path);
|
andrew@49
|
204 }
|
andrew@49
|
205
|
andrew@49
|
206
|
andrew@50
|
207 void testApp::calculateMatchErrors(TimingResult& t){
|
andrew@49
|
208 int matchIndex = 0;
|
andrew@49
|
209
|
andrew@49
|
210 vector<float> matchDiffs;
|
andrew@49
|
211
|
andrew@49
|
212 for (int i = 0;i < rwcAnnotations.rwcAnnotations.size();i++){
|
andrew@49
|
213 // printf("rwc time %f midi time %f\n", rwcAnnotations.rwcAnnotations[i].eventTime, rwcAnnotations.rwcAnnotations[i].midiTime);
|
andrew@49
|
214
|
andrew@49
|
215 while (matchIndex < matchNotations.matchData.size() && matchNotations.matchData[matchIndex].midiTime < rwcAnnotations.rwcAnnotations[i].midiTime)
|
andrew@49
|
216 matchIndex++;
|
andrew@49
|
217
|
andrew@49
|
218 while (matchNotations.matchData[matchIndex].midiTime > rwcAnnotations.rwcAnnotations[i].midiTime)
|
andrew@49
|
219 matchIndex--;
|
andrew@49
|
220
|
andrew@49
|
221 // float matchFraction = (rwcAnnotations.rwcAnnotations[i].midiTime - matchNotations.matchData[matchIndex].midiTime)/(matchNotations.matchData[matchIndex+1].midiTime - matchNotations.matchData[matchIndex].midiTime);
|
andrew@49
|
222 // matchFraction *= (matchNotations.matchData[matchIndex+1].audioTime - matchNotations.matchData[matchIndex].audioTime);
|
andrew@49
|
223 float matchTime = matchNotations.matchData[matchIndex].audioTime;// +matchFraction ;
|
andrew@49
|
224
|
andrew@49
|
225 // printf("matchTime %f gives event time %f from flat event time %f\n", matchNotations.matchData[matchIndex].midiTime, matchTime, matchNotations.matchData[matchIndex].audioTime);
|
andrew@49
|
226
|
andrew@49
|
227 float matchDifference = 1000.0*(matchTime - rwcAnnotations.rwcAnnotations[i].eventTime);
|
andrew@49
|
228 // printf("Match diff %f\n", matchDifference);
|
andrew@49
|
229
|
andrew@49
|
230 matchDiffs.push_back(fabs(matchDifference));
|
andrew@49
|
231 }
|
andrew@49
|
232
|
andrew@50
|
233 sortDifferenceVector(matchDiffs, t);
|
andrew@49
|
234
|
andrew@49
|
235 }
|
andrew@49
|
236
|
andrew@49
|
237
|
andrew@50
|
238 void testApp::calculateMatchForwardErrors(TimingResult& t){
|
andrew@50
|
239 int matchIndex = 0;
|
andrew@50
|
240
|
andrew@50
|
241 vector<float> matchDiffs;
|
andrew@50
|
242
|
andrew@50
|
243 for (int i = 0;i < rwcAnnotations.rwcAnnotations.size();i++){
|
andrew@50
|
244 // printf("rwc time %f midi time %f\n", rwcAnnotations.rwcAnnotations[i].eventTime, rwcAnnotations.rwcAnnotations[i].midiTime);
|
andrew@50
|
245
|
andrew@50
|
246 while (matchIndex < matchNotations.matchData.size() && matchNotations.matchData[matchIndex].midiTime > rwcAnnotations.rwcAnnotations[i].midiTime)
|
andrew@50
|
247 matchIndex++;
|
andrew@50
|
248
|
andrew@50
|
249 while (matchNotations.matchData[matchIndex].midiTime < rwcAnnotations.rwcAnnotations[i].midiTime)
|
andrew@50
|
250 matchIndex--;
|
andrew@50
|
251
|
andrew@50
|
252 // float matchFraction = (rwcAnnotations.rwcAnnotations[i].midiTime - matchNotations.matchData[matchIndex].midiTime)/(matchNotations.matchData[matchIndex+1].midiTime - matchNotations.matchData[matchIndex].midiTime);
|
andrew@50
|
253 // matchFraction *= (matchNotations.matchData[matchIndex+1].audioTime - matchNotations.matchData[matchIndex].audioTime);
|
andrew@50
|
254 float matchTime = matchNotations.matchData[matchIndex].audioTime;// +matchFraction ;
|
andrew@50
|
255
|
andrew@50
|
256 // printf("matchTime %f gives event time %f from flat event time %f\n", matchNotations.matchData[matchIndex].midiTime, matchTime, matchNotations.matchData[matchIndex].audioTime);
|
andrew@50
|
257
|
andrew@50
|
258 float matchDifference = 1000.0*(matchTime - rwcAnnotations.rwcAnnotations[i].eventTime);
|
andrew@50
|
259 // printf("Match diff %f\n", matchDifference);
|
andrew@50
|
260
|
andrew@50
|
261 matchDiffs.push_back(fabs(matchDifference));
|
andrew@50
|
262 }
|
andrew@50
|
263
|
andrew@50
|
264 sortDifferenceVector(matchDiffs, t);
|
andrew@50
|
265
|
andrew@50
|
266 }
|
andrew@50
|
267
|
andrew@50
|
268
|
andrew@50
|
269
|
andrew@50
|
270 void testApp::sortDifferenceVector(vector<float> diffVec, TimingResult& t){
|
andrew@49
|
271
|
andrew@49
|
272 //GETS MEAN AND MEDIAN
|
andrew@49
|
273 int count = 0;
|
andrew@49
|
274 float total = 0;
|
andrew@49
|
275
|
andrew@49
|
276 for (int i = 0;i < diffVec.size();i++){
|
andrew@49
|
277 // printf("M[%i] : %f\n", i, matchDiffs[i]);
|
andrew@49
|
278
|
andrew@49
|
279 count++;
|
andrew@49
|
280 total += fabs(diffVec[i]);
|
andrew@49
|
281 diffVec[i] = fabs(diffVec[i]);//replace with +ve value
|
andrew@50
|
282
|
andrew@50
|
283 addToPercentiles(diffVec[i], t);
|
andrew@49
|
284 }
|
andrew@49
|
285 total /= count;
|
andrew@49
|
286
|
andrew@49
|
287 std::sort(diffVec.begin(), diffVec.end());//sort vector
|
andrew@50
|
288 t.median = diffVec[(int)(diffVec.size()/2)];
|
andrew@50
|
289 t.mean = total;
|
andrew@50
|
290 t.count = count;
|
andrew@52
|
291 printf("Count %i Median %3.1f, mean is %3.1f\n", count, diffVec[(int)(diffVec.size()/2)], total);
|
andrew@49
|
292
|
andrew@50
|
293 for (int i = 0;i < 7;i++){
|
andrew@50
|
294 t.percentiles[i] = t.percentileCount[i] / count;
|
andrew@50
|
295 printf("Perc[%i] = %2.1f, ", i, (t.percentiles[i]*100.0));
|
andrew@50
|
296 }
|
andrew@50
|
297 printf("\n");
|
andrew@49
|
298
|
andrew@49
|
299 }
|
andrew@49
|
300
|
andrew@50
|
301 void testApp::addToPercentiles(float value, TimingResult& t){
|
andrew@50
|
302
|
andrew@50
|
303 if (value <= 20){
|
andrew@50
|
304 t.percentileCount[0]++;
|
andrew@50
|
305 }
|
andrew@50
|
306 if (value <= 40){
|
andrew@50
|
307 t.percentileCount[1]++;
|
andrew@50
|
308 }
|
andrew@50
|
309 if (value <= 60){
|
andrew@50
|
310 t.percentileCount[2]++;
|
andrew@50
|
311 }
|
andrew@50
|
312 if (value <= 100){
|
andrew@50
|
313 t.percentileCount[3]++;
|
andrew@50
|
314 }
|
andrew@50
|
315 if (value <= 200){
|
andrew@50
|
316 t.percentileCount[4]++;
|
andrew@50
|
317 }
|
andrew@50
|
318 if (value <= 500){
|
andrew@50
|
319 t.percentileCount[5]++;
|
andrew@50
|
320 }
|
andrew@50
|
321 if (value <= 1000){
|
andrew@50
|
322 t.percentileCount[6]++;
|
andrew@50
|
323 }
|
andrew@50
|
324
|
andrew@50
|
325
|
andrew@50
|
326 }
|
andrew@50
|
327
|
andrew@49
|
328 //--------------------------------------------------------------
|
andrew@49
|
329 void testApp::update(){
|
andrew@49
|
330
|
andrew@49
|
331 }
|
andrew@49
|
332
|
andrew@49
|
333 //--------------------------------------------------------------
|
andrew@49
|
334 void testApp::draw(){
|
andrew@49
|
335
|
andrew@49
|
336 }
|
andrew@49
|
337
|
andrew@49
|
338 //--------------------------------------------------------------
|
andrew@49
|
339 void testApp::keyPressed(int key){
|
andrew@49
|
340
|
andrew@50
|
341 if (key == ' '){
|
andrew@50
|
342 fileNumberToTest++;
|
andrew@50
|
343 loadAnnotation(fileNumberToTest);
|
andrew@50
|
344 getResults(fileNumberToTest);
|
andrew@50
|
345 }
|
andrew@50
|
346
|
andrew@49
|
347 }
|
andrew@49
|
348
|
andrew@49
|
349 //--------------------------------------------------------------
|
andrew@49
|
350 void testApp::keyReleased(int key){
|
andrew@49
|
351
|
andrew@49
|
352 }
|
andrew@49
|
353
|
andrew@49
|
354 //--------------------------------------------------------------
|
andrew@49
|
355 void testApp::mouseMoved(int x, int y ){
|
andrew@49
|
356
|
andrew@49
|
357 }
|
andrew@49
|
358
|
andrew@49
|
359 //--------------------------------------------------------------
|
andrew@49
|
360 void testApp::mouseDragged(int x, int y, int button){
|
andrew@49
|
361
|
andrew@49
|
362 }
|
andrew@49
|
363
|
andrew@49
|
364 //--------------------------------------------------------------
|
andrew@49
|
365 void testApp::mousePressed(int x, int y, int button){
|
andrew@49
|
366
|
andrew@49
|
367 }
|
andrew@49
|
368
|
andrew@49
|
369 //--------------------------------------------------------------
|
andrew@49
|
370 void testApp::mouseReleased(int x, int y, int button){
|
andrew@49
|
371
|
andrew@49
|
372 }
|
andrew@49
|
373
|
andrew@49
|
374 //--------------------------------------------------------------
|
andrew@49
|
375 void testApp::windowResized(int w, int h){
|
andrew@49
|
376
|
andrew@49
|
377 }
|
andrew@49
|
378
|
andrew@49
|
379 //--------------------------------------------------------------
|
andrew@49
|
380 void testApp::gotMessage(ofMessage msg){
|
andrew@49
|
381
|
andrew@49
|
382 }
|
andrew@49
|
383
|
andrew@49
|
384 //--------------------------------------------------------------
|
andrew@49
|
385 void testApp::dragEvent(ofDragInfo dragInfo){
|
andrew@49
|
386
|
andrew@50
|
387 }
|
andrew@50
|
388
|
andrew@50
|
389 /*
|
andrew@50
|
390 //GETS MEAN AND MEDIAN
|
andrew@50
|
391 int count = 0;
|
andrew@50
|
392 float total = 0;
|
andrew@50
|
393
|
andrew@50
|
394 for (int i = 0;i < matchDiffs.size();i++){
|
andrew@50
|
395 // printf("M[%i] : %f\n", i, matchDiffs[i]);
|
andrew@50
|
396
|
andrew@50
|
397 count++;
|
andrew@50
|
398 total += fabs(matchDiffs[i]);
|
andrew@50
|
399
|
andrew@50
|
400 }
|
andrew@50
|
401 total /= count;
|
andrew@50
|
402
|
andrew@50
|
403 std::sort(matchDiffs.begin(), matchDiffs.end());
|
andrew@50
|
404
|
andrew@50
|
405 // printf("SORTED TWO HUNDRED\n");
|
andrew@50
|
406
|
andrew@50
|
407 // for (int i = 0;i < matchDiffs.size() ;i++){
|
andrew@50
|
408 // printf("M[%i] : %f\n", i, matchDiffs[i]);
|
andrew@50
|
409 // }
|
andrew@50
|
410
|
andrew@50
|
411 printf("MATCH median %f, mean is %f\n", matchDiffs[(int)(matchDiffs.size()/2)], total);
|
andrew@50
|
412 */
|