projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix toggle-processors: operate on plugins only
[ardour.git]
/
libs
/
vamp-plugins
/
OnsetDetect.cpp
diff --git
a/libs/vamp-plugins/OnsetDetect.cpp
b/libs/vamp-plugins/OnsetDetect.cpp
index 714eee3647fa69638b66c4d47088a9bf430c0832..c2b6d68dbcd96d64ed9261c9d1a2fab4db8c153a 100644
(file)
--- a/
libs/vamp-plugins/OnsetDetect.cpp
+++ b/
libs/vamp-plugins/OnsetDetect.cpp
@@
-17,9
+17,9
@@
#endif
#include "OnsetDetect.h"
#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;
using std::string;
using std::vector;
@@
-354,7
+354,7
@@
OnsetDetector::process(const float *const *inputBuffers,
return FeatureSet();
}
return FeatureSet();
}
- size_t len = m_d->dfConfig.frameLength / 2;
+ size_t len = m_d->dfConfig.frameLength / 2
+ 1
;
// float mean = 0.f;
// for (size_t i = 0; i < len; ++i) {
// float mean = 0.f;
// for (size_t i = 0; i < len; ++i) {
@@
-368,23
+368,20
@@
OnsetDetector::process(const float *const *inputBuffers,
// << "dftype " << m_dfType << ", sens " << m_sensitivity
// << ", len " << len << ", mean " << mean << std::endl;
// << "dftype " << m_dfType << ", sens " << m_sensitivity
// << ", len " << len << ", mean " << mean << std::endl;
- double *
magnitude
s = new double[len];
- double *
phase
s = new double[len];
+ double *
real
s = new double[len];
+ double *
imag
s = new double[len];
// We only support a single input channel
for (size_t i = 0; i < len; ++i) {
// We only support a single input channel
for (size_t i = 0; i < len; ++i) {
-
- magnitudes[i] = sqrt(inputBuffers[0][i*2 ] * inputBuffers[0][i*2 ] +
- inputBuffers[0][i*2+1] * inputBuffers[0][i*2+1]);
-
- phases[i] = atan2(-inputBuffers[0][i*2+1], inputBuffers[0][i*2]);
+ reals[i] = inputBuffers[0][i*2];
+ imags[i] = inputBuffers[0][i*2+1];
}
}
- double output = m_d->df->process
(magnitudes, phase
s);
+ double output = m_d->df->process
FrequencyDomain(reals, imag
s);
- delete[]
magnitude
s;
- delete[]
phase
s;
+ delete[]
real
s;
+ delete[]
imag
s;
if (m_d->dfOutput.empty()) m_d->origin = timestamp;
if (m_d->dfOutput.empty()) m_d->origin = timestamp;