diff dsp/keydetection/GetKeyMode.cpp @ 283:5e125f030287

* Fixes to problems shown up by vamp-plugin-tester. Still not all plugins pass all tests, though
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 23 Mar 2009 16:28:53 +0000
parents 330c2e11f8a9
children dcb555b90924
line wrap: on
line diff
--- a/dsp/keydetection/GetKeyMode.cpp	Fri Feb 27 13:07:22 2009 +0000
+++ b/dsp/keydetection/GetKeyMode.cpp	Mon Mar 23 16:28:53 2009 +0000
@@ -52,6 +52,7 @@
     // Chromagram configuration parameters
     m_ChromaConfig.normalise = MathUtilities::NormaliseUnitMax;
     m_ChromaConfig.FS = lrint(sampleRate/(double)m_DecimationFactor);
+    if (m_ChromaConfig.FS < 1) m_ChromaConfig.FS = 1;
 
     // Set C (= MIDI #12) as our base :
     // This implies that key = 1 => Cmaj, key = 12 => Bmaj, key = 13 => Cmin, etc.