c@0
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
c@0
|
2
|
c@0
|
3 /*
|
c@0
|
4 QM Vamp Plugin Set
|
c@0
|
5
|
c@0
|
6 Centre for Digital Music, Queen Mary, University of London.
|
c@0
|
7 All rights reserved.
|
c@0
|
8 */
|
c@0
|
9
|
c@0
|
10 #ifndef _TONALCHANGEDETECT_
|
c@0
|
11 #define _TONALCHANGEDETECT_
|
c@0
|
12
|
c@3
|
13 #include <vamp-sdk/Plugin.h>
|
c@0
|
14
|
c@3
|
15 #include <dsp/chromagram/Chromagram.h>
|
c@3
|
16 #include <dsp/tonal/TonalEstimator.h>
|
c@3
|
17 #include <dsp/tonal/TCSgram.h>
|
c@0
|
18
|
c@0
|
19 #include <queue>
|
c@0
|
20 #include <vector>
|
c@0
|
21 #include <valarray>
|
c@0
|
22
|
c@0
|
23 class TonalChangeDetect : public Vamp::Plugin
|
c@0
|
24 {
|
c@0
|
25 public:
|
c@0
|
26 TonalChangeDetect(float fInputSampleRate);
|
c@0
|
27 virtual ~TonalChangeDetect();
|
c@0
|
28
|
c@0
|
29 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@0
|
30 void reset();
|
c@0
|
31
|
c@0
|
32 InputDomain getInputDomain() const { return TimeDomain; }
|
c@0
|
33
|
c@0
|
34 std::string getName() const;
|
c@0
|
35 std::string getDescription() const;
|
c@0
|
36 std::string getMaker() const;
|
c@0
|
37 int getPluginVersion() const;
|
c@0
|
38 std::string getCopyright() const;
|
c@0
|
39
|
c@0
|
40 ParameterList getParameterDescriptors() const;
|
c@0
|
41 float getParameter(std::string) const;
|
c@0
|
42 void setParameter(std::string, float);
|
c@0
|
43
|
c@0
|
44
|
c@0
|
45 size_t getPreferredStepSize() const;
|
c@0
|
46 size_t getPreferredBlockSize() const;
|
c@0
|
47
|
c@0
|
48 OutputList getOutputDescriptors() const;
|
c@0
|
49
|
c@18
|
50 FeatureSet process(const float *const *inputBuffers,
|
c@18
|
51 Vamp::RealTime timestamp);
|
c@0
|
52
|
c@0
|
53 FeatureSet getRemainingFeatures();
|
c@0
|
54
|
c@0
|
55 private:
|
c@0
|
56 void setupConfig();
|
c@0
|
57
|
c@0
|
58 ChromaConfig m_config;
|
c@0
|
59 Chromagram *m_chromagram;
|
c@0
|
60 TonalEstimator m_TonalEstimator;
|
c@0
|
61 mutable size_t m_step;
|
c@0
|
62 mutable size_t m_block;
|
c@0
|
63 size_t m_stepDelay;
|
c@0
|
64 std::queue<ChromaVector> m_pending;
|
c@0
|
65 ChromaVector m_vaCurrentVector;
|
c@0
|
66 TCSGram m_TCSGram;
|
c@0
|
67
|
c@0
|
68 private:
|
c@0
|
69 int m_iSmoothingWidth; // smoothing window size
|
c@0
|
70
|
c@0
|
71 int m_minMIDIPitch; // chromagram parameters
|
c@0
|
72 int m_maxMIDIPitch;
|
c@0
|
73 float m_tuningFrequency;
|
c@0
|
74
|
c@0
|
75 };
|
c@0
|
76
|
c@0
|
77
|
c@0
|
78 #endif // _TONALCHANGEDETECT_
|