Mercurial > hg > midi-score-follower
diff src/DynamicVector.cpp @ 1:1a32ce016bb9
Changed bestEstimate timing to work via time sent from Max not the elapsed time. This had caused some problems, but this version now working surprisingly well on MIDI files with variable timing.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Thu, 18 Aug 2011 23:27:42 +0100 |
parents | b299a65a3ad0 |
children | 5581023e0de4 |
line wrap: on
line diff
--- a/src/DynamicVector.cpp Tue Aug 16 11:29:59 2011 +0100 +++ b/src/DynamicVector.cpp Thu Aug 18 23:27:42 2011 +0100 @@ -132,6 +132,15 @@ } +double DynamicVector::getValueAtMillis(const double& millis){ + + int index = round(getRealTermsAsIndex(millis)); + if (index >= 0 && index < length) + return array[index]; + else + return 0; +} + void DynamicVector::drawVector(const int& minIndex, const int& maxIndex){