comparison jnmr/midiEventHolder.cpp @ 44:6c8a048720c3

improving functions in dynamic vector - to copy with changing offset in copyvector and the drawvector routine
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Wed, 01 Feb 2012 16:07:09 +0000
parents 3837125603e8
children 43edc8abe2a7
comparison
equal deleted inserted replaced
43:732ce4711159 44:6c8a048720c3
344 //this is the vent time since start of file 344 //this is the vent time since start of file
345 if (recordedEventTimes[matchesFound[i]] - bayesStruct.likelihood.offset < bayesStruct.likelihood.arraySize){ 345 if (recordedEventTimes[matchesFound[i]] - bayesStruct.likelihood.offset < bayesStruct.likelihood.arraySize){
346 // double confidenceMeasure = 0; 346 // double confidenceMeasure = 0;
347 // if (totalConfidence > 0) 347 // if (totalConfidence > 0)
348 // confidenceMeasure = bayesStruct.posterior.getValueAtMillis(recordedEventTimes[matchesFound[i]])/totalConfidence; 348 // confidenceMeasure = bayesStruct.posterior.getValueAtMillis(recordedEventTimes[matchesFound[i]])/totalConfidence;
349 349
350 bayesStruct.likelihood.addGaussianShape(recordedEventTimes[matchesFound[i]] - bayesStruct.likelihood.offset, likelihoodWidth, quantity);//* confidenceMeasure 350 //bayesStruct.likelihood.addGaussianShape(recordedEventTimes[matchesFound[i]] - bayesStruct.likelihood.offset, likelihoodWidth, quantity);//* confidenceMeasure
351 bayesStruct.likelihood.addGaussianShapeFromRealTime(recordedEventTimes[matchesFound[i]], likelihoodWidth, quantity);//* confidenceMeasure
351 }//end if 352 }//end if
352 } 353 }
353 bayesStruct.likelihood.addConstant((1-likelihoodToNoiseRatio)/bayesStruct.likelihood.length); 354 bayesStruct.likelihood.addConstant((1-likelihoodToNoiseRatio)/bayesStruct.likelihood.length);
354 } 355 }
355 356
848 849
849 850
850 851
851 } 852 }
852 853
853 printf("assert rec tick time %i vs %i midi %i beat pos %f playing time now at %f :: annotaion %i loc % f time %f diff \t%f ms\n", 854 printf("annotaions: rec tick time %i vs %i midi %i beat pos %f playing time now at %f :: annotaion %i loc % f time %f diff \t%f ms\n",
854 recordedNoteOnMatrix[smoothIndex][0], annotationTick, recordedNoteOnMatrix[smoothIndex][1], 855 recordedNoteOnMatrix[smoothIndex][0], annotationTick, recordedNoteOnMatrix[smoothIndex][1],
855 beatPositions[smoothIndex], playingTime, 856 beatPositions[smoothIndex], playingTime,
856 annotationNote, annotationLocation, annotationTime, difference); 857 annotationNote, annotationLocation, annotationTime, difference);
857 858
858 // assert(annotationNote == recordedNoteOnMatrix[smoothIndex][1]); 859 // assert(annotationNote == recordedNoteOnMatrix[smoothIndex][1]);