lots of stuff related to capture alignment. things appear to be working now, but...
[ardour2.git] / libs / vamp-plugins / Onset.h
blobc858151b213753d0258d263cabc28933132d6095
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
3 /*
4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
6 Centre for Digital Music, Queen Mary, University of London.
7 This file copyright 2006 Chris Cannam.
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information.
17 #ifndef _ONSET_PLUGIN_H_
18 #define _ONSET_PLUGIN_H_
20 #include "vamp-sdk/Plugin.h"
21 #include <aubio/aubio.h>
23 class Onset : public Vamp::Plugin
25 public:
26 Onset(float inputSampleRate);
27 virtual ~Onset();
29 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
30 void reset();
32 InputDomain getInputDomain() const { return TimeDomain; }
34 std::string getIdentifier() const;
35 std::string getName() const;
36 std::string getDescription() const;
37 std::string getMaker() const;
38 int getPluginVersion() const;
39 std::string getCopyright() const;
41 ParameterList getParameterDescriptors() const;
42 float getParameter(std::string) const;
43 void setParameter(std::string, float);
45 size_t getPreferredStepSize() const;
46 size_t getPreferredBlockSize() const;
48 OutputList getOutputDescriptors() const;
50 FeatureSet process(const float *const *inputBuffers,
51 Vamp::RealTime timestamp);
53 FeatureSet getRemainingFeatures();
55 protected:
56 fvec_t *m_ibuf;
57 cvec_t *m_fftgrain;
58 fvec_t *m_onset;
59 aubio_pvoc_t *m_pv;
60 aubio_pickpeak_t *m_peakpick;
61 aubio_onsetdetection_t *m_onsetdet;
62 aubio_onsetdetection_type m_onsettype;
63 float m_threshold;
64 float m_silence;
65 size_t m_stepSize;
66 size_t m_blockSize;
67 size_t m_channelCount;
68 Vamp::RealTime m_delay;
69 Vamp::RealTime m_lastOnset;
73 #endif