diff jnmr/testApp.cpp @ 40:776694bcbd02

removed text and fixed key commands for tempo
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Mon, 19 Dec 2011 23:28:21 +0000
parents c3d32207565f
children 60c1f0fbc8f4
line wrap: on
line diff
--- a/jnmr/testApp.cpp	Fri Dec 16 18:00:53 2011 +0000
+++ b/jnmr/testApp.cpp	Mon Dec 19 23:28:21 2011 +0000
@@ -75,7 +75,7 @@
 	screenHeight = ofGetHeight();
 	midiEvents.screenWidth = &screenWidth;
 	midiEvents.screenHeight = &screenHeight;
-	midiEvents.drawTempoMode = true;
+	//midiEvents.drawTempoMode = true;
 	ofSetFrameRate(30);
 	
 	midiEvents.ticksPerScreen += 4000;
@@ -258,11 +258,15 @@
 }
 
 void testApp::sendNoteToMuseScore(){
-	if (midiEvents.recordedNoteOnMatrix.size() > 0){
-	int ticks = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][0];
-	int pitch = midiEvents.recordedNoteOnMatrix[midiEvents.bestMatchIndex][1];
-//	printf("sending to muse score %i, %i \n", ticks, pitch);
-	sendNoteDataByOsc(pitch, ticks);
+	int noteToSendIndex = lastScoreIndexSent;
+	while (noteToSendIndex < midiEvents.bestMatchIndex){
+		noteToSendIndex++;
+		if (midiEvents.recordedNoteOnMatrix.size() > 0 && noteToSendIndex < midiEvents.recordedNoteOnMatrix.size()){
+			int ticks = midiEvents.recordedNoteOnMatrix[noteToSendIndex][0];//midiEvents.bestMatchIndex
+			int pitch = midiEvents.recordedNoteOnMatrix[noteToSendIndex][1];
+			//	printf("sending to muse score %i, %i \n", ticks, pitch);
+			sendNoteDataByOsc(pitch, ticks);
+		}
 	}
 	/*
 		ofxOscMessage m;
@@ -362,7 +366,7 @@
 	
 	midiEvents.drawMidiFile(noteInStream.midiInputEvents);
 
-	drawMuseScoreText();
+	//drawMuseScoreText();
 	
 	ofSetHexColor(0x000000);
 	ofDrawBitmapString(midiPortName, 20, ofGetHeight() - 20);
@@ -464,12 +468,18 @@
 	}
 
 	if (key == 'l')
-		
-		
-		//midiEvents.bayesStruct.decaySpeedDistribution(100);
+		midiEvents.bayesStruct.decaySpeedDistribution(100);
 	
-	if (key == 't')
+	if (key == 'f'){
+		//flip
 		midiEvents.drawTempoMode = !midiEvents.drawTempoMode;
+		midiEvents.drawPhaseMode = !midiEvents.drawPhaseMode;
+	}
+	
+	
+	if (key == 't'){
+		midiEvents.drawTempoMode = !midiEvents.drawTempoMode;
+	}
 	
 	if (key == 'y')
 		midiEvents.drawPhaseMode = !midiEvents.drawPhaseMode;