Mercurial > hg > midi-score-follower
changeset 23:032edf186a68
bug fixed on draw vector fn, likelihood drawing fine now
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Wed, 30 Nov 2011 12:35:04 +0000 |
parents | 9860abc92a30 |
children | 5a11b19906c7 |
files | src/BayesianArrayStructure.cpp src/BayesianArrayStructure.h src/DynamicVector.cpp src/testApp.cpp |
diffstat | 4 files changed, 5 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/src/BayesianArrayStructure.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/BayesianArrayStructure.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -20,7 +20,7 @@ prior.createVector(1); likelihood.createVector(1); posterior.createVector(1); - tmpPrior.createVector(1); + speedPriorValue = 1.0; speedEstimate = speedPriorValue; @@ -38,7 +38,6 @@ prior.createVector(length); likelihood.createVector(length); posterior.createVector(length); - tmpPrior.createVector(length); lastEventTime = 0; usingIntegratedTempoEstimate = true;//use max index @@ -104,12 +103,6 @@ relativeSpeedPosterior.createVector(length); tmpPosteriorForStorage.createVector(length); - tmpPrior.createVector(length); - tmpPrior.zero(); - tmpPrior.addConstant(0.1); - tmpPrior.addGaussianShape(130, 10, 0.2); - printf("TMP PRIOR TEST VECTOR\n"); - tmpPrior.printArray(); }
--- a/src/BayesianArrayStructure.h Wed Nov 30 11:48:35 2011 +0000 +++ b/src/BayesianArrayStructure.h Wed Nov 30 12:35:04 2011 +0000 @@ -42,7 +42,7 @@ double likelihoodNoise; double speedLikelihoodNoise; - DynamicVector tmpPrior; + //DynamicVector tmpPrior; DynamicVector tmpPosteriorForStorage; DynamicVector prior; DynamicVector posterior;
--- a/src/DynamicVector.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/DynamicVector.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -233,10 +233,10 @@ int startInt = max(1,minIndex+1); int endInt = min(maxIndex, (int)array.size()); double heightConstant = screenHeight / maxVal; - int lastHeightPixel = heightConstant * (1 - array[startInt-1]); + int lastHeightPixel = heightConstant * (maxVal - array[startInt-1]); int newHeightPixel; for (int i = startInt;i < endInt;i++){ - newHeightPixel = (int) heightConstant * (1 - array[i]); + newHeightPixel = (int) heightConstant * (maxVal - array[i]); ofLine (stepSize*(i-1), lastHeightPixel, stepSize*i, newHeightPixel); lastHeightPixel = newHeightPixel; }
--- a/src/testApp.cpp Wed Nov 30 11:48:35 2011 +0000 +++ b/src/testApp.cpp Wed Nov 30 12:35:04 2011 +0000 @@ -87,8 +87,7 @@ void testApp::draw(){ midiEvents.drawFile(); - ofSetColor(0,255,0); - midiEvents.bayesStruct.tmpPrior.drawVector(0, 200); + } //--------------------------------------------------------------