diff transform/FeatureExtractionModelTransformer.cpp @ 595:3bbac921b70a

* Use notes layer for things with MIDI units as well as Hz
author Chris Cannam
date Mon, 08 Jun 2009 15:40:01 +0000
parents 1d7ebc05157e
children 948271d124ac
line wrap: on
line diff
--- a/transform/FeatureExtractionModelTransformer.cpp	Tue Jun 02 09:48:54 2009 +0000
+++ b/transform/FeatureExtractionModelTransformer.cpp	Mon Jun 08 15:40:01 2009 +0000
@@ -275,8 +275,13 @@
         // duration)
         if (binCount > 1) isNoteModel = true;
 
-        // Regions do not have units of Hz (a sweeping assumption!)
-        if (m_descriptor->unit == "Hz") isNoteModel = true;
+        // Regions do not have units of Hz or MIDI things (a sweeping
+        // assumption!)
+        if (m_descriptor->unit == "Hz" ||
+            m_descriptor->unit.find("MIDI") != std::string::npos ||
+            m_descriptor->unit.find("midi") != std::string::npos) {
+            isNoteModel = true;
+        }
 
         // If we had a "sparse 3D model", we would have the additional
         // problem of determining whether to use that here (if bin