1b5cb0282ebd — Chris Cannam 22 days ago
Tidy
1 files changed, 0 insertions(+), 44 deletions(-)

M src/MiniBpm.cpp
M src/MiniBpm.cpp +0 -44
@@ 268,29 268,19 @@ public:
 
     double refine(int lag, const double *acf, int acfLength) {
         
-        std::cout << "refine: given lag = " << lag << " (" << Autocorrelation::lagToBpm(lag, m_hopsPerSec) << " bpm)" << std::endl;
-        
         int multiple = 1;
         double interpolated = lag;
         double overallPeak = 0.0;
 
-        std::cout << "peaks at: ";
-
         while (multiple <= 16) {
 
-            if (multiple > 1) std::cout << "; ";
-            
             int base, count;
             getContributingRange(lag, multiple, base, count);
             if (base + count > acfLength) break;
 
-            std::cout << " {from " << base << " to " << base+count-1 << "} ";
-
             double peak = 0.0;
             int pix = 0;
-            std::cout << "( ";
             for (int j = base; j < acfLength; ++j) {
-                std::cout << acf[j] << " ";
                 if (acf[j] > peak) {
                     peak = acf[j];
                     pix = j;

          
@@ 298,10 288,8 @@ public:
                     break;
                 }
             }
-            std::cout << ") ";
             
             if (peak > overallPeak * 0.9) {
-                std::cout << pix << " (m=" << multiple << ") ";
                 double loc = pix;
                 if (pix > 0 && pix + 1 < acfLength) {
                     double a = acf[pix-1];

          
@@ 312,7 300,6 @@ public:
                         if (d != 0.0) {
                             loc += ((a - c) / d) / 2.0;
                         }
-                        std::cout << "[a=" << a << ", b=" << b << ", c=" << c << " d=" << d << ", loc=" << loc << ", bpm=" << Autocorrelation::lagToBpm(loc / multiple, m_hopsPerSec) << "] ";
                     }
                 }
                 interpolated = loc / multiple;

          
@@ 325,12 312,6 @@ public:
             else multiple = multiple * 2;
         }
 
-        std::cout << std::endl;
-
-        std::cout << "refine: interpolated lag = " << interpolated << " (" << Autocorrelation::lagToBpm(interpolated, m_hopsPerSec) << " bpm)" << std::endl;
-
-        std::cout << "(hops per sec = " << m_hopsPerSec << ")" << std::endl;
-        
         double bpm = Autocorrelation::lagToBpm(interpolated, m_hopsPerSec);
         return bpm;
     }

          
@@ 389,7 370,6 @@ public:
     {
         int lfbinmax = 6;
         m_blockSize = (m_inputSampleRate * lfbinmax) / m_lfmax;
-        std::cout << "blockSize = " << m_blockSize << std::endl;
         m_stepSize = m_blockSize / 2;
 
         m_lf = new FourierFilterbank(m_blockSize, m_inputSampleRate, 

          
@@ 558,29 538,12 @@ public:
             return 0.0;
         }
 
-        std::cout << "acfLength = " << acfLength << std::endl;
-
-        std::cout << "acf = ";
-        for (int i = 0; i < acfLength; ++i) {
-            if (i > 0) std::cout << ", ";
-            std::cout << acf[i];
-        }
-
-        std::cout << std::endl;
-        
         ACFCombFilter filter(m_beatsPerBar, minlag, maxlag, hopsPerSec);
         int cflen = filter.getFilteredLength();
         double *cf = new double[cflen];
         filter.filter(acf, acfLength, cf);
         unityNormalise(cf, cflen);
 
-        std::cout << "cf = ";
-        for (int i = 0; i < cflen; ++i) {
-            if (i > 0) std::cout << ", ";
-            std::cout << cf[i];
-        }
-        std::cout << std::endl;
-
         for (int i = 0; i < cflen; ++i) {
             // perceptual weighting: prefer middling values
             double bpm = Autocorrelation::lagToBpm(minlag + i, hopsPerSec);

          
@@ 595,13 558,6 @@ public:
             cf[i] *= weight;
         }
 
-        std::cout << "weighted cf = ";
-        for (int i = 0; i < cflen; ++i) {
-            if (i > 0) std::cout << ", ";
-            std::cout << cf[i];
-        }
-        std::cout << std::endl;
-
         std::multimap<double, int> candidateMap;
         for (int i = 1; i + 1 < cflen; ++i) {
             if (cf[i] > cf[i-1] && cf[i] > cf[i+1]) {