Mercurial > hg > qm-vamp-plugins
comparison plugins/ConstantQSpectrogram.h @ 9:507f923a93e8
* Add Constant-Q Spectrogram plugin
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 15 May 2006 19:56:21 +0000 |
parents | |
children | 99dadc93042e |
comparison
equal
deleted
inserted
replaced
8:a8215973f030 | 9:507f923a93e8 |
---|---|
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 _CONSTANT_Q_SPECTROGRAM_PLUGIN_H_ | |
11 #define _CONSTANT_Q_SPECTROGRAM_PLUGIN_H_ | |
12 | |
13 #include <vamp-sdk/Plugin.h> | |
14 #include <dsp/chromagram/ConstantQ.h> | |
15 | |
16 #include <queue> | |
17 | |
18 class ConstantQSpectrogram : public Vamp::Plugin | |
19 { | |
20 public: | |
21 ConstantQSpectrogram(float inputSampleRate); | |
22 virtual ~ConstantQSpectrogram(); | |
23 | |
24 bool initialise(size_t channels, size_t stepSize, size_t blockSize); | |
25 void reset(); | |
26 | |
27 InputDomain getInputDomain() const { return FrequencyDomain; } | |
28 | |
29 std::string getName() const; | |
30 std::string getDescription() const; | |
31 std::string getMaker() const; | |
32 int getPluginVersion() const; | |
33 std::string getCopyright() const; | |
34 | |
35 ParameterList getParameterDescriptors() const; | |
36 float getParameter(std::string) const; | |
37 void setParameter(std::string, float); | |
38 | |
39 size_t getPreferredStepSize() const; | |
40 size_t getPreferredBlockSize() const; | |
41 | |
42 OutputList getOutputDescriptors() const; | |
43 | |
44 FeatureSet process(float **inputBuffers, Vamp::RealTime timestamp); | |
45 | |
46 FeatureSet getRemainingFeatures(); | |
47 | |
48 protected: | |
49 int m_minMIDIPitch; | |
50 int m_maxMIDIPitch; | |
51 float m_tuningFrequency; | |
52 bool m_normalized; | |
53 int m_bpo; | |
54 int m_bins; | |
55 | |
56 void setupConfig(); | |
57 | |
58 CQConfig m_config; | |
59 ConstantQ *m_cq; | |
60 mutable size_t m_step; | |
61 mutable size_t m_block; | |
62 | |
63 Feature normalize(const Feature &); | |
64 }; | |
65 | |
66 | |
67 #endif |