comparison hackday/testApp.cpp @ 31:9a70d9abdc8b

examining the tempo speed process
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Sun, 11 Dec 2011 17:19:34 +0000
parents be2e779d76b5
children f91b7b019350
comparison
equal deleted inserted replaced
30:be2e779d76b5 31:9a70d9abdc8b
60 60
61 screenWidth = ofGetWidth(); 61 screenWidth = ofGetWidth();
62 screenHeight = ofGetHeight(); 62 screenHeight = ofGetHeight();
63 midiEvents.screenWidth = &screenWidth; 63 midiEvents.screenWidth = &screenWidth;
64 midiEvents.screenHeight = &screenHeight; 64 midiEvents.screenHeight = &screenHeight;
65 midiEvents.drawTempoMode = false; 65 midiEvents.drawTempoMode = true;
66 ofSetFrameRate(30); 66 ofSetFrameRate(30);
67 67
68 midiEvents.ticksPerScreen += 4000; 68 midiEvents.ticksPerScreen += 4000;
69 lastScoreIndexSent = 0; 69 lastScoreIndexSent = 0;
70 performanceRating = 0.0; 70 performanceRating = 0.0;
97 if (velocity != 0){ 97 if (velocity != 0){
98 if (readyToStart){ 98 if (readyToStart){
99 startPlaying(); 99 startPlaying();
100 printf("starting to PLAY!!!"); 100 printf("starting to PLAY!!!");
101 } 101 }
102 102 printf("MIDI NOTE %i \n", newMidiOnPitch);
103 midiEvents.newNoteOnEvent(newMidiOnPitch, velocity, time); 103 midiEvents.newNoteOnEvent(newMidiOnPitch, velocity, time);
104 noteInStream.newNoteCounted(newMidiOnPitch); 104 noteInStream.newNoteCounted(newMidiOnPitch);
105 } 105 }
106 106
107 } 107 }
204 204
205 void testApp::sendNoteToMuseScore(){ 205 void testApp::sendNoteToMuseScore(){
206 if (midiEvents.recordedNoteOnMatrix.size() > 0){ 206 if (midiEvents.recordedNoteOnMatrix.size() > 0){
207 int ticks = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][0]; 207 int ticks = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][0];
208 int pitch = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][1]; 208 int pitch = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][1];
209 printf("sending to muse score %i, %i \n", ticks, pitch); 209 // printf("sending to muse score %i, %i \n", ticks, pitch);
210 sendNoteDataByOsc(pitch, ticks); 210 sendNoteDataByOsc(pitch, ticks);
211 } 211 }
212 /* 212 /*
213 ofxOscMessage m; 213 ofxOscMessage m;
214 m.setAddress( "/plugin" ); 214 m.setAddress( "/plugin" );
494 readyToStart = false; 494 readyToStart = false;
495 //this is where we stop and start playing 495 //this is where we stop and start playing
496 } 496 }
497 497
498 void testApp::stopPlaying(){ 498 void testApp::stopPlaying(){
499 midiEvents.printNoteCounter(); 499 //midiEvents.printNoteCounter();
500 noteInStream.printTotalCount(); 500 //noteInStream.printTotalCount();
501
501 noteInStream.calculateTotalScore(midiEvents); 502 noteInStream.calculateTotalScore(midiEvents);
502 503
503 504
504 playing = false; 505 playing = false;
505 liveInputPlaying = false; 506 liveInputPlaying = false;