changeset 235:b5a8836dd2a4 norm eval-norm-rN

Try using the Flatten Dynamics plugin instead of norm-to-max-so-far
author Chris Cannam
date Thu, 17 Jul 2014 16:42:48 +0100
parents 8aa810eeff40
children 98aa412d245e
files .hgsubstate src/Silvet.cpp src/Silvet.h testdata/evaluation/run-piano.sh
diffstat 4 files changed, 4 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate	Thu Jul 17 16:29:18 2014 +0100
+++ b/.hgsubstate	Thu Jul 17 16:42:48 2014 +0100
@@ -1,3 +1,3 @@
 a2621605a8c2119bb063c59e83f4fe792a58e4ac bqvec
 e6b00b4788bedadb1ca855ea4f67a765fbe52034 constant-q-cpp
-12d364f12d37f8836f81a3895500ad8f6bee9acf flattendynamics
+e36fe9312ad4a0085c7d8d193b0d9846241ed30d flattendynamics
--- a/src/Silvet.cpp	Thu Jul 17 16:29:18 2014 +0100
+++ b/src/Silvet.cpp	Thu Jul 17 16:42:48 2014 +0100
@@ -390,7 +390,6 @@
     m_pianoRoll.clear();
     m_columnCount = 0;
     m_startTime = RealTime::zeroTime;
-    m_signalMax = 0.0;
 }
 
 Silvet::FeatureSet
@@ -403,17 +402,7 @@
     vector<double> data;
     for (int i = 0; i < m_blockSize; ++i) {
         double d = inputBuffers[0][i];
-        if (fabs(d) > m_signalMax) {
-            m_signalMax = fabs(d);
-        } 
-    }
-    for (int i = 0; i < m_blockSize; ++i) {
-        double d = inputBuffers[0][i];
-        if (m_signalMax > 0.0) {
-            data.push_back(d / m_signalMax * 0.5);
-        } else {
-            data.push_back(0.0);
-        }
+        data.push_back(d);
     }
 
     if (m_resampler) {
--- a/src/Silvet.h	Thu Jul 17 16:29:18 2014 +0100
+++ b/src/Silvet.h	Thu Jul 17 16:42:48 2014 +0100
@@ -107,8 +107,6 @@
     int m_columnCount;
     Vamp::RealTime m_startTime;
 
-    double m_signalMax;
-
     mutable int m_notesOutputNo;
     mutable int m_fcqOutputNo;
 };
--- a/testdata/evaluation/run-piano.sh	Thu Jul 17 16:29:18 2014 +0100
+++ b/testdata/evaluation/run-piano.sh	Thu Jul 17 16:42:48 2014 +0100
@@ -73,9 +73,8 @@
 	    echo "For file $filename, instrument $instrument, norm $norm..."
 
 	    if [ "$norm" = "no" ]; then
-		# Don't normalise -- part of the point here is to make
-		# it work for various different levels
-		sox "$infile" "$tmpwav" trim 0 $duration
+		# Don't normalise; instead use the Flatten Dynamics plugin
+		LADSPA_PATH=../../flattendynamics sox "$infile" "$tmpwav" trim 0 $duration ladspa flattendynamics flattendynamics 0
 	    else
 		# Normalise as reference
 		sox "$infile" "$tmpwav" trim 0 $duration gain -n -6.020599913279624