# HG changeset patch # User Andrew N Robertson # Date 1318886575 -3600 # Node ID 2ab6f4670cf578db706520cdc34f23da54f8ec9e # Parent 75dcd13086586e55d1845e89ffd91fbb702f441a added in the best estimate of error between the observed midi note and the aligned midi track. diff -r 75dcd1308658 -r 2ab6f4670cf5 .DS_Store Binary file .DS_Store has changed diff -r 75dcd1308658 -r 2ab6f4670cf5 src/midiEventHolder.cpp --- a/src/midiEventHolder.cpp Tue Aug 23 11:20:44 2011 +0100 +++ b/src/midiEventHolder.cpp Mon Oct 17 22:22:55 2011 +0100 @@ -181,6 +181,7 @@ timeString += " \n : new offset " + ofToString(bayesStruct.prior.offset , 0); timeString += " \n best estimate "+ofToString(bayesStruct.bestEstimate, 1); + timeString += " error "+ofToString(minimumMatchError, 0); timeString += " map "+ofToString(bayesStruct.relativeSpeedPosterior.integratedEstimate, 1); timeString += " rel speed "+ofToString(bayesStruct.relativeSpeedPosterior.getIndexInRealTerms(bayesStruct.relativeSpeedPosterior.integratedEstimate), 1); @@ -259,7 +260,7 @@ matchesFound.clear(); int startIndex = 0; - + if (recordedEventTimes.size() > 0){ //get to the right range of events to check in @@ -270,6 +271,7 @@ IntVector v; DoubleVector d; + double tmpError = 100000.;//v high error double minimumConfidence = 0; while (startIndex < recordedEventTimes.size() && recordedEventTimes[startIndex] < endTime){ @@ -287,6 +289,13 @@ double confidence = eventConfidence;//bayesStruct.posterior.getValueAtMillis(mouseX); // recordedEventTimes[startIndex]); matchString += "["+ofToString(startIndex)+"] = "+ofToString(confidence, 3)+" ."; + + if (abs(recordedEventTimes[startIndex] - bayesStruct.bestEstimate) < tmpError){ + //record the error between expected and observed times + tmpError = abs(recordedEventTimes[startIndex] - bayesStruct.bestEstimate); + minimumMatchError = recordedEventTimes[startIndex] - bayesStruct.bestEstimate; + } + } startIndex++; } diff -r 75dcd1308658 -r 2ab6f4670cf5 src/midiEventHolder.h --- a/src/midiEventHolder.h Tue Aug 23 11:20:44 2011 +0100 +++ b/src/midiEventHolder.h Mon Oct 17 22:22:55 2011 +0100 @@ -123,5 +123,6 @@ bool confidenceWeightingUsed; + double minimumMatchError;//recent best error between observed note and aligned midi file }; #endif \ No newline at end of file diff -r 75dcd1308658 -r 2ab6f4670cf5 workingNotes.rtf --- a/workingNotes.rtf Tue Aug 23 11:20:44 2011 +0100 +++ b/workingNotes.rtf Mon Oct 17 22:22:55 2011 +0100 @@ -1,6 +1,6 @@ {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} +{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Regular;} +{\colortbl;\red255\green255\blue255;\red0\green116\blue0;} \paperw11900\paperh16840\margl1440\margr1440\vieww20940\viewh15820\viewkind0 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural @@ -30,4 +30,18 @@ \ decay speed distribution - so we have uncertainty about tempo\ \ -cross update - so we have new prior for position} \ No newline at end of file +cross update - so we have new prior for position\ +\ +\ +//\ +working well - 18/8/11\ +\ +need to look at :\ +could weight the speed updates on the basis of how successful the location id was for the two notes. That way when we are on a roll we increase our ability to stay there.\ +\ +matches stored like this: +\f1\fs28 \CocoaLigature0 \ +\pard\tx640\pardeftab640\ql\qnatural\pardirnatural +\cf0 \cf2 //size, index of match0, index of match1, .... +\f0\fs24 \cf0 \CocoaLigature1 \ +} \ No newline at end of file