summaryrefslogtreecommitdiff
path: root/libs/vamp-plugins/OnsetDetect.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-03-02 23:39:49 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-03-02 23:39:49 +0000
commitd8fd8c1f0a8d786fcb2c4271c2e08534773fde62 (patch)
treecbb60bbbce024900f67c3a08a599626ae75d0e56 /libs/vamp-plugins/OnsetDetect.h
parentb3ddcbcee491a48091f9b4b927c953cbcd0e8963 (diff)
add QM onset detector VAMP plugin
git-svn-id: svn://localhost/ardour2/branches/3.0@9049 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/vamp-plugins/OnsetDetect.h')
-rw-r--r--libs/vamp-plugins/OnsetDetect.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/libs/vamp-plugins/OnsetDetect.h b/libs/vamp-plugins/OnsetDetect.h
new file mode 100644
index 0000000000..3ef50afbb3
--- /dev/null
+++ b/libs/vamp-plugins/OnsetDetect.h
@@ -0,0 +1,68 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
+
+/*
+ QM Vamp Plugin Set
+
+ Centre for Digital Music, Queen Mary, University of London.
+
+ 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 the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+*/
+
+#ifndef _ONSET_DETECT_PLUGIN_H_
+#define _ONSET_DETECT_PLUGIN_H_
+
+#include "vamp-sdk/Plugin.h"
+
+class OnsetDetectorData;
+
+class OnsetDetector : public Vamp::Plugin
+{
+public:
+ OnsetDetector(float inputSampleRate);
+ virtual ~OnsetDetector();
+
+ bool initialise(size_t channels, size_t stepSize, size_t blockSize);
+ void reset();
+
+ InputDomain getInputDomain() const { return FrequencyDomain; }
+
+ std::string getIdentifier() const;
+ std::string getName() const;
+ std::string getDescription() const;
+ std::string getMaker() const;
+ int getPluginVersion() const;
+ std::string getCopyright() const;
+
+ ParameterList getParameterDescriptors() const;
+ float getParameter(std::string) const;
+ void setParameter(std::string, float);
+
+ ProgramList getPrograms() const;
+ std::string getCurrentProgram() const;
+ void selectProgram(std::string program);
+
+ size_t getPreferredStepSize() const;
+ size_t getPreferredBlockSize() const;
+
+ OutputList getOutputDescriptors() const;
+
+ FeatureSet process(const float *const *inputBuffers,
+ Vamp::RealTime timestamp);
+
+ FeatureSet getRemainingFeatures();
+
+protected:
+ OnsetDetectorData *m_d;
+ int m_dfType;
+ float m_sensitivity;
+ bool m_whiten;
+ std::string m_program;
+ static float m_preferredStepSecs;
+};
+
+
+#endif