Mercurial > hg > multitrack-audio-matcher
diff src/testApp.cpp @ 3:5e188c0035b6
checking the offsets of the arrays
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Wed, 01 Feb 2012 16:05:26 +0000 |
parents | 179c09199b3c |
children | 746a5af43c02 |
line wrap: on
line diff
--- a/src/testApp.cpp Tue Jan 31 21:34:19 2012 +0000 +++ b/src/testApp.cpp Wed Feb 01 16:05:26 2012 +0000 @@ -34,44 +34,7 @@ //audioFilePlayer.loadAudioFile(infilename); } -/* -void testApp::loadTestAudio(){ - - const char *infilename = "../../../data/sound/bach4_short1.wav"; - - //LoadedAudioHolder lah; - // lah.loadAudioFile(infilename); - // loadedAudioFiles.push_back(lah); - - //Take care here - we need a pointer to create new instance - //but not then delete the instance before the vector of all audio tracks has been used - //the above code using lah has problem that it deletes objects once out of the scope of testApp.setup() - //when lah is in theory no longer used - something like that possible? - at least pointers to onset detection seem deleted - loadedAudioPtr = new LoadedAudioHolder; - loadedAudioPtr->loadAudioFile(infilename); - // loadedAudioFiles.push_back(*loadedAudioPtr); - loadedAudioFiles[0] = *loadedAudioPtr; - - loadedAudioFiles[0].fileLoader.onsetDetect.window.setToRelativeSize(0, 0.0, 1, 0.25); - - // printf("Loaded audio %i\n", (int)numberOfAudioTracks); - printf("loaded max val is %f\n", loadedAudioFiles[0].fileLoader.onsetDetect.onsetDetector.maximumDetectionValue); - - printf("BEFORE LOADING 1\n"); - keyPressed('p'); - - loadedAudioPtr = new LoadedAudioHolder; - loadedAudioPtr->loadAudioFile(infilename); - // loadedAudioFiles.push_back(*loadedAudioPtr); - loadedAudioFiles[1] = *loadedAudioPtr; - loadedAudioFiles[1].fileLoader.onsetDetect.window.setToRelativeSize(0, 0.3, 1, 0.25); - - printf("AFTER LOADING 1\n"); - keyPressed('p'); - -} - */ //-------------------------------------------------------------- void testApp::update(){ @@ -96,7 +59,7 @@ if ( m.getAddress() == "/aubioPitch" ){ float pitchIn = m.getArgAsFloat(0); int timeIn = m.getArgAsInt32(1); - printf("AUBIO PITCH RECEIVED %f at time %i\n", pitchIn, timeIn); + printf("\nAUBIO PITCH RECEIVED %f at time %i\n", pitchIn, timeIn); eventMatcher.newPitchEvent(pitchIn, timeIn); } @@ -113,6 +76,11 @@ printf("snare RECEIVED at time %f\n", timeIn); eventMatcher.newSnareEvent(timeIn); } + + if ( m.getAddress() == "/start" ){ + printf("start!\n"); + eventMatcher.startPlaying(); + } } } @@ -170,7 +138,7 @@ } if (key == 'p'){ - + eventMatcher.bayesianStruct.posterior.printArray(); }