projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial changes needed for building Mixbus (with MSVC) as version 5
[ardour.git]
/
libs
/
ardour
/
onset_detector.cc
diff --git
a/libs/ardour/onset_detector.cc
b/libs/ardour/onset_detector.cc
index 7325f4a520fff4d7f2de21586308e12fe7d52dcb..73f94b061b9af8f1eaa86f53e7af5418ff7eb550 100644
(file)
--- a/
libs/ardour/onset_detector.cc
+++ b/
libs/ardour/onset_detector.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2012 Paul Davis
+ Copyright (C) 2012 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-20,7
+20,7
@@
#include <cmath>
#include "ardour/onset_detector.h"
#include <cmath>
#include "ardour/onset_detector.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace Vamp;
using namespace ARDOUR;
using namespace Vamp;
using namespace ARDOUR;
@@
-28,19
+28,12
@@
using namespace std;
/* need a static initializer function for this */
/* need a static initializer function for this */
-string OnsetDetector::_op_id = X_("
libardourvampplugins:aubioonset:2
");
+string OnsetDetector::_op_id = X_("
aubio-onset
");
OnsetDetector::OnsetDetector (float sr)
: AudioAnalyser (sr, X_("libardourvampplugins:aubioonset"))
, current_results (0)
{
OnsetDetector::OnsetDetector (float sr)
: AudioAnalyser (sr, X_("libardourvampplugins:aubioonset"))
, current_results (0)
{
- /* update the op_id */
-
- _op_id = X_("libardourvampplugins:aubioonset");
-
- // XXX this should load the above-named plugin and get the current version
-
- _op_id += ":2";
}
OnsetDetector::~OnsetDetector()
}
OnsetDetector::~OnsetDetector()
@@
-76,7
+69,7
@@
OnsetDetector::use_features (Plugin::FeatureSet& features, ostream* out)
(*out) << (*f).timestamp.toString() << endl;
}
(*out) << (*f).timestamp.toString() << endl;
}
- current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (
fram
ecnt_t) floor(sample_rate)));
+ current_results->push_back (RealTime::realTime2Frame ((*f).timestamp, (
sampl
ecnt_t) floor(sample_rate)));
}
}
}
}
@@
-99,6
+92,16
@@
OnsetDetector::set_peak_threshold (float val)
}
}
}
}
+void
+OnsetDetector::set_minioi (float val)
+{
+#ifdef HAVE_AUBIO4
+ if (plugin) {
+ plugin->setParameter ("minioi", val);
+ }
+#endif
+}
+
void
OnsetDetector::set_function (int val)
{
void
OnsetDetector::set_function (int val)
{
@@
-120,7
+123,7
@@
OnsetDetector::cleanup_onsets (AnalysisFeatureList& t, float sr, float gap_msecs
AnalysisFeatureList::iterator i = t.begin();
AnalysisFeatureList::iterator f, b;
AnalysisFeatureList::iterator i = t.begin();
AnalysisFeatureList::iterator f, b;
- const
framecnt_t gap_frames = (fram
ecnt_t) floor (gap_msecs * (sr / 1000.0));
+ const
samplecnt_t gap_samples = (sampl
ecnt_t) floor (gap_msecs * (sr / 1000.0));
while (i != t.end()) {
while (i != t.end()) {
@@
-132,7
+135,7
@@
OnsetDetector::cleanup_onsets (AnalysisFeatureList& t, float sr, float gap_msecs
// move f until we find a new value that is far enough away
// move f until we find a new value that is far enough away
- while ((f != t.end()) && (((*f) - (*i)) < gap_
fram
es)) {
+ while ((f != t.end()) && (((*f) - (*i)) < gap_
sampl
es)) {
++f;
}
++f;
}