cannam@7
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
cannam@7
|
2
|
cannam@7
|
3 /*
|
cannam@7
|
4 Vamp feature extraction plugins using Paul Brossier's Aubio library.
|
cannam@7
|
5
|
cannam@7
|
6 Centre for Digital Music, Queen Mary, University of London.
|
cannam@7
|
7 This file copyright 2006 Chris Cannam.
|
cannam@7
|
8
|
cannam@7
|
9 This program is free software; you can redistribute it and/or
|
cannam@7
|
10 modify it under the terms of the GNU General Public License as
|
cannam@7
|
11 published by the Free Software Foundation; either version 2 of the
|
cannam@7
|
12 License, or (at your option) any later version. See the file
|
cannam@7
|
13 COPYING included with this distribution for more information.
|
cannam@7
|
14
|
cannam@7
|
15 */
|
cannam@7
|
16
|
cannam@7
|
17 #ifndef _TEMPO_PLUGIN_H_
|
cannam@7
|
18 #define _TEMPO_PLUGIN_H_
|
cannam@7
|
19
|
cannam@7
|
20 #include <vamp-sdk/Plugin.h>
|
cannam@7
|
21 #include <aubio/aubio.h>
|
cannam@7
|
22
|
cannam@7
|
23 class Tempo : public Vamp::Plugin
|
cannam@7
|
24 {
|
cannam@7
|
25 public:
|
cannam@7
|
26 Tempo(float inputSampleRate);
|
cannam@7
|
27 virtual ~Tempo();
|
cannam@7
|
28
|
cannam@7
|
29 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
cannam@7
|
30 void reset();
|
cannam@7
|
31
|
cannam@7
|
32 InputDomain getInputDomain() const { return TimeDomain; }
|
cannam@7
|
33
|
cannam@7
|
34 std::string getName() const;
|
cannam@7
|
35 std::string getDescription() const;
|
cannam@7
|
36 std::string getMaker() const;
|
cannam@7
|
37 int getPluginVersion() const;
|
cannam@7
|
38 std::string getCopyright() const;
|
cannam@7
|
39
|
cannam@7
|
40 ParameterList getParameterDescriptors() const;
|
cannam@7
|
41 float getParameter(std::string) const;
|
cannam@7
|
42 void setParameter(std::string, float);
|
cannam@7
|
43
|
cannam@7
|
44 size_t getPreferredStepSize() const;
|
cannam@7
|
45 size_t getPreferredBlockSize() const;
|
cannam@7
|
46
|
cannam@7
|
47 OutputList getOutputDescriptors() const;
|
cannam@7
|
48
|
cannam@7
|
49 FeatureSet process(float **inputBuffers, Vamp::RealTime timestamp);
|
cannam@7
|
50
|
cannam@7
|
51 FeatureSet getRemainingFeatures();
|
cannam@7
|
52
|
cannam@7
|
53 protected:
|
cannam@7
|
54 fvec_t *m_ibuf;
|
cannam@7
|
55 cvec_t *m_fftgrain;
|
cannam@7
|
56 fvec_t *m_onset;
|
cannam@7
|
57 aubio_pvoc_t *m_pv;
|
cannam@7
|
58 aubio_pickpeak_t *m_peakpick;
|
cannam@7
|
59 aubio_onsetdetection_t *m_onsetdet;
|
cannam@7
|
60 aubio_onsetdetection_type m_onsettype;
|
cannam@7
|
61 aubio_beattracking_t *m_beattracking;
|
cannam@7
|
62 fvec_t *m_dfframe;
|
cannam@7
|
63 fvec_t *m_btout;
|
cannam@7
|
64 uint_t m_winlen;
|
cannam@7
|
65 sint_t m_btstep;
|
cannam@7
|
66 sint_t m_btcounter;
|
cannam@7
|
67 float m_threshold;
|
cannam@7
|
68 float m_silence;
|
cannam@7
|
69 size_t m_stepSize;
|
cannam@7
|
70 size_t m_blockSize;
|
cannam@7
|
71 size_t m_channelCount;
|
cannam@7
|
72 Vamp::RealTime m_delay;
|
cannam@7
|
73 Vamp::RealTime m_lastBeat;
|
cannam@7
|
74 };
|
cannam@7
|
75
|
cannam@7
|
76
|
cannam@7
|
77 #endif
|