13
0

update qm-vamp-plugins (git v1.7.1-10-g76bc879)

This commit is contained in:
Robin Gareus 2017-04-01 21:50:32 +02:00
parent 4bafbcb1a8
commit 4b1c288f87
9 changed files with 55 additions and 84 deletions

View 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 = "";

View 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)
{
}

View 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);

View 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;

View 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]);
}

View 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;

View 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 = "";

View 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;

View File

@ -1,7 +1,7 @@
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
#ifndef _TRANSCRIPTION_PLUGIN_H_
#define _TRSNSCRIPTION_PLUGIN_H_
#define _TRANSCRIPTION_PLUGIN_H_
#include <vamp-sdk/Plugin.h>
@ -33,11 +33,11 @@ public:
FeatureSet getRemainingFeatures();
protected:
size_t m_stepSize;
size_t m_blockSize;
int m_stepSize;
int m_blockSize;
double * m_SoundIn;
size_t m_SampleN;
size_t m_AllocN;
int m_SampleN;
int m_AllocN;
bool m_Excess;
Vamp::RealTime m_Base;
/*