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@7
|
12 #include "FIRFilter.h"
|
c@7
|
13 #include "WindowFunction.h"
|
c@7
|
14 #include "NoveltyCurve.h"
|
c@7
|
15 #include <vamp-sdk/FFT.h>
|
c@7
|
16 #include <cmath>
|
c@7
|
17 #include <fstream>
|
c@7
|
18 #include <assert.h>
|
c@7
|
19 #include "Spectrogram.h"
|
c@0
|
20
|
c@0
|
21 using std::string;
|
c@0
|
22 using std::vector;
|
c@0
|
23
|
c@0
|
24 class Tempogram : public Vamp::Plugin
|
c@0
|
25 {
|
c@0
|
26 public:
|
c@0
|
27 Tempogram(float inputSampleRate);
|
c@0
|
28 virtual ~Tempogram();
|
c@0
|
29
|
c@0
|
30 string getIdentifier() const;
|
c@0
|
31 string getName() const;
|
c@0
|
32 string getDescription() const;
|
c@0
|
33 string getMaker() const;
|
c@0
|
34 int getPluginVersion() const;
|
c@0
|
35 string getCopyright() const;
|
c@0
|
36
|
c@0
|
37 InputDomain getInputDomain() const;
|
c@0
|
38 size_t getPreferredBlockSize() const;
|
c@0
|
39 size_t getPreferredStepSize() const;
|
c@0
|
40 size_t getMinChannelCount() const;
|
c@0
|
41 size_t getMaxChannelCount() const;
|
c@0
|
42
|
c@0
|
43 ParameterList getParameterDescriptors() const;
|
c@0
|
44 float getParameter(string identifier) const;
|
c@0
|
45 void setParameter(string identifier, float value);
|
c@0
|
46
|
c@0
|
47 ProgramList getPrograms() const;
|
c@0
|
48 string getCurrentProgram() const;
|
c@0
|
49 void selectProgram(string name);
|
c@0
|
50
|
c@0
|
51 OutputList getOutputDescriptors() const;
|
c@0
|
52
|
c@0
|
53 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
c@7
|
54 void cleanup();
|
c@0
|
55 void initialiseForGRF();
|
c@0
|
56 void cleanupForGRF();
|
c@0
|
57 void reset();
|
c@0
|
58
|
c@0
|
59 FeatureSet process(const float *const *inputBuffers,
|
c@0
|
60 Vamp::RealTime timestamp);
|
c@0
|
61
|
c@0
|
62 FeatureSet getRemainingFeatures();
|
c@0
|
63
|
c@0
|
64 protected:
|
c@0
|
65 // plugin-specific data and methods go here
|
c@0
|
66 size_t m_blockSize;
|
c@1
|
67 size_t m_stepSize;
|
c@0
|
68 float compressionConstant;
|
c@3
|
69 float specMax;
|
c@0
|
70 float *previousY;
|
c@0
|
71 float *currentY;
|
c@4
|
72 vector< vector<float> > specData;
|
c@0
|
73 vector<float> noveltyCurve;
|
c@3
|
74 float minDB;
|
c@0
|
75
|
c@0
|
76 unsigned int tN;
|
c@0
|
77 unsigned int thopSize;
|
c@0
|
78 double * fftInput;
|
c@0
|
79 double * fftOutputReal;
|
c@0
|
80 double * fftOutputImag;
|
c@0
|
81
|
c@3
|
82 int numberOfBlocks;
|
c@0
|
83 float *hannWindowtN;
|
c@0
|
84
|
c@0
|
85 vector<Vamp::RealTime> ncTimestamps;
|
c@0
|
86 };
|
c@0
|
87
|
c@0
|
88
|
c@0
|
89 #endif
|