comparison plugins/TonalChangeDetect.h @ 0:3f318eae66a2

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