diff src/Silvet.cpp @ 69:9c7e6086192d

Run again, with files normalised as in the MIREX tests
author Chris Cannam
date Tue, 29 Apr 2014 12:05:52 +0100
parents 3e7e3c610fae
children 7133f78ccbf6 62b7be1226d5 e282930cfca7
line wrap: on
line diff
--- a/src/Silvet.cpp	Tue Apr 29 10:42:53 2014 +0100
+++ b/src/Silvet.cpp	Tue Apr 29 12:05:52 2014 +0100
@@ -507,6 +507,8 @@
         filtered.push_back(m_postFilter[j]->get());
     }
 
+    int postFilterLatency = int(m_postFilter[0]->getSize() / 2);
+
     // Threshold for level and reduce number of candidate pitches
 
     int polyphony = 5;
@@ -589,9 +591,11 @@
 
         Feature nf;
         nf.hasTimestamp = true;
-        nf.timestamp = RealTime::fromSeconds(columnDuration * start);
+        nf.timestamp = RealTime::fromSeconds
+            (columnDuration * (start - postFilterLatency));
         nf.hasDuration = true;
-        nf.duration = RealTime::fromSeconds(columnDuration * duration);
+        nf.duration = RealTime::fromSeconds
+            (columnDuration * duration);
         nf.values.push_back(noteFrequency(note));
         nf.values.push_back(velocity);
         nf.label = noteName(note);