c@21
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
c@21
|
2
|
c@21
|
3 /*
|
c@92
|
4 QM Vamp Plugin Set
|
c@21
|
5
|
c@21
|
6 Centre for Digital Music, Queen Mary, University of London.
|
c@92
|
7 All rights reserved.
|
c@21
|
8 */
|
c@21
|
9
|
c@21
|
10 #ifndef _GETMODE_PLUGIN_H_
|
c@21
|
11 #define _GETMODE_PLUGIN_H_
|
c@21
|
12
|
c@21
|
13 #include <vamp-sdk/Plugin.h>
|
c@21
|
14
|
c@21
|
15 #include <dsp/keydetection/GetKeyMode.h>
|
c@21
|
16
|
c@21
|
17 class KeyDetector : public Vamp::Plugin
|
c@21
|
18 {
|
c@21
|
19 public:
|
c@21
|
20 KeyDetector(float inputSampleRate);
|
c@21
|
21 virtual ~KeyDetector();
|
c@21
|
22
|
c@21
|
23 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@21
|
24 void reset();
|
c@21
|
25
|
c@21
|
26 InputDomain getInputDomain() const { return TimeDomain; }
|
c@21
|
27
|
c@22
|
28 std::string getIdentifier() const;
|
c@21
|
29 std::string getName() const;
|
c@21
|
30 std::string getDescription() const;
|
c@21
|
31 std::string getMaker() const;
|
c@21
|
32 int getPluginVersion() const;
|
c@21
|
33 std::string getCopyright() const;
|
c@21
|
34
|
c@21
|
35 ParameterList getParameterDescriptors() const;
|
c@21
|
36 float getParameter(std::string) const;
|
c@21
|
37 void setParameter(std::string, float);
|
c@21
|
38
|
c@21
|
39 OutputList getOutputDescriptors() const;
|
c@21
|
40
|
c@21
|
41 FeatureSet process(const float *const *inputBuffers,
|
c@21
|
42 Vamp::RealTime timestamp);
|
c@21
|
43
|
c@21
|
44 FeatureSet getRemainingFeatures();
|
c@21
|
45
|
c@21
|
46 size_t getPreferredStepSize() const;
|
c@21
|
47 size_t getPreferredBlockSize() const;
|
c@21
|
48
|
c@21
|
49 protected:
|
c@21
|
50 mutable size_t m_stepSize;
|
c@21
|
51 mutable size_t m_blockSize;
|
c@21
|
52 float m_tuningFrequency;
|
c@21
|
53 int m_length;
|
c@21
|
54
|
c@63
|
55 std::string getKeyName(int index, bool minor, bool includeMajMin) const;
|
c@21
|
56
|
c@21
|
57 GetKeyMode* m_getKeyMode;
|
c@21
|
58 double* m_inputFrame;
|
c@21
|
59 int m_prevKey;
|
c@21
|
60 };
|
c@21
|
61
|
c@21
|
62
|
c@21
|
63 #endif
|