TipicVampPlugin.h
1 #ifndef TIPIC_VAMP_PLUGIN_H
2 #define TIPIC_VAMP_PLUGIN_H
3 
4 #include <vamp-sdk/Plugin.h>
5 
6 #include "Types.h"
7 
8 class PitchFilterbank;
9 class CRP;
10 class Chroma;
11 class CENS;
12 class FeatureDownsample;
13 
14 using std::string;
15 
16 class Tipic : public Vamp::Plugin
17 {
18 public:
19  Tipic(float inputSampleRate);
20  virtual ~Tipic();
21 
22  string getIdentifier() const;
23  string getName() const;
24  string getDescription() const;
25  string getMaker() const;
26  int getPluginVersion() const;
27  string getCopyright() const;
28 
29  InputDomain getInputDomain() const;
30  size_t getPreferredBlockSize() const;
31  size_t getPreferredStepSize() const;
32  size_t getMinChannelCount() const;
33  size_t getMaxChannelCount() const;
34 
35  ParameterList getParameterDescriptors() const;
36  float getParameter(string identifier) const;
37  void setParameter(string identifier, float value);
38 
39  ProgramList getPrograms() const;
40  string getCurrentProgram() const;
41  void selectProgram(string name);
42 
43  OutputList getOutputDescriptors() const;
44 
45  bool initialise(size_t channels, size_t stepSize, size_t blockSize);
46  void reset();
47 
48  FeatureSet process(const float *const *inputBuffers,
49  Vamp::RealTime timestamp);
50 
51  FeatureSet getRemainingFeatures();
52 
53 protected:
54  int m_stepSize;
55  int m_blockSize;
56  float m_tuningFrequency;
57  PitchFilterbank *m_filterbank;
58  CRP *m_crp;
59  Chroma *m_chroma;
60  Chroma *m_logChroma;
61  CENS *m_cens;
62  mutable int m_pitchOutputNo;
63  mutable int m_cpOutputNo;
64  mutable int m_clpOutputNo;
65  mutable int m_censOutputNo;
66  mutable int m_crpOutputNo;
67  std::map<int, FeatureDownsample *> m_downsamplers;
68 
69  void addFeatures(FeatureSet &, int outputNo, const RealBlock &, bool final);
70 };
71 
72 
73 #endif
Definition: PitchFilterbank.h:20
Definition: Chroma.h:29
Definition: CENS.h:21
Definition: TipicVampPlugin.h:16
Definition: FeatureDownsample.h:30
Definition: CRP.h:29