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@135
|
7
|
c@135
|
8 This program is free software; you can redistribute it and/or
|
c@135
|
9 modify it under the terms of the GNU General Public License as
|
c@135
|
10 published by the Free Software Foundation; either version 2 of the
|
c@135
|
11 License, or (at your option) any later version. See the file
|
c@135
|
12 COPYING included with this distribution for more information.
|
c@21
|
13 */
|
c@21
|
14
|
c@21
|
15 #ifndef _GETMODE_PLUGIN_H_
|
c@21
|
16 #define _GETMODE_PLUGIN_H_
|
c@21
|
17
|
c@21
|
18 #include <vamp-sdk/Plugin.h>
|
c@21
|
19
|
c@21
|
20 #include <dsp/keydetection/GetKeyMode.h>
|
c@21
|
21
|
c@21
|
22 class KeyDetector : public Vamp::Plugin
|
c@21
|
23 {
|
c@21
|
24 public:
|
c@21
|
25 KeyDetector(float inputSampleRate);
|
c@21
|
26 virtual ~KeyDetector();
|
c@21
|
27
|
c@21
|
28 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@21
|
29 void reset();
|
c@21
|
30
|
c@21
|
31 InputDomain getInputDomain() const { return TimeDomain; }
|
c@21
|
32
|
c@22
|
33 std::string getIdentifier() const;
|
c@21
|
34 std::string getName() const;
|
c@21
|
35 std::string getDescription() const;
|
c@21
|
36 std::string getMaker() const;
|
c@21
|
37 int getPluginVersion() const;
|
c@21
|
38 std::string getCopyright() const;
|
c@21
|
39
|
c@21
|
40 ParameterList getParameterDescriptors() const;
|
c@21
|
41 float getParameter(std::string) const;
|
c@21
|
42 void setParameter(std::string, float);
|
c@21
|
43
|
c@21
|
44 OutputList getOutputDescriptors() const;
|
c@21
|
45
|
c@21
|
46 FeatureSet process(const float *const *inputBuffers,
|
c@21
|
47 Vamp::RealTime timestamp);
|
c@21
|
48
|
c@21
|
49 FeatureSet getRemainingFeatures();
|
c@21
|
50
|
c@21
|
51 size_t getPreferredStepSize() const;
|
c@21
|
52 size_t getPreferredBlockSize() const;
|
c@21
|
53
|
c@21
|
54 protected:
|
c@21
|
55 mutable size_t m_stepSize;
|
c@21
|
56 mutable size_t m_blockSize;
|
c@21
|
57 float m_tuningFrequency;
|
c@21
|
58 int m_length;
|
c@21
|
59
|
cannam@242
|
60 GetKeyMode::Config getConfig() const;
|
c@63
|
61 std::string getKeyName(int index, bool minor, bool includeMajMin) const;
|
cannam@247
|
62 std::string getBothKeyNames(int index) const;
|
c@21
|
63
|
c@21
|
64 GetKeyMode* m_getKeyMode;
|
c@21
|
65 double* m_inputFrame;
|
c@21
|
66 int m_prevKey;
|
c@95
|
67 bool m_first;
|
c@21
|
68 };
|
c@21
|
69
|
c@21
|
70
|
c@21
|
71 #endif
|