comparison vamp/CQChromaVamp.h @ 110:fdd32f995b0d

First cut at a chromagram plugin as well
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 14 May 2014 14:04:34 +0100
parents
children b96b0addbca7
comparison
equal deleted inserted replaced
109:f5325762ff6d 110:fdd32f995b0d
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 /*
3 Constant-Q library
4 Copyright (c) 2013-2014 Queen Mary, University of London
5
6 Permission is hereby granted, free of charge, to any person
7 obtaining a copy of this software and associated documentation
8 files (the "Software"), to deal in the Software without
9 restriction, including without limitation the rights to use, copy,
10 modify, merge, publish, distribute, sublicense, and/or sell copies
11 of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25 Except as contained in this notice, the names of the Centre for
26 Digital Music; Queen Mary, University of London; and Chris Cannam
27 shall not be used in advertising or otherwise to promote the sale,
28 use or other dealings in this Software without prior written
29 authorization.
30 */
31
32 #ifndef CQCHROMAVAMP_H
33 #define CQCHROMAVAMP_H
34
35 #include <vamp-sdk/Plugin.h>
36
37 class CQSpectrogram;
38
39 class CQChromaVamp : public Vamp::Plugin
40 {
41 public:
42 CQChromaVamp(float inputSampleRate);
43 virtual ~CQChromaVamp();
44
45 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
46 void reset();
47
48 InputDomain getInputDomain() const { return TimeDomain; }
49
50 std::string getIdentifier() const;
51 std::string getName() const;
52 std::string getDescription() const;
53 std::string getMaker() const;
54 int getPluginVersion() const;
55 std::string getCopyright() const;
56
57 ParameterList getParameterDescriptors() const;
58 float getParameter(std::string) const;
59 void setParameter(std::string, float);
60
61 size_t getPreferredStepSize() const;
62 size_t getPreferredBlockSize() const;
63
64 OutputList getOutputDescriptors() const;
65
66 FeatureSet process(const float *const *inputBuffers,
67 Vamp::RealTime timestamp);
68
69 FeatureSet getRemainingFeatures();
70
71 protected:
72 int m_lowestOctave;
73 int m_octaveCount;
74 float m_tuningFrequency;
75 int m_bpo;
76
77 CQSpectrogram *m_cq;
78 float m_maxFrequency;
79 float m_minFrequency;
80 int m_stepSize;
81 int m_blockSize;
82
83 Vamp::RealTime m_startTime;
84 bool m_haveStartTime;
85 int m_columnCount;
86
87 FeatureSet convertToFeatures(const std::vector<std::vector<double> > &);
88 };
89
90
91 #endif