update qm-vamp-plugins (git v1.7.1-10-g76bc879)
authorRobin Gareus <robin@gareus.org>
Sat, 1 Apr 2017 19:50:32 +0000 (21:50 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 1 Apr 2017 19:50:32 +0000 (21:50 +0200)
libs/vamp-plugins/BarBeatTrack.cpp
libs/vamp-plugins/BeatTrack.cpp
libs/vamp-plugins/ChromagramPlugin.cpp
libs/vamp-plugins/OnsetDetect.cpp
libs/vamp-plugins/SimilarityPlugin.cpp
libs/vamp-plugins/SimilarityPlugin.h
libs/vamp-plugins/TonalChangeDetect.cpp
libs/vamp-plugins/Transcription.cpp
libs/vamp-plugins/Transcription.h

index d2f7d73c38cddc1b08ee8995dccdfd3d4a6ebb33..700d8cf381fddff97b89805adb218bfd87844527 100644 (file)
@@ -434,11 +434,11 @@ BarBeatTracker::barBeatTrack()
         if (beat == m_bpb) beat = 0;
     }
 
-    for (size_t i = 0; i < beats.size(); ++i) {
+    for (int i = 0; i < int(beats.size()); ++i) {
 
-    size_t frame = beats[i] * m_d->dfConfig.stepSize;
+        size_t frame = size_t(beats[i]) * m_d->dfConfig.stepSize;
 
-        if (dbi < downbeats.size() && i == downbeats[dbi]) {
+        if (dbi < int(downbeats.size()) && i == downbeats[dbi]) {
             beat = 0;
             ++bar;
             ++dbi;
@@ -452,19 +452,19 @@ BarBeatTracker::barBeatTrack()
         // 1 -> bars
         // 2 -> beat counter function
 
-    Feature feature;
-    feature.hasTimestamp = true;
-    feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime
-        (frame, lrintf(m_inputSampleRate));
+        Feature feature;
+        feature.hasTimestamp = true;
+        feature.timestamp = m_d->origin + Vamp::RealTime::frame2RealTime
+            (frame, lrintf(m_inputSampleRate));
 
         sprintf(label, "%d", beat + 1);
         feature.label = label;
-    returnFeatures[0].push_back(feature); // labelled beats
+        returnFeatures[0].push_back(feature); // labelled beats
 
         feature.values.push_back(beat + 1);
         returnFeatures[2].push_back(feature); // beat function
 
-        if (i > 0 && i <= beatsd.size()) {
+        if (i > 0 && i <= int(beatsd.size())) {
             feature.values.clear();
             feature.values.push_back(beatsd[i-1]);
             feature.label = "";
index 00ff40d6eef9face6507e3c4a9d637f8aa152418..6b854fe69746a186eb73d5b2b4c42cfb7da0bf07 100644 (file)
@@ -57,12 +57,12 @@ BeatTracker::BeatTracker(float inputSampleRate) :
     m_d(0),
     m_method(METHOD_NEW),
     m_dfType(DF_COMPLEXSD),
-    m_whiten(false),
     m_alpha(0.9),                      // MEPD new exposed parameter for beat tracker, default value = 0.9 (as old version)
     m_tightness(4.),
     m_inputtempo(120.),        // MEPD new exposed parameter for beat tracker, default value = 120. (as old version)
-    m_constraintempo(false) // MEPD new exposed parameter for beat tracker, default value = false (as old version)
+    m_constraintempo(false), // MEPD new exposed parameter for beat tracker, default value = false (as old version)
     // calling the beat tracker with these default parameters will give the same output as the previous existing version
+    m_whiten(false)
 
 {
 }
index be21961916d4ce51b62aa31a39d6e1354a2f0771..436ed0a48282909f0d0baeecf8da69b952aa7843 100644 (file)
@@ -330,7 +330,7 @@ ChromagramPlugin::getOutputDescriptors() const
 
 ChromagramPlugin::FeatureSet
 ChromagramPlugin::process(const float *const *inputBuffers,
-                          Vamp::RealTime timestamp)
+                          Vamp::RealTime )
 {
     if (!m_chromagram) {
        cerr << "ERROR: ChromagramPlugin::process: "
@@ -371,7 +371,7 @@ ChromagramPlugin::process(const float *const *inputBuffers,
 
     Feature feature;
     feature.hasTimestamp = false;
-    for (size_t i = 0; i < m_config.BPO; ++i) {
+    for (int i = 0; i < m_config.BPO; ++i) {
         double value = output[i];
 /*
         if (printThis) {
@@ -402,7 +402,7 @@ ChromagramPlugin::getRemainingFeatures()
     feature.hasTimestamp = true;
     feature.timestamp = Vamp::RealTime::zeroTime;
   
-    for (size_t i = 0; i < m_config.BPO; ++i) {
+    for (int i = 0; i < m_config.BPO; ++i) {
         double v = m_binsums[i];
         if (m_count > 0) v /= m_count;
         feature.values.push_back(v);
index 2a347919517e82db599c2b40daea28686be1b726..c2b6d68dbcd96d64ed9261c9d1a2fab4db8c153a 100644 (file)
@@ -17,9 +17,9 @@
 #endif
 #include "OnsetDetect.h"
 
-#include "dsp/onsets/DetectionFunction.h"
-#include "dsp/onsets/PeakPicking.h"
-#include "dsp/tempotracking/TempoTrack.h"
+#include <dsp/onsets/DetectionFunction.h>
+#include <dsp/onsets/PeakPicking.h>
+#include <dsp/tempotracking/TempoTrack.h>
 
 using std::string;
 using std::vector;
@@ -49,7 +49,7 @@ public:
     vector<double> dfOutput;
     Vamp::RealTime origin;
 };
-
+    
 
 OnsetDetector::OnsetDetector(float inputSampleRate) :
     Vamp::Plugin(inputSampleRate),
@@ -162,7 +162,7 @@ OnsetDetector::getParameter(std::string name) const
     } else if (name == "sensitivity") {
         return m_sensitivity;
     } else if (name == "whiten") {
-        return m_whiten ? 1.0 : 0.0;
+        return m_whiten ? 1.0 : 0.0; 
     }
     return 0.0;
 }
@@ -265,7 +265,7 @@ OnsetDetector::initialise(size_t channels, size_t stepSize, size_t blockSize)
     dfConfig.adaptiveWhitening = m_whiten;
     dfConfig.whiteningRelaxCoeff = -1;
     dfConfig.whiteningFloor = -1;
-
+    
     m_d = new OnsetDetectorData(dfConfig);
     return true;
 }
@@ -477,7 +477,7 @@ OnsetDetector::getRemainingFeatures()
     }
 
     for (unsigned int i = 0; i < ppParams.length; ++i) {
-
+        
         Feature feature;
 //        feature.hasTimestamp = false;
         feature.hasTimestamp = true;
index 50e2b2f2a8f239a479f34450a67dc11880bab40b..a3cc77e0c19fb421e91cf1516129dd103076c008 100644 (file)
@@ -507,19 +507,19 @@ SimilarityPlugin::initialise(size_t channels, size_t stepSize, size_t blockSize)
 void
 SimilarityPlugin::reset()
 {
-    for (int i = 0; i < m_values.size(); ++i) {
+    for (int i = 0; i < int(m_values.size()); ++i) {
         m_values[i].clear();
     }
 
-    for (int i = 0; i < m_rhythmValues.size(); ++i) {
+    for (int i = 0; i < int(m_rhythmValues.size()); ++i) {
         m_rhythmValues[i].clear();
     }
 
-    for (int i = 0; i < m_lastNonEmptyFrame.size(); ++i) {
+    for (int i = 0; i < int(m_lastNonEmptyFrame.size()); ++i) {
         m_lastNonEmptyFrame[i] = -1;
     }
 
-    for (int i = 0; i < m_emptyFrameCount.size(); ++i) {
+    for (int i = 0; i < int(m_emptyFrameCount.size()); ++i) {
         m_emptyFrameCount[i] = 0;
     }
 
@@ -544,7 +544,7 @@ SimilarityPlugin::process(const float *const *inputBuffers, Vamp::RealTime /* ti
 
     bool someRhythmFrameNeeded = false;
 
-    for (size_t c = 0; c < m_channels; ++c) {
+    for (int c = 0; c < m_channels; ++c) {
 
         bool empty = true;
 
@@ -557,7 +557,7 @@ SimilarityPlugin::process(const float *const *inputBuffers, Vamp::RealTime /* ti
         if (empty) {
             if (needRhythm() && ((m_frameNo % 2) == 0)) {
                 for (int i = 0; i < m_fftSize / m_rhythmClipFrameSize; ++i) {
-                    if (m_rhythmValues[c].size() < m_rhythmClipFrames) {
+                    if (int(m_rhythmValues[c].size()) < m_rhythmClipFrames) {
                         FeatureColumn mf(m_rhythmColumnSize);
                         for (int i = 0; i < m_rhythmColumnSize; ++i) {
                             mf[i] = 0.0;
@@ -609,7 +609,7 @@ SimilarityPlugin::process(const float *const *inputBuffers, Vamp::RealTime /* ti
 
                 bool needRhythmFrame = true;
 
-                if (m_rhythmValues[c].size() >= m_rhythmClipFrames) {
+                if (int(m_rhythmValues[c].size()) >= m_rhythmClipFrames) {
 
                     needRhythmFrame = false;
 
@@ -681,7 +681,9 @@ SimilarityPlugin::calculateTimbral(FeatureSet &returnFeatures)
 
             int sz = m_lastNonEmptyFrame[i] - m_emptyFrameCount[i];
             if (sz < 0) sz = 0;
-            if (sz >= m_values[i].size()) sz = m_values[i].size()-1;
+            if (sz >= int(m_values[i].size())) {
+                sz = int(m_values[i].size())-1;
+            }
 
             count = 0;
             for (int k = 0; k < sz; ++k) {
@@ -803,7 +805,7 @@ SimilarityPlugin::calculateRhythmic(FeatureSet &returnFeatures)
 
     FeatureMatrixSet bsinput(m_channels);
     for (int i = 0; i < m_channels; ++i) {
-        for (int j = 0; j < m_rhythmValues[i].size(); ++j) {
+        for (int j = 0; j < int(m_rhythmValues[i].size()); ++j) {
             bsinput[i].push_back(m_rhythmValues[i][j]);
         }
     }
@@ -834,7 +836,7 @@ SimilarityPlugin::calculateRhythmic(FeatureSet &returnFeatures)
         feature.label = labelBuffer;
 
         feature.values.clear();
-        for (int j = 0; j < bs[i].size(); ++j) {
+        for (int j = 0; j < int(bs[i].size()); ++j) {
             feature.values.push_back(bs[i][j]);
         }
 
index 1f30aabd213ea70324b037b92c1ddd4916636597..85fbc7ddf317474cd06bde35c2f398052c9a071f 100644 (file)
@@ -82,8 +82,8 @@ protected:
     int m_rhythmClipFrameSize;
     int m_rhythmClipFrames;
     int m_rhythmColumnSize;
-    mutable size_t m_blockSize; // before decimation
-    size_t m_fftSize; // after decimation
+    mutable int m_blockSize; // before decimation
+    int m_fftSize; // after decimation
     int m_channels;
     int m_processRate;
     int m_frameNo;
index 7b0cd230d14cec21ff5bfa90b3135e8defc8e389..d391b440523ff7ae745097c171ece5689d6cba11 100644 (file)
@@ -407,13 +407,11 @@ TonalChangeDetect::FeatureSet TonalChangeDetect::getRemainingFeatures()
     ChangeDetectionFunction df(dfc);
     ChangeDistance d = df.process(m_TCSGram);
        
-       
-       
-    for (int i = 0; i < d.size(); i++)
+    for (int i = 0; i < int(d.size()); i++)
     {
         double dCurrent = d[i];
         double dPrevious = d[i > 0 ? i - 1 : i];
-        double dNext = d[i < d.size()-1 ? i + 1 : i];
+        double dNext = d[i < int(d.size())-1 ? i + 1 : i];
                
         Feature feature;
         feature.label = "";
index 25c8099336378b70c437920247d8895338366f32..fac024e4d17cb17fecae26acd7a601c61cfbda11 100644 (file)
@@ -24,20 +24,6 @@ using std::vector;
 using std::cerr;
 using std::endl;
 
-const double CNum[8] = {
-    3.025328153863e-005,0.0002117729707704,0.0006353189123113, 0.001058864853852,
-    0.001058864853852,0.0006353189123113,0.0002117729707704,3.025328153863e-005
-};
-
-const double CDen[8] = {
-    1,   -4.647847898799,    9.540784706769,   -11.14354542746,
-    7.967285533211,   -3.477244449085,   0.8559660579522, -0.09152610255505
-};
-  
-const int A[10] = {0, 120, 190, 240, 279, 310, 337, 360, 380, 399};
-
-
-
 const double EualCurve960[960] = {
     83.750025,83.532690,83.315770,83.099260,82.883159,82.667463,82.452170,82.237276,82.022779,81.808675,
     81.594963,81.381639,81.168699,80.956142,80.743964,80.532163,80.320735,80.109677,79.898987,79.688663,79.478700,79.269096,79.059848,78.850953,
@@ -351,10 +337,10 @@ Transcription::process(const float *const *inputBuffers,
 
     if (m_Excess) return FeatureSet();
 
-    for (size_t i = 0; i < m_blockSize;i++) {
+    for (int i = 0; i < m_blockSize;i++) {
 
         if (m_SampleN >= m_AllocN) {
-            size_t newsize = m_AllocN * 2;
+            int newsize = m_AllocN * 2;
             if (newsize < 10000) newsize = 10000;
             double *newbuf = (double *)realloc(m_SoundIn, newsize * sizeof(double));
             if (!newbuf) {
@@ -382,10 +368,9 @@ Transcription::getRemainingFeatures()
     double *hello1;
     double *hello2;
     int Msec;
-    size_t i;
-    size_t j;
-    size_t n;
-    size_t count;
+    int i;
+    int j;
+    int n;
 
     Msec=(int)(100*m_SampleN/m_inputSampleRate);
 
@@ -471,9 +456,7 @@ Transcription::getRemainingFeatures()
     double starts[88];
     for (n = 0; n < 88; ++n) starts[n] = -1.0;
 
-    int nn;
     for (j = 0; j <Msec; j++) {
-
         
         for(n=0;n<88;n++)
         {
@@ -536,17 +519,15 @@ Transcription::getRemainingFeatures()
 
 void sofacomplexMex(double *y, double *z, int ncols,double StartNote,double NoteInterval1,double NoteNum,double C,double D,double SR)
 {
-    int mseconds,i,j,el,count,count2;
-    double  Snote,NoteInterval,NoteN, BasicR;
+    int mseconds,i,el,count,count2;
+    double  Snote,NoteInterval,NoteN;
     double  *signs;
-    double  *rwork,*buffer;  
+    double  *rwork;  
     double  freq,R,gain,gainI,gainII,coefI,coefM;
     double output,input,outputI,outputM;
     double *x;
     double *sum,*sum2;
     double power;
-    double temp;
-   
     
     //SR=44100;
     Snote=StartNote;
@@ -813,7 +794,7 @@ void Smooth(double *In, int InLen,int smoothLen)
 }
 
 
-void FindPeaks(double *In, int InLen,double *Out1,double *Out2, int db, int db2, int db3)
+void FindPeaks(double *In, int InLen,double *Out1,double *Out2, int /* db */, int db2, int db3)
 {
     int i,lastout;
     for (i=0;i<InLen;i++)
@@ -1182,7 +1163,7 @@ void Mydiff( double *InputArray, int InputHLen, int InputVLen,int n)
 
 void PeakDetect(double *In, int InLen)
 {
-    int i,j;
+    int i;
     double *Out1;
  
     Out1=(double*)malloc(InLen*sizeof(double));
@@ -1307,21 +1288,15 @@ void OnsetDetection2(double *In,int InputLen,double *OutOne,double a,double b)
 
 }
 
-void PitchEstimation(double *In, int InLen, double *OutArray,double *OutArray2)
+void PitchEstimation(double *In, int /* InLen */, double *OutArray,double *OutArray2)
 {
     double *xx,*x,*y,*y1,*PeakPitch1, *PeakPitch2,*PeakInput1, *PeakInput2;
     double *out,*outValue;
     double *output,*output1;
-    double notefloat,hh0,hh1,hh28;
-    double outM12[12];
     int *outc;
-    int *yI;
     double temp;
-    int i,j,sumI;
+    int i,sumI;
     int Len;
-    int NN,NN2;
-    int count;
-    double Th;
  
     Len=1050;
     xx=(double*)malloc(Len*sizeof(double));
@@ -1479,16 +1454,13 @@ void PitchEstimation(double *In, int InLen, double *OutArray,double *OutArray2)
      
     }
 
-    Th=30;
     for(i=20;i<105;i++)
     {
         if(output1[i]==1)
         {
             OutArray[i]=outc[i]+200+2;
             OutArray2[i]=y[outc[i]];
-     
         } 
-   
     }
 
     free(xx); // xx=(double*)malloc(Len*sizeof(double));
@@ -1633,7 +1605,6 @@ void dbfunction( double *InputArray, int InputHLen, int InputVLen,double *OutArr
 {
     int i;
     int j;
-    double temp;
     
     for (i=0;i<InputVLen;i++)
     {
@@ -1910,7 +1881,7 @@ void Transcribe(int Len,int inputLen,double *SoundIn,double *out,double *outArra
                 } 
             }     
        
-            if ((j>34)&&(abs(A5[j]-337.0-A5[j-34])<3.0)&&(D[j]>0)&&(D[j-34]>0))
+            if ((j>34)&&(fabs(A5[j]-337.0-A5[j-34])<3.0)&&(D[j]>0)&&(D[j-34]>0))
             {
                      
                 D[j]=0;           D2[j]=0;         
index 3796cb31b4a6b868dcc0543ce6a5325c025b2f3e..419009662db91274f91fcd77756422cf06a05470 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */\r
 \r
 #ifndef _TRANSCRIPTION_PLUGIN_H_\r
-#define _TRSNSCRIPTION_PLUGIN_H_\r
+#define _TRANSCRIPTION_PLUGIN_H_\r
 \r
 #include <vamp-sdk/Plugin.h>\r
 \r
@@ -33,11 +33,11 @@ public:
     FeatureSet getRemainingFeatures();\r
 \r
 protected:\r
-    size_t m_stepSize;\r
-    size_t m_blockSize;\r
+    int m_stepSize;\r
+    int m_blockSize;\r
     double * m_SoundIn;\r
-    size_t m_SampleN;\r
-    size_t m_AllocN;\r
+    int m_SampleN;\r
+    int m_AllocN;\r
     bool m_Excess;\r
     Vamp::RealTime m_Base;\r
 /*\r