CQChromaVamp.h
Go to the documentation of this file.
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 Chromagram;
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:
75  int m_bpo;
76 
80 
81  Vamp::RealTime m_startTime;
84 
85  FeatureSet convertToFeatures(const std::vector<std::vector<double> > &);
86 };
87 
88 
89 #endif
virtual ~CQChromaVamp()
Definition: CQChromaVamp.cpp:60
int m_stepSize
Definition: CQChromaVamp.h:78
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Definition: CQChromaVamp.cpp:192
std::string getIdentifier() const
Definition: CQChromaVamp.cpp:66
Chromagram * m_chroma
Definition: CQChromaVamp.h:77
InputDomain getInputDomain() const
Definition: CQChromaVamp.h:48
std::string getName() const
Definition: CQChromaVamp.cpp:72
std::string getCopyright() const
Definition: CQChromaVamp.cpp:96
int m_octaveCount
Definition: CQChromaVamp.h:73
int m_blockSize
Definition: CQChromaVamp.h:79
FeatureSet getRemainingFeatures()
Definition: CQChromaVamp.cpp:296
Definition: Chromagram.h:40
std::string getDescription() const
Definition: CQChromaVamp.cpp:78
Vamp::RealTime m_startTime
Definition: CQChromaVamp.h:81
size_t getPreferredStepSize() const
Definition: CQChromaVamp.cpp:233
int getPluginVersion() const
Definition: CQChromaVamp.cpp:90
ParameterList getParameterDescriptors() const
Definition: CQChromaVamp.cpp:102
int m_bpo
Definition: CQChromaVamp.h:75
Definition: CQChromaVamp.h:39
std::string getMaker() const
Definition: CQChromaVamp.cpp:84
float m_tuningFrequency
Definition: CQChromaVamp.h:74
FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp)
Definition: CQChromaVamp.cpp:273
void reset()
Definition: CQChromaVamp.cpp:216
bool m_haveStartTime
Definition: CQChromaVamp.h:82
int m_lowestOctave
Definition: CQChromaVamp.h:72
size_t getPreferredBlockSize() const
Definition: CQChromaVamp.cpp:239
int m_columnCount
Definition: CQChromaVamp.h:83
CQChromaVamp(float inputSampleRate)
Definition: CQChromaVamp.cpp:48
FeatureSet convertToFeatures(const std::vector< std::vector< double > > &)
Definition: CQChromaVamp.cpp:303
OutputList getOutputDescriptors() const
Definition: CQChromaVamp.cpp:245
float getParameter(std::string) const
Definition: CQChromaVamp.cpp:155
void setParameter(std::string, float)
Definition: CQChromaVamp.cpp:175