changeset 24:6a75d371938f

Some speed improvements
author Chris Cannam
date Fri, 06 Feb 2015 09:01:34 +0000
parents 8c07e9da36c9
children 85714824256a
files .hgsubstate README src/TuningDifference.cpp
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu Feb 05 10:38:19 2015 +0000
+++ b/.hgsubstate	Fri Feb 06 09:01:34 2015 +0000
@@ -1,1 +1,1 @@
-25ff58cc00be316d9a32e232a78a00e9374e0433 constant-q-cpp
+9106fb546452ef75de41a1ab8d97cc54ab763b5c constant-q-cpp
--- a/README	Thu Feb 05 10:38:19 2015 +0000
+++ b/README	Fri Feb 06 09:01:34 2015 +0000
@@ -19,6 +19,8 @@
 
 Example usage:
 
+$ export VAMP_PATH=.  # if running from the build directory
+
 $ sonic-annotator -m -d vamp:tuning-difference:tuning-difference:tuningfreq PreludeInCMajorBWV846.mp3 BWV846Egarr.mp3 -w csv --csv-stdout --csv-omit-filename
 
 Here the first file is a MIDI rendering using a piano sample at 440Hz,
--- a/src/TuningDifference.cpp	Thu Feb 05 10:38:19 2015 +0000
+++ b/src/TuningDifference.cpp	Fri Feb 06 09:01:34 2015 +0000
@@ -304,11 +304,12 @@
 TuningDifference::paramsForTuningFrequency(double hz) const
 {
     Chromagram::Parameters params(m_inputSampleRate);
-    params.lowestOctave = 0;
-    params.octaveCount = 6;
+    params.lowestOctave = 2;
+    params.octaveCount = 4;
     params.binsPerOctave = m_bpo;
     params.tuningFrequency = hz;
     params.atomHopFactor = 0.5;
+    params.window = CQParameters::Hann;
     return params;
 }
 
@@ -463,7 +464,12 @@
 
     double coarseHz = frequencyForCentsAbove440(coarseCents);
 
-    TFeature coarseFeature = computeFeatureFromSignal(m_other, coarseHz);
+    TFeature coarseFeature;
+    if (rotation == 0) {
+        coarseFeature = otherFeature;
+    } else {
+        coarseFeature = computeFeatureFromSignal(m_other, coarseHz);
+    }
     double coarseScore = featureDistance(coarseFeature);
 
     cerr << "corresponding Hz " << coarseHz << " scores " << coarseScore << endl;