changeset 52:eff9dc53de62

* Fixed bug with s parameter (y axis bin labels of cyclic tempogram)
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Tue, 30 Sep 2014 16:37:36 +0100
parents c7cc649dc9b6
children b373b9da2de0
files TempogramPlugin.cpp
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/TempogramPlugin.cpp	Tue Sep 30 16:19:31 2014 +0100
+++ b/TempogramPlugin.cpp	Tue Sep 30 16:37:36 2014 +0100
@@ -369,13 +369,10 @@
     d1.sampleRate = d_sampleRate > 0.0 && !isnan(d_sampleRate) ? d_sampleRate : 0;
     vector< vector <unsigned int> > logBins = calculateTempogramNearestNeighbourLogBins();
     if (!logBins.empty()){
-        float scale = pow(2,floor(60/logBins[0][0]));
-        
-        cerr << m_cyclicTempogramOctaveDivider << endl;
-        for(int i = 0; i < m_cyclicTempogramNumberOfOctaves; i++){
-            float s = fmod(binToBPM(logBins[0][i]), m_cyclicTempogramReferenceBPM)*scale;
+        float scale = pow(2,ceil(log2(60/binToBPM(logBins[0][0]))));
+        for(int i = 0; i < m_cyclicTempogramOctaveDivider; i++){
+            float s = scale*binToBPM(logBins[0][i])/m_cyclicTempogramReferenceBPM;
             d1.binNames.push_back(floatToString(s));
-            cerr << i << endl;
             //cerr << m_cyclicTempogramOctaveDivider  << " " << s << endl;
         }
     }