andrew@49
|
1 #pragma once
|
andrew@49
|
2
|
andrew@49
|
3 #include "ofMain.h"
|
andrew@49
|
4
|
andrew@49
|
5 #include "Annotations.h"
|
andrew@49
|
6 #include "matchAnnotations.h"
|
andrew@49
|
7 #include "jnmrMidiPlayerAnnotations.h"
|
andrew@49
|
8
|
andrew@51
|
9 class TimingResult{
|
andrew@51
|
10 public:
|
andrew@51
|
11
|
andrew@50
|
12 double median;
|
andrew@50
|
13 double mean;
|
andrew@50
|
14 int count;
|
andrew@50
|
15 double percentileCount[7];
|
andrew@50
|
16 double percentiles[7];
|
andrew@50
|
17 int type;
|
andrew@51
|
18
|
andrew@51
|
19 TimingResult(){
|
andrew@51
|
20 median= 0;
|
andrew@51
|
21 mean = 0;
|
andrew@51
|
22 count = 0;
|
andrew@51
|
23 for (int i = 0;i <7;i++){
|
andrew@51
|
24 percentileCount[i] = 0;
|
andrew@51
|
25 percentiles[i] = 0;
|
andrew@51
|
26 }
|
andrew@51
|
27 }
|
andrew@50
|
28 };
|
andrew@50
|
29
|
andrew@51
|
30
|
andrew@51
|
31
|
andrew@49
|
32 class testApp : public ofBaseApp{
|
andrew@49
|
33
|
andrew@49
|
34 public:
|
andrew@49
|
35 void setup();
|
andrew@49
|
36 void update();
|
andrew@49
|
37 void draw();
|
andrew@49
|
38
|
andrew@49
|
39 void keyPressed (int key);
|
andrew@49
|
40 void keyReleased(int key);
|
andrew@49
|
41 void mouseMoved(int x, int y );
|
andrew@49
|
42 void mouseDragged(int x, int y, int button);
|
andrew@49
|
43 void mousePressed(int x, int y, int button);
|
andrew@49
|
44 void mouseReleased(int x, int y, int button);
|
andrew@49
|
45 void windowResized(int w, int h);
|
andrew@49
|
46 void dragEvent(ofDragInfo dragInfo);
|
andrew@49
|
47 void gotMessage(ofMessage msg);
|
andrew@49
|
48
|
andrew@49
|
49 Annotations rwcAnnotations;
|
andrew@49
|
50
|
andrew@49
|
51 void loadRWCfileNumber(const int& i);
|
andrew@49
|
52 vector<std::string> rwcFileNameStrings;
|
andrew@49
|
53 void createRWCfilenameStrings();
|
andrew@49
|
54 string annotationRoot ;
|
andrew@49
|
55 std::string makeRWCfilename(std::string& root, const int& fileID, std::string& endPart);
|
andrew@49
|
56 void loadAnnotation(const int& fileID);
|
andrew@49
|
57
|
andrew@49
|
58 string matchPath;
|
andrew@50
|
59 std::string makeMatchFilename( const int& fileID, std::string matchEnd);
|
andrew@49
|
60
|
andrew@49
|
61 matchAnnotations matchNotations;
|
andrew@49
|
62
|
andrew@49
|
63 string jnmrPlayerPath, jnmrPlayerRoot;
|
andrew@49
|
64 jnmrMidiPlayerAnnotations jnmrPlayerAnnotations;
|
andrew@49
|
65
|
andrew@50
|
66 void calculateMatchErrors(TimingResult& t);
|
andrew@50
|
67 void calculateMatchForwardErrors(TimingResult& t);
|
andrew@49
|
68
|
andrew@50
|
69 void sortDifferenceVector(vector<float> diffVec, TimingResult& t);
|
andrew@50
|
70 void addToPercentiles(float value, TimingResult& t);
|
andrew@50
|
71
|
andrew@50
|
72 vector<TimingResult> matchOF_results;
|
andrew@50
|
73 vector<TimingResult> matchOB_results;
|
andrew@50
|
74 vector<TimingResult> JNMR_MidiMatcher_results;
|
andrew@50
|
75
|
andrew@51
|
76 TimingResult final_JNMR_Midi;
|
andrew@51
|
77 TimingResult final_Match_OF;
|
andrew@51
|
78 TimingResult final_Match_OB;
|
andrew@51
|
79
|
andrew@51
|
80
|
andrew@51
|
81 std::string matchRoot;// = "/Users/andrew/Documents/work/programming/Shell Scripts/MatchMidiToMidiOutput/RWCmatch_RM-C";
|
andrew@50
|
82 void getResults(const int& fileID);
|
andrew@51
|
83 void calculateOverallPercentiles();
|
andrew@51
|
84 void calculateOverallMatchPercentiles();
|
andrew@50
|
85 int fileNumberToTest;
|
andrew@49
|
86 };
|