# HG changeset patch # User Andrew N Robertson # Date 1344977112 -3600 # Node ID 5274e3b5479d853d31e9a6ec9157c6b167407b32 # Parent e359b9bad81100d07dcbb9acf52ee81f6037f17f Smoothed output, added tempo distribution variation to match the output diff -r e359b9bad811 -r 5274e3b5479d EvaluationPlan.pages Binary file EvaluationPlan.pages has changed diff -r e359b9bad811 -r 5274e3b5479d annotationCalculatorSrc/BeatAnnotationReader.cpp --- a/annotationCalculatorSrc/BeatAnnotationReader.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/annotationCalculatorSrc/BeatAnnotationReader.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -16,7 +16,7 @@ // "/Users/andrew/Documents/work/MuseScore/RWC/ANNOTATION/RM-C002_annotation+WavPos.csv" beatTimes.clear(); - printf("READ FILE %s\n", pathName.c_str()); + printf("- - - - \n\nREAD FILE %s\n", pathName.c_str()); ifstream file ( pathName.c_str()); string value, tmpLine; stringstream iss; diff -r e359b9bad811 -r 5274e3b5479d annotationCalculatorSrc/testApp.cpp --- a/annotationCalculatorSrc/testApp.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/annotationCalculatorSrc/testApp.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -6,7 +6,7 @@ histogramWidth = 10; histogramBinNumber = 25; - + ewertFlag = true; // multiAbsTotalHistogram.createAbsoluteHistogram(histogramWidth, histogramBinNumber); // matchBackwardsAbsTotalHistogram.createAbsoluteHistogram(histogramWidth, histogramBinNumber); @@ -20,7 +20,7 @@ ewertAbsTotalHistogram.createAbsoluteHistogramForMatchData(); //processFile(0); - for (int i = 0;i < 5;i++){ + for (int i = 0;i < 11;i++){ processFile(i); } @@ -70,6 +70,7 @@ liveToRehMatchOBpath = "../../../data/MarbleArch/marbleArchlive4_reh6_match_OB.out"; ewertReader.swapOrder = false; ewertAlignmentPath = "../../../data/EwertResults/MarbleArch_Take4_multiMix__MarbleArch_Take6_multiMix.csv"; + ewertFlag = true; break; case 1: @@ -80,7 +81,7 @@ liveToRehMatchOBpath = "../../../data/Lewes/LewesLive14_reh13p_match_OB.out"; ewertReader.swapOrder = true; ewertAlignmentPath = "../../../data/EwertResults/Lewes_Take13_Newproper_Multimix__Lewes_Take14_Multimix.csv"; - + ewertFlag = true; break; case 2: liveGroundTruthPath = "../../../data/Wanderlust/wanderlust_take15_svBeats.txt"; @@ -92,6 +93,7 @@ liveToRehMatchOBpath = "../../../data/Wanderlust/wanderlustLive15_reh16_match_OB.out"; ewertReader.swapOrder = false; ewertAlignmentPath = "../../../data/EwertResults/Wanderlust_Take15__Wanderlust_Take16.csv"; + ewertFlag = true; break; case 3: @@ -103,7 +105,7 @@ liveToRehMatchOBpath = "../../../data/DiamondWhite/DiamondWhite_live1_reh2_match_OB.out"; ewertReader.swapOrder = false; ewertAlignmentPath = "../../../data/EwertResults/DiamondWhite_Take1__DiamondWhite_Take2.csv"; - + ewertFlag = true; break; case 4: @@ -115,19 +117,72 @@ liveToRehMatchOBpath = "../../../data/Motorcade/Motorcade_live53_reh57_match_OB.out"; ewertReader.swapOrder = false; ewertAlignmentPath = "../../../data/EwertResults/Motorcade_mix_Take53__Motorcade_mix_Take57.csv"; + ewertFlag = true; break; - - case 5: + + liveGroundTruthPath = "../../../data/Festival/Festival21_beats.txt"; + rehearsalGroundTruthPath = "../../../data/Festival/Festival23_beats.txt"; + liveToRehMultitrackAlignmentPath = "../../../data/Festival/FestivalOutput_live21_reh23.txt"; + liveToRehMatchOFpath = "../../../data/Festival/Festival_LiveTwo21_RehThree23_match_OF.out"; + liveToRehMatchOBpath = "../../../data/Festival/Festival_LiveTwo21_RehThree23_match_OB.out"; + ewertAlignmentPath = ""; + ewertFlag = false; + break; + + case 6: + + liveGroundTruthPath = "../../../data/StationGate/StationGate_final1_beats.txt"; + rehearsalGroundTruthPath = "../../../data/StationGate/StationGate_final2_beats.txt"; + liveToRehMultitrackAlignmentPath = "../../../data/StationGate/StationGate_final_reh_takeTwo_liveTakeOne_output.txt"; + liveToRehMatchOFpath = "../../../data/StationGate/StationGate_Live1_reh2_match_OF.out"; + liveToRehMatchOBpath = "../../../data//StationGate/StationGate_Live1_reh2_match_OB.out"; + ewertAlignmentPath = ""; + ewertFlag = false; + break; + + case 7: + liveGroundTruthPath = "../../../data/PennyArcade/PennyArcade_TrRehearsalBeats.txt"; + rehearsalGroundTruthPath = "../../../data/PennyArcade/PennyArcade_StudioMixdown_beats.txt"; + liveToRehMultitrackAlignmentPath = "../../../data/PennyArcade/PennyArcade_Live_TrRehMay12_Reh_StudioVersion14a_output.txt"; + liveToRehMatchOFpath = "../../../data/PennyArcade/PennyArcade_LiveTrReh_rehStudioMix14a_match_OF.out"; + liveToRehMatchOBpath = "../../../data/PennyArcade/PennyArcade_LiveTrReh_rehStudioMix14a_match_OB.out"; + ewertAlignmentPath = ""; + ewertFlag = false; + break; + + + case 8: //THESE NEED FIXING OF GROUTND TRUTH BEATS - liveGroundTruthPath = "../../../data/SonOfMan/SonOfMan_take2_svBeats.txt"; - rehearsalGroundTruthPath = "../../../data/SonOfMan/SonOfMan_take3_svBeats.txt"; + liveGroundTruthPath = "../../../data/SonOfMan/SonOfMan_take2_beats.txt"; + rehearsalGroundTruthPath = "../../../data/SonOfMan/SonOfMan_take3_beats.txt"; liveToRehMultitrackAlignmentPath = "../../../data/SonOfMan/SonOfMan_live2_reh3_thinner_output.txt"; liveToRehMatchOFpath = "../../../data/SonOfMan/SonOfMan_live2_reh3_match_OF.out"; liveToRehMatchOBpath = "../../../data/SonOfMan/SonOfMan_live2_reh3_match_OB.out"; + ewertAlignmentPath = "../../../data/SonOfMan/SonOfMan_take2__SonOfMan_take3.csv"; + ewertFlag = true; + break; + + case 9: + liveGroundTruthPath = "../../../data/NewYearsResolution/NewYearsResolution_take6_beats.txt"; + rehearsalGroundTruthPath = "../../../data/NewYearsResolution/NewYearsResolution_take11_beats.txt"; + liveToRehMultitrackAlignmentPath = "../../../data/NewYearsResolution/NewYearsResolution_liveTakeSix_rehTake11studio_output.txt"; + liveToRehMatchOFpath = "../../../data/NewYearsResolution/NewYearsResolution_Live6_reh11_match_OF.out"; + liveToRehMatchOBpath = "../../../data/NewYearsResolution/NewYearsResolution_Live6_reh11_match_OB.out"; + ewertAlignmentPath = ""; + ewertFlag = false; + break; + + case 10: + liveGroundTruthPath = "../../../data/Stones/Stones_take2_beats.txt"; + rehearsalGroundTruthPath = "../../../data/Stones/Stones_take3_beats.txt"; + liveToRehMultitrackAlignmentPath = "../../../data/Stones/stones_RehTakeThree_liveTakeTwo_output_new.txt"; + liveToRehMatchOFpath = "../../../data/Stones/Stones_liveTake2_RehTake3_OF.out"; + liveToRehMatchOBpath = "../../../data/Stones/Stones_liveTake2_RehTake3_OB.out"; + ewertAlignmentPath = ""; + ewertFlag = false; break; - default: /*liveGroundTruthPath = NULL; @@ -167,9 +222,11 @@ matchForwardNotations.readInMatchFile(liveToRehMatchOFpath); matchForwardNotations.reverseAnnotations();//which needs reversing - - ewertReader.readInBeatsFile(ewertAlignmentPath); - + if (ewertFlag) + ewertReader.readInBeatsFile(ewertAlignmentPath); + else{ + printf("No alignment file for Ewert method"); + } } diff -r e359b9bad811 -r 5274e3b5479d annotationCalculatorSrc/testApp.h --- a/annotationCalculatorSrc/testApp.h Tue Jul 17 22:12:20 2012 +0100 +++ b/annotationCalculatorSrc/testApp.h Tue Aug 14 21:45:12 2012 +0100 @@ -78,4 +78,5 @@ EwertAnnotationReader ewertReader; void readEwertAnnotations(); std::string ewertAlignmentPath; + bool ewertFlag; }; diff -r e359b9bad811 -r 5274e3b5479d bayesianArraySrc/BayesianArrayStructure.cpp --- a/bayesianArraySrc/BayesianArrayStructure.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/bayesianArraySrc/BayesianArrayStructure.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -117,9 +117,6 @@ //relativeSpeedPosterior.addGaussianShapeFromRealTime(1, 3, 0.5); - //tmp debug test - //relativeSpeedPosterior.addToIndex(relativeSpeedPosterior.getRealTermsAsIndex(1.8), 0.15); - relativeSpeedPosterior.renormalise(); relativeSpeedPosterior.getMaximum(); @@ -290,10 +287,13 @@ prior.offset = newOffset; likelihood.offset = newOffset; - //posterior.offset = newOffset; } +void BayesianArrayStructure::zeroDistributionAtPosition(DynamicVector& distribution, const double& position){ + distribution.zero(); + setNewDistributionOffsets(max(0., position - (distribution.scalar*distribution.arraySize/2))); +} void BayesianArrayStructure::updateBayesianDistributions(const double& newEventTime){ @@ -326,7 +326,7 @@ crossUpdateArrays(posterior, relativeSpeedPosterior, timeDifference); //i.e. using the same offset as prior - posterior.offset = prior.offset;// + posterior.offset = prior.offset;// NOW in SRT NEW DISTBN OFFSET // float tmpPrior = max(0., bestEstimate - (prior.scalar*prior.arraySize/2));// prior.offset = max(0., bestEstimate - (prior.scalar*prior.arraySize/2)); // printf("Using prior offset of %f not %f\n", tmpPrior, prior.offset); diff -r e359b9bad811 -r 5274e3b5479d bayesianArraySrc/BayesianArrayStructure.h --- a/bayesianArraySrc/BayesianArrayStructure.h Tue Jul 17 22:12:20 2012 +0100 +++ b/bayesianArraySrc/BayesianArrayStructure.h Tue Aug 14 21:45:12 2012 +0100 @@ -106,5 +106,6 @@ int startingWindowWidth, matchWindowWidth; bool updatingSpeedDistribution;//false for testing + void zeroDistributionAtPosition(DynamicVector& distribution, const double& position); }; #endif diff -r e359b9bad811 -r 5274e3b5479d src/AccompanimentSynchroniser.cpp --- a/src/AccompanimentSynchroniser.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/src/AccompanimentSynchroniser.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -15,6 +15,7 @@ AccompanimentSynchroniser::AccompanimentSynchroniser(){ sender.setup(HOST, SENDER_PORT); counter = 0; + movingAverageWeighting = 0.4; reset(); } @@ -30,7 +31,8 @@ recordedPositionTimeSent = 0; speed = 1; - + smoothedSpeedOutput = 1; + difference = 0; } @@ -51,20 +53,22 @@ void AccompanimentSynchroniser::updateOutputSpeed(){ //we want the playing position to more closely align with the recordedPosition - - double difference = recordedPositionMillis - playingPositionMillis; + + difference += 0.5*((recordedPositionMillis - playingPositionMillis)-difference); // difference -= (recordedPositionTimeSent - playingPositionTimeSent); //suppose we project that we will align in 1 seconds time double projectedAlignmentTime = 1000; //then our current speed projects forward - double predictedPlayingTimeIncrease = projectedAlignmentTime*speed; + double predictedPlayingTimeIncrease = projectedAlignmentTime * smoothedSpeedOutput;//speed; difference += (projectedAlignmentTime - predictedPlayingTimeIncrease); - double tmpSpeed = speed; - speed += difference/projectedAlignmentTime; + double tmpSpeed = smoothedSpeedOutput; + speed = smoothedSpeedOutput + (difference/projectedAlignmentTime); - sendSpeed(speed); + smoothedSpeedOutput = movingAverageWeighting*speed + (1- movingAverageWeighting)*tmpSpeed; + + sendSpeed(smoothedSpeedOutput); if (counter % 10 == 0){ printf("SYNC: rec pos %f play pos %f, diff %f\n", recordedPositionMillis, playingPositionMillis, recordedPositionMillis - playingPositionMillis); @@ -81,5 +85,10 @@ m.setAddress( "/setSpeed" ); m.addFloatArg( val ); sender.sendMessage( m ); + + ofxOscMessage z; + z.setAddress( "/syncDifference" ); + z.addFloatArg( difference ); + sender.sendMessage( z ); } } \ No newline at end of file diff -r e359b9bad811 -r 5274e3b5479d src/AccompanimentSynchroniser.h --- a/src/AccompanimentSynchroniser.h Tue Jul 17 22:12:20 2012 +0100 +++ b/src/AccompanimentSynchroniser.h Tue Aug 14 21:45:12 2012 +0100 @@ -44,13 +44,13 @@ double recordedPositionMillis; double recordedPositionTimeSent; + + double speed, smoothedSpeedOutput; + double movingAverageWeighting, difference; + private: - - - - double speed; - + ofxOscSender sender; void sendSpeed(double const& val); diff -r e359b9bad811 -r 5274e3b5479d src/AudioEventMatcher.cpp --- a/src/AudioEventMatcher.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/src/AudioEventMatcher.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -14,7 +14,7 @@ const float pitchCutOff = 16;//within which pitches are even considered -bool printInfo = false; +bool printInfo = true; AudioEventMatcher::AudioEventMatcher(){ @@ -27,6 +27,10 @@ chromaLikelihoodWidth = 50;//ms round onset event onsetLikelihoodToNoise = 0.2;//0.1 and 10 as to 9/5/12 + kickLikelihoodToNoise = 0.3; + snareLikelihoodToNoise = 0.1; + + onsetLikelihoodWidth = 6;//in ms setArraySizes(); @@ -46,7 +50,7 @@ drawLikelihoods = true; drawPosterior = false; - temporal.printOutput = printInfo; + temporal.printOutput = true;//printInfo; // temporal.setUpEventTimeMatrix(); @@ -57,6 +61,7 @@ void AudioEventMatcher::setWindowDimensions(){ + double startHeight = recordedTracks.numberOfAudioTracks * recordedTracks.trackScreenHeight; double heightAvailable = 1 - startHeight; heightAvailable /= numberOfChannels; @@ -87,11 +92,11 @@ printf("synchroniser has %f samples\n", synchroniser.fileLengthSamples); calculateRecordedTempoData(); - printf("\n\nFIRST PASS: FINAL recorded tempo is %f\n", recordedTempoData.playingTempo); + printf("\n audioeventmatcher\nFIRST PASS: FINAL recorded tempo is %f\n", recordedTempoData.playingTempo); setTempoPrior(recordedTempoData.playingTempo); calculateRecordedTempoData();//now calculate again using better prior - printf("\n\nSECOND PASS: FINAL recorded tempo is %f\n", recordedTempoData.playingTempo); + printf("\n audioeventmatcher\nSECOND PASS: FINAL recorded tempo is %f\n", recordedTempoData.playingTempo); printf("GLOBAL TEMPO of RECORDED FILES\n"); recordedTempoData.printTempoTimes(); } @@ -108,7 +113,9 @@ indexForOnsets[0] = 0; indexForOnsets[1] = 0; indexForOnsets[2] = 0; + int kickTime, snareTime; + while (indexForOnsets[0] < recordedTracks.loadedAudioFiles[0].fileLoader.onsetDetect.chromaOnsets.size() || indexForOnsets[2] < recordedTracks.loadedAudioFiles[2].fileLoader.onsetDetect.chromaOnsets.size()) { @@ -116,19 +123,18 @@ setNextOnsetTime(2, snareTime, &indexForOnsets[0]); if (kickTime < snareTime){ - printf("update kick at %i\n", kickTime); + printf("kick(%i) at %i\n", indexForOnsets[0], kickTime); recordedTempoData.updateTempo(0, kickTime); - printf("recorded tempo is %f\n", recordedTempoData.playingTempo); + // printf("recorded tempo is %f\n", recordedTempoData.playingTempo); indexForOnsets[0]++; }else { - printf("update snare at %i\n", snareTime); + printf("snare(%i) at %i\n", indexForOnsets[2], snareTime); recordedTempoData.updateTempo(2, snareTime); - printf("recorded tempo is %f\n", recordedTempoData.playingTempo); + // printf("recorded tempo is %f\n", recordedTempoData.playingTempo); indexForOnsets[2]++; } }//end while - } void AudioEventMatcher::setNextOnsetTime(const int& channel, int& time, int* indexForOnsets){ @@ -154,6 +160,7 @@ recordedTempo = recordedTempoData.globalTempo[recordedTempoIndex]; currentSpeedRatio = 1; + relativeTempo = 1; temporal.tempoPosterior.zero(); temporal.tempoPosterior.addGaussianShapeFromRealTime(recordedTempo, 2000, 1); @@ -172,8 +179,8 @@ //here is the speed combo actually used bayesianStruct.relativeSpeedPosterior.zero(); // bayesianStruct.relativeSpeedPosterior.addToIndex(bayesianStruct.relativeSpeedPosterior.getRealTermsAsIndex(speedRatio), 1); - bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(1, 0.1, 3); - bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(1, 0.02, 2); + bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(speedRatio, 0.1, 3); + bayesianStruct.relativeSpeedPosterior.addGaussianShapeFromRealTime(speedRatio, 0.02, 2); } void AudioEventMatcher::stopPlaying(){ @@ -198,9 +205,9 @@ else */ recordedTracks.updatePositionToMillis(currentAlignmentPosition); + updateBestAlignmentPosition(); - updateBestAlignmentPosition(); - }else{ + } else { recordedTracks.updatePosition(); markerPlaybackPosition = recordedTracks.loadedAudioFiles[0].fileLoader.onsetDetect.framesToMillis(recordedTracks.loadedAudioFiles[0].fileLoader.onsetDetect.playPositionFrames); currentAlignmentPosition = markerPlaybackPosition; @@ -222,7 +229,6 @@ currentSpeedRatio = temporal.playingTempo / recordedTempo; if (currentSpeedRatio != tmpRatio) setSpeedRatioDistribution(currentSpeedRatio); - }//end if to prevent debug crash } @@ -330,7 +336,13 @@ void AudioEventMatcher::setToPosition(const double& position){ bayesianStruct.posterior.zero(); + bayesianStruct.zeroDistributionAtPosition(bayesianStruct.posterior, position); bayesianStruct.posterior.addGaussianShapeFromRealTime(position, 100, 1); + + bayesianStruct.prior.zero(); + bayesianStruct.zeroDistributionAtPosition(bayesianStruct.prior, position); + bayesianStruct.prior.addGaussianShapeFromRealTime(position, 100, 1); + // bayesianStruct.posterior.addConstant(0.1); // bayesianStruct.prior.zero(); // bayesianStruct.prior.addConstant(1); @@ -475,10 +487,14 @@ int index = getScreenWidthIndexOfEventTime(recentPitchEventTime); //this window would be used (recordedTracks.loadedAudioFiles[1].fileLoader.onsetDetect.window); + ofSetColor(255, 255, 255); + ofDrawBitmapString("curr.speed "+ofToString(synchroniser.smoothedSpeedOutput, 3), 20, ofGetHeight() - 10); + } int AudioEventMatcher::getScreenWidthIndexOfEventTime(const double& time){ - return (time - screenStartTimeMillis)*ofGetWidth()/screenWidthMillis; + return (time - screenStartTimeMillis + )*ofGetWidth()/screenWidthMillis; } void AudioEventMatcher::drawTrackLikelihoods(){ @@ -529,7 +545,7 @@ ofSetColor(255); std::string dataString = "Live time "+ofToString(synchroniser.recordedPositionTimeSent); dataString += ", Reh time "+ofToString(synchroniser.recordedPositionMillis); - ofDrawBitmapString(dataString, 10, ofGetHeight() - 20); + ofDrawBitmapString(dataString, 10, ofGetHeight() - 40); } @@ -566,6 +582,7 @@ recentPitch = pitchIn;//for drawing recentPitchEventTime = timeIn; } + checkTempo(); } @@ -583,34 +600,50 @@ likelihoodVisualisation[channel] = bayesianStruct.likelihood; - + checkTempo(); } void AudioEventMatcher::newKickEvent(const double& timeIn){ // liveInput.addKickEvent(timeIn); - matchNewOnsetEvent(0, timeIn); - likelihoodVisualisation[0] = bayesianStruct.likelihood; + newKickEvent(0, timeIn); +// matchNewOnsetEvent(0, timeIn); +// likelihoodVisualisation[0] = bayesianStruct.likelihood; } void AudioEventMatcher::newKickEvent(const int& channel, const double& timeIn){ // liveInput.addKickEvent(timeIn); matchNewOnsetEvent(channel, timeIn); likelihoodVisualisation[0] = bayesianStruct.likelihood; + checkTempo(); } void AudioEventMatcher::newSnareEvent(const double& timeIn){ - matchNewOnsetEvent(2, timeIn); - likelihoodVisualisation[2] = bayesianStruct.likelihood; + newSnareEvent(2, timeIn); + +// matchNewOnsetEvent(2, timeIn); +// likelihoodVisualisation[2] = bayesianStruct.likelihood; } - void AudioEventMatcher::newSnareEvent(const int& channel, const double& timeIn){ matchNewOnsetEvent(channel, timeIn); likelihoodVisualisation[2] = bayesianStruct.likelihood; + checkTempo(); } +void AudioEventMatcher::checkTempo(){ + + if (synchroniser.speed > 0.92 && synchroniser.speed < 1.08){ + // double relativeTempo = 1 + + // relativeTempo += 0.4 * (synchroniser.speed - relativeTempo); + printf("Speed %f new tempo %f\n\n", synchroniser.speed, synchroniser.smoothedSpeedOutput); + setSpeedRatioDistribution(synchroniser.smoothedSpeedOutput); + } + +} + + #pragma mark -EventMatching //Needs just to set bounds for the matching process, not have TimeIn void AudioEventMatcher::matchNewOnsetEvent(const int& channel, const double& timeIn){ @@ -621,7 +654,21 @@ bayesianStruct.likelihood.offset = bayesianStruct.prior.offset; bayesianStruct.likelihood.zero();//set to zero //double quantity = 1;// - double quantity = 1*onsetLikelihoodToNoise;//BETTER CHANGE THIS BACK TOO..see below//likelihoodToNoiseRatio / numberOfMatches; + double quantity; + + switch (channel) { + case 0: + quantity = kickLikelihoodToNoise;// onsetLikelihoodToNoise; + //BETTER CHANGE THIS BACK TOO..see below//likelihoodToNoiseRatio / numberOfMatches; + break; + case 2: + quantity = snareLikelihoodToNoise;// onsetLikelihoodToNoise; + //BETTER CHANGE THIS BACK TOO..see below//likelihoodToNoiseRatio / numberOfMatches; + break; + } + + + int numberOfMatchesFound = 0; double nearestOnsetDistance = 1000; double startMatchingTime = bayesianStruct.likelihood.offset; @@ -648,7 +695,7 @@ if (numberOfMatchesFound > 0){ // bayesianStruct.likelihood.addConstant((1-likelihoodToNoiseRatio)/bayesianStruct.likelihood.length); // bayesianStruct.likelihood.addConstant(numberOfMatchesFound*(1-onsetLikelihoodToNoise)/(onsetLikelihoodToNoise*bayesianStruct.likelihood.length)); - bayesianStruct.likelihood.addConstant(numberOfMatchesFound*(1-onsetLikelihoodToNoise)/(bayesianStruct.likelihood.length));//BETTER CHANGE THIS BACK... + bayesianStruct.likelihood.addConstant(numberOfMatchesFound*(1-quantity)/(bayesianStruct.likelihood.length));//BETTER CHANGE THIS BACK... bayesianStruct.likelihood.renormalise(); bayesianStruct.calculatePosterior(); @@ -931,11 +978,11 @@ void AudioEventMatcher::writeAllDistributions(){ std::string filepath = "/Users/andrew/Documents/work/programming/of_preRelease_v007_osx/apps/myOpenFrameworks007/MultipleAudioMatcher/bin/data/priorDistbnOutput.txt"; - eventMatcher.writeDistribution(eventMatcher.bayesianStruct.prior, filepath); + writeDistribution(bayesianStruct.prior, filepath); filepath = "/Users/andrew/Documents/work/programming/of_preRelease_v007_osx/apps/myOpenFrameworks007/MultipleAudioMatcher/bin/data/likelihoodDistbnOutput.txt"; - eventMatcher.writeDistribution(eventMatcher.bayesianStruct.likelihood, filepath); + writeDistribution(bayesianStruct.likelihood, filepath); filepath = "/Users/andrew/Documents/work/programming/of_preRelease_v007_osx/apps/myOpenFrameworks007/MultipleAudioMatcher/bin/data/posteriorDistbnOutput.txt"; - eventMatcher.writeDistribution(eventMatcher.bayesianStruct.posterior, filepath); + writeDistribution(bayesianStruct.posterior, filepath); ofBackground(0); recordedTracks.drawTracks(); diff -r e359b9bad811 -r 5274e3b5479d src/AudioEventMatcher.h --- a/src/AudioEventMatcher.h Tue Jul 17 22:12:20 2012 +0100 +++ b/src/AudioEventMatcher.h Tue Aug 14 21:45:12 2012 +0100 @@ -125,6 +125,7 @@ //params double onsetLikelihoodWidth; double onsetLikelihoodToNoise; + double kickLikelihoodToNoise, snareLikelihoodToNoise; double pitchLikelihoodToNoise;//more noise double chromaLikelihoodToNoise; @@ -160,5 +161,8 @@ void writeAllDistributions(); void writeDistribution(DynamicVector& distribution, std::string filename); ofImage img; + + void checkTempo(); + double relativeTempo; }; #endif diff -r e359b9bad811 -r 5274e3b5479d src/RecordedMultitrackAudio.cpp --- a/src/RecordedMultitrackAudio.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/src/RecordedMultitrackAudio.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -18,7 +18,7 @@ printf("loaded max val is %f\n", loadedAudioFiles[0].fileLoader.onsetDetect.onsetDetector.maximumDetectionValue); - int multitrackToLoad = 31; + int multitrackToLoad = 27; setDifferentMultitracks(multitrackToLoad);//command to load this set of audio files - see below //number 7 is problematic with memory @@ -203,6 +203,7 @@ guitarfilename = "/Users/andrew/Music/Logic/SonOfMan/SonOfManMultitracks/SonOfMan_TakeThree/Electric di_bip.wav"; break; + //MOTORCADE case 23: bassfilename = "/Volumes/Supersaurus/TractorsAlbum/TractorsMotorcade/Motorcade/Bounces/MotorcadeMulittracks/Motorcade_Take_57/bass DI_bip.wav"; kickfilename = "/Volumes/Supersaurus/TractorsAlbum/TractorsMotorcade/Motorcade/Bounces/MotorcadeMulittracks/Motorcade_Take_57/Kick re20_bip.wav"; @@ -232,6 +233,7 @@ break; //TRACTORS _ Studio Versions + //LEWES STUDIO case 27: bassfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/LewesStudioFinal/bass_DI_bip.wav"; kickfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/LewesStudioFinal/kick_bip.wav"; @@ -239,20 +241,22 @@ guitarfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/LewesStudioFinal/guitar sm57_bip.wav"; break; + //PENNY ARCADE STUDIO case 28: bassfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/PennyArcadeStudio14aMultitrack/bass_DI.wav"; kickfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/PennyArcadeStudio14aMultitrack/kick.wav"; snarefilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/PennyArcadeStudio14aMultitrack/snare.wav"; guitarfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDemo/Bounces/PennyArcadeStudio14aMultitrack/elec_sm57.wav"; break; - + //D>W> STUDIO case 29: bassfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDiamondWhite/tractorsDiamondWhite/Bounces/DiamondWhite21aBounces/bass_di.wav"; kickfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDiamondWhite/tractorsDiamondWhite/Bounces/DiamondWhite21aBounces/kick_d112.wav"; snarefilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDiamondWhite/tractorsDiamondWhite/Bounces/DiamondWhite21aBounces/fake_snare.wav"; guitarfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsDiamondWhite/tractorsDiamondWhite/Bounces/DiamondWhite21aBounces/tele_sm57.wav"; break; - + + //IDIOTS STUDIO case 30: bassfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsIdiotDance/tractorsSetToRecord2/Bounces/IdiotsDanceStudioMultitrack/bass_di.wav"; kickfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsIdiotDance/tractorsSetToRecord2/Bounces/IdiotsDanceStudioMultitrack/kick_d112.wav"; @@ -260,6 +264,7 @@ guitarfilename = "/Volumes/Supersaurus/TractorsAlbum/tractorsIdiotDance/tractorsSetToRecord2/Bounces/IdiotsDanceStudioMultitrack/gretschMatch.wav"; break; + case 31: bassfilename = "/Volumes/Supersaurus/End2011BackupNewMacBook/Music/Logic/NewYearsResolution/NewYearsRes_v1/Bounces/Multitracks/Take11Studio/bass d.i.wav"; kickfilename = "/Volumes/Supersaurus/End2011BackupNewMacBook/Music/Logic/NewYearsResolution/NewYearsRes_v1/Bounces/Multitracks/Take11Studio/kick_bip.wav"; diff -r e359b9bad811 -r 5274e3b5479d src/testApp.cpp --- a/src/testApp.cpp Tue Jul 17 22:12:20 2012 +0100 +++ b/src/testApp.cpp Tue Aug 14 21:45:12 2012 +0100 @@ -7,6 +7,12 @@ #include +/* + L: load marker file + S: save markers + + */ + const double samplingFrequency = 44100.0; //-------------------------------------------------------------- @@ -27,7 +33,6 @@ ofSetFrameRate(20); - eventMatcher.loadAudioFiles(); eventMatcher.setWindowDimensions(); @@ -214,8 +219,6 @@ } if (key == OF_KEY_RETURN){ - - eventMatcher.recordedTracks.stop(); }