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