CQVamp.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 CQVAMP_H
33 #define CQVAMP_H
34 
35 #include <vamp-sdk/Plugin.h>
36 
37 #include "cq/CQSpectrogram.h"
38 
39 class ConstantQ;
40 
41 class CQVamp : public Vamp::Plugin
42 {
43 public:
44  CQVamp(float inputSampleRate, bool midiPitchParameters);
45  virtual ~CQVamp();
46 
47  bool initialise(size_t channels, size_t stepSize, size_t blockSize);
48  void reset();
49 
50  InputDomain getInputDomain() const { return TimeDomain; }
51 
52  std::string getIdentifier() const;
53  std::string getName() const;
54  std::string getDescription() const;
55  std::string getMaker() const;
56  int getPluginVersion() const;
57  std::string getCopyright() const;
58 
59  ParameterList getParameterDescriptors() const;
60  float getParameter(std::string) const;
61  void setParameter(std::string, float);
62 
63  size_t getPreferredStepSize() const;
64  size_t getPreferredBlockSize() const;
65 
66  OutputList getOutputDescriptors() const;
67 
68  FeatureSet process(const float *const *inputBuffers,
69  Vamp::RealTime timestamp);
70 
71  FeatureSet getRemainingFeatures();
72 
73 protected:
78  int m_bpo;
82 
88 
89  Vamp::RealTime m_startTime;
92 
93  std::string noteName(int i) const;
94 
95  std::vector<float> m_prevFeature;
96  FeatureSet convertToFeatures(const std::vector<std::vector<double> > &);
97 };
98 
99 
100 #endif
ParameterList getParameterDescriptors() const
Definition: CQVamp.cpp:129
CQSpectrogram * m_cq
Definition: CQVamp.h:83
std::string getCopyright() const
Definition: CQVamp.cpp:123
int getPluginVersion() const
Definition: CQVamp.cpp:117
size_t getPreferredStepSize() const
Definition: CQVamp.cpp:350
CQVamp(float inputSampleRate, bool midiPitchParameters)
Definition: CQVamp.cpp:57
FeatureSet convertToFeatures(const std::vector< std::vector< double > > &)
Definition: CQVamp.cpp:445
std::string getDescription() const
Definition: CQVamp.cpp:101
std::string getMaker() const
Definition: CQVamp.cpp:111
float getParameter(std::string) const
Definition: CQVamp.cpp:243
size_t getPreferredBlockSize() const
Definition: CQVamp.cpp:356
CQSpectrogram::Interpolation m_interpolation
Definition: CQVamp.h:81
int m_bpo
Definition: CQVamp.h:78
virtual ~CQVamp()
Definition: CQVamp.cpp:75
bool m_useDraftDecimator
Definition: CQVamp.h:80
int m_columnCount
Definition: CQVamp.h:91
FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp)
Definition: CQVamp.cpp:415
void reset()
Definition: CQVamp.cpp:336
InputDomain getInputDomain() const
Definition: CQVamp.h:50
std::string getName() const
Definition: CQVamp.cpp:91
Interpolation
Definition: CQSpectrogram.h:49
int m_minMIDIPitch
Definition: CQVamp.h:75
Definition: ConstantQ.h:51
bool initialise(size_t channels, size_t stepSize, size_t blockSize)
Definition: CQVamp.cpp:305
bool m_midiPitchParameters
Definition: CQVamp.h:74
float m_maxFrequency
Definition: CQVamp.h:84
Definition: CQSpectrogram.h:46
Definition: CQVamp.h:41
bool m_haveStartTime
Definition: CQVamp.h:90
float m_minFrequency
Definition: CQVamp.h:85
int m_blockSize
Definition: CQVamp.h:87
int m_stepSize
Definition: CQVamp.h:86
int m_maxMIDIPitch
Definition: CQVamp.h:76
float m_tuningFrequency
Definition: CQVamp.h:77
int m_atomOverlap
Definition: CQVamp.h:79
void setParameter(std::string, float)
Definition: CQVamp.cpp:278
Vamp::RealTime m_startTime
Definition: CQVamp.h:89
std::string getIdentifier() const
Definition: CQVamp.cpp:81
std::string noteName(int i) const
Definition: CQVamp.cpp:362
std::vector< float > m_prevFeature
Definition: CQVamp.h:95
OutputList getOutputDescriptors() const
Definition: CQVamp.cpp:377
FeatureSet getRemainingFeatures()
Definition: CQVamp.cpp:438