comparison plugins/ChromagramPlugin.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 //!!! This guard inadequate, must be unique to plugin if plugin is to
11 //be compilable in with app as well as being, well, a plugin
12 #ifndef _CHROMAGRAM_PLUGIN_H_
13 #define _CHROMAGRAM_PLUGIN_H_
14
15 #include "vamp-sdk/Plugin.h"
16 #include "dsp/chromagram/Chromagram.h"
17
18 #include <queue>
19
20 class ChromagramPlugin : public Vamp::Plugin
21 {
22 public:
23 ChromagramPlugin(float inputSampleRate);
24 virtual ~ChromagramPlugin();
25
26 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
27 void reset();
28
29 InputDomain getInputDomain() const { return TimeDomain; }
30
31 std::string getName() const;
32 std::string getDescription() const;
33 std::string getMaker() const;
34 int getPluginVersion() const;
35 std::string getCopyright() const;
36
37 ParameterList getParameterDescriptors() const;
38 float getParameter(std::string) const;
39 void setParameter(std::string, float);
40
41 size_t getPreferredStepSize() const;
42 size_t getPreferredBlockSize() const;
43
44 OutputList getOutputDescriptors() const;
45
46 FeatureSet process(float **inputBuffers, Vamp::RealTime timestamp);
47
48 FeatureSet getRemainingFeatures();
49
50 protected:
51 int m_minMIDIPitch;
52 int m_maxMIDIPitch;
53 float m_tuningFrequency;
54 bool m_normalized;
55 int m_bpo;
56
57 void setupConfig();
58
59 ChromaConfig m_config;
60 Chromagram *m_chromagram;
61 mutable size_t m_step;
62 mutable size_t m_block;
63 size_t m_stepDelay;
64 std::queue<Feature> m_pending;
65
66 Feature normalize(const Feature &);
67 };
68
69
70 #endif