diff ofxPreciseOnsetDetectorOffline/testApp.cpp @ 3:50f62c48b421

Small change
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 03 Jan 2014 17:43:02 +0000
parents 7ec1ed0b2eb0
children eb29c6b6dff8
line wrap: on
line diff
--- a/ofxPreciseOnsetDetectorOffline/testApp.cpp	Mon Dec 30 14:08:42 2013 +0000
+++ b/ofxPreciseOnsetDetectorOffline/testApp.cpp	Fri Jan 03 17:43:02 2014 +0000
@@ -5,7 +5,7 @@
 //--------------------------------------------------------------
 void testApp::setup(){
 	pov.window.setToRelativeSize(0.1, 0.1, 0.8, 0.3);
-	pov.pod = &preciseOnsetDetect;
+	pov.pod = &preciseOnsetDetect;//set up pointer if we want to visualise the onsets in a window
 	
 //	preciseOnsetDetect.load("/Users/andrew/Documents/work/programming/MadMax/AudioFiles/AdamBetts/AdamBetss_1_Swing_Kick.wav");
 //	preciseOnsetDetect.load("/Users/andrew/Music/Logic/GreenOnionsChichester/GreenOnionsChichester/Bouncing/Snare_Sontronics#08edit.aif");
@@ -18,10 +18,6 @@
 	preciseOnsetDetect.load(filename);
 	preciseOnsetDetect.printOnsetLocations();
 	
-	//windowStart = 0;
-	//windowEnd = preciseOnsetDetect.samples/44100.;
-	//windowPress = 0;
-	
 	pov.newFile();
 }
 
@@ -35,18 +31,10 @@
 void testApp::draw(){
 	
 	pov.draw();
-	/*
-	//if plotting use this, else comment out
-	ofSetColor(ofColor::white);
-	window.drawBackground();
-	ofSetColor(ofColor::black);
-	window.drawOutline();
-	ofSetColor(ofColor::blue);
-	plotter.drawBeatStripes(preciseOnsetDetect.onsetLocations, window, windowStart, windowEnd);
-*/
-	
+
 }
 
+
 //--------------------------------------------------------------
 void testApp::keyPressed(int key){
 	std::string loadName;
@@ -60,6 +48,10 @@
 		case 'e':
 			pov.cropEnd();
 			break;
+		case 'x':
+			printf("Exporting between %f and %f\n", pov.windowStart, pov.windowEnd);
+			preciseOnsetDetect.exportOnsetTimes(pov.windowStart, pov.windowEnd);
+			break;
 		case 'o':
 			 if (getFilenameFromDialogBox(&loadName)){
 				printf("loading %s\n", (loadName).c_str());