c@0
|
1
|
c@0
|
2 // This is a skeleton file for use in creating your own plugin
|
c@0
|
3 // libraries. Replace MyPlugin and myPlugin throughout with the name
|
c@0
|
4 // of your first plugin class, and fill in the gaps as appropriate.
|
c@0
|
5
|
c@0
|
6
|
c@0
|
7 // Remember to use a different guard symbol in each header!
|
c@0
|
8 #ifndef _TEMPOGRAM_H_
|
c@0
|
9 #define _TEMPOGRAM_H_
|
c@0
|
10
|
c@0
|
11 #include <vamp-sdk/Plugin.h>
|
c@0
|
12
|
c@0
|
13 using std::string;
|
c@0
|
14 using std::vector;
|
c@0
|
15
|
c@0
|
16 class Tempogram : public Vamp::Plugin
|
c@0
|
17 {
|
c@0
|
18 public:
|
c@0
|
19 Tempogram(float inputSampleRate);
|
c@0
|
20 virtual ~Tempogram();
|
c@0
|
21
|
c@0
|
22 string getIdentifier() const;
|
c@0
|
23 string getName() const;
|
c@0
|
24 string getDescription() const;
|
c@0
|
25 string getMaker() const;
|
c@0
|
26 int getPluginVersion() const;
|
c@0
|
27 string getCopyright() const;
|
c@0
|
28
|
c@0
|
29 InputDomain getInputDomain() const;
|
c@0
|
30 size_t getPreferredBlockSize() const;
|
c@0
|
31 size_t getPreferredStepSize() const;
|
c@0
|
32 size_t getMinChannelCount() const;
|
c@0
|
33 size_t getMaxChannelCount() const;
|
c@0
|
34
|
c@0
|
35 ParameterList getParameterDescriptors() const;
|
c@0
|
36 float getParameter(string identifier) const;
|
c@0
|
37 void setParameter(string identifier, float value);
|
c@0
|
38
|
c@0
|
39 ProgramList getPrograms() const;
|
c@0
|
40 string getCurrentProgram() const;
|
c@0
|
41 void selectProgram(string name);
|
c@0
|
42
|
c@0
|
43 OutputList getOutputDescriptors() const;
|
c@0
|
44
|
c@0
|
45 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@0
|
46 void initialiseForGRF();
|
c@0
|
47 void cleanupForGRF();
|
c@3
|
48 vector<float> spectrogramToNoveltyCurve(vector<float> spectrogramData, int numberOfBlocks, int blockSize, float samplingFrequency, FeatureSet * featureSet = NULL);
|
c@0
|
49 void reset();
|
c@0
|
50
|
c@0
|
51 FeatureSet process(const float *const *inputBuffers,
|
c@0
|
52 Vamp::RealTime timestamp);
|
c@0
|
53
|
c@0
|
54 FeatureSet getRemainingFeatures();
|
c@0
|
55
|
c@0
|
56 protected:
|
c@0
|
57 // plugin-specific data and methods go here
|
c@0
|
58 size_t m_blockSize;
|
c@1
|
59 size_t m_stepSize;
|
c@0
|
60 float compressionConstant;
|
c@3
|
61 float specMax;
|
c@0
|
62 float *previousY;
|
c@0
|
63 float *currentY;
|
c@3
|
64 vector<float> specData;
|
c@0
|
65 vector<float> noveltyCurve;
|
c@3
|
66 float minDB;
|
c@0
|
67
|
c@0
|
68 unsigned int tN;
|
c@0
|
69 unsigned int thopSize;
|
c@0
|
70 double * fftInput;
|
c@0
|
71 double * fftOutputReal;
|
c@0
|
72 double * fftOutputImag;
|
c@0
|
73
|
c@3
|
74 int numberOfBlocks;
|
c@0
|
75 int hannN;
|
c@0
|
76 float *hannWindow;
|
c@0
|
77 float *hannWindowtN;
|
c@0
|
78
|
c@0
|
79 vector<Vamp::RealTime> ncTimestamps;
|
c@0
|
80 };
|
c@0
|
81
|
c@0
|
82
|
c@0
|
83 #endif
|