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@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@0
|
13 */
|
c@0
|
14
|
c@0
|
15 #ifndef _TONALCHANGEDETECT_
|
c@0
|
16 #define _TONALCHANGEDETECT_
|
c@0
|
17
|
c@3
|
18 #include <vamp-sdk/Plugin.h>
|
c@0
|
19
|
c@3
|
20 #include <dsp/chromagram/Chromagram.h>
|
c@3
|
21 #include <dsp/tonal/TonalEstimator.h>
|
c@3
|
22 #include <dsp/tonal/TCSgram.h>
|
c@0
|
23
|
c@0
|
24 #include <queue>
|
c@0
|
25 #include <vector>
|
c@0
|
26 #include <valarray>
|
c@0
|
27
|
c@0
|
28 class TonalChangeDetect : public Vamp::Plugin
|
c@0
|
29 {
|
c@0
|
30 public:
|
c@0
|
31 TonalChangeDetect(float fInputSampleRate);
|
c@0
|
32 virtual ~TonalChangeDetect();
|
c@0
|
33
|
c@0
|
34 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@0
|
35 void reset();
|
c@0
|
36
|
c@0
|
37 InputDomain getInputDomain() const { return TimeDomain; }
|
c@0
|
38
|
c@22
|
39 std::string getIdentifier() const;
|
c@0
|
40 std::string getName() const;
|
c@0
|
41 std::string getDescription() const;
|
c@0
|
42 std::string getMaker() const;
|
c@0
|
43 int getPluginVersion() const;
|
c@0
|
44 std::string getCopyright() const;
|
c@0
|
45
|
c@0
|
46 ParameterList getParameterDescriptors() const;
|
c@0
|
47 float getParameter(std::string) const;
|
c@0
|
48 void setParameter(std::string, float);
|
c@0
|
49
|
c@0
|
50
|
c@0
|
51 size_t getPreferredStepSize() const;
|
c@0
|
52 size_t getPreferredBlockSize() const;
|
c@0
|
53
|
c@0
|
54 OutputList getOutputDescriptors() const;
|
c@0
|
55
|
c@18
|
56 FeatureSet process(const float *const *inputBuffers,
|
c@18
|
57 Vamp::RealTime timestamp);
|
c@0
|
58
|
c@0
|
59 FeatureSet getRemainingFeatures();
|
c@0
|
60
|
c@0
|
61 private:
|
c@85
|
62 void setupConfig();
|
c@0
|
63
|
c@0
|
64 ChromaConfig m_config;
|
c@0
|
65 Chromagram *m_chromagram;
|
c@85
|
66 TonalEstimator m_TonalEstimator;
|
c@0
|
67 mutable size_t m_step;
|
c@0
|
68 mutable size_t m_block;
|
c@0
|
69 size_t m_stepDelay;
|
c@0
|
70 std::queue<ChromaVector> m_pending;
|
c@85
|
71 ChromaVector m_vaCurrentVector;
|
c@85
|
72 TCSGram m_TCSGram;
|
c@0
|
73
|
c@85
|
74 int m_iSmoothingWidth; // smoothing window size
|
c@0
|
75 int m_minMIDIPitch; // chromagram parameters
|
c@0
|
76 int m_maxMIDIPitch;
|
c@0
|
77 float m_tuningFrequency;
|
c@85
|
78
|
c@85
|
79 Vamp::RealTime m_origin;
|
c@85
|
80 bool m_haveOrigin;
|
c@0
|
81 };
|
c@0
|
82
|
c@0
|
83
|
c@0
|
84 #endif // _TONALCHANGEDETECT_
|