Mercurial > hg > vamp-tempogram
comparison TempogramPlugin.h @ 18:89bc9e5199d7
* Added Cyclic Tempogram output - very buggy right now!
| author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
|---|---|
| date | Thu, 14 Aug 2014 16:43:26 +0100 |
| parents | c11367df624d |
| children | e90a4797e579 |
comparison
equal
deleted
inserted
replaced
| 17:1e4c02ca8b81 | 18:89bc9e5199d7 |
|---|---|
| 31 #include <cassert> | 31 #include <cassert> |
| 32 #include <string> | 32 #include <string> |
| 33 | 33 |
| 34 using std::string; | 34 using std::string; |
| 35 using std::vector; | 35 using std::vector; |
| 36 | |
| 37 typedef Spectrogram Tempogram; | |
| 36 | 38 |
| 37 class TempogramPlugin : public Vamp::Plugin | 39 class TempogramPlugin : public Vamp::Plugin |
| 38 { | 40 { |
| 39 public: | 41 public: |
| 40 TempogramPlugin(float inputSampleRate); | 42 TempogramPlugin(float inputSampleRate); |
| 71 | 73 |
| 72 FeatureSet getRemainingFeatures(); | 74 FeatureSet getRemainingFeatures(); |
| 73 | 75 |
| 74 protected: | 76 protected: |
| 75 // plugin-specific data and methods go here | 77 // plugin-specific data and methods go here |
| 76 size_t m_blockSize; | 78 size_t m_inputBlockSize; |
| 77 size_t m_stepSize; | 79 size_t m_inputStepSize; |
| 78 float m_compressionConstant; | |
| 79 SpectrogramTransposed m_spectrogram; //spectrogram data | 80 SpectrogramTransposed m_spectrogram; //spectrogram data |
| 80 vector<float> m_noveltyCurve; //novelty curve data | 81 vector<float> m_noveltyCurve; //novelty curve data |
| 81 float m_minDB; | 82 float m_noveltyCurveMinDB; |
| 82 | 83 |
| 83 void cleanup(); //used to release anything allocated in initialise() | 84 void cleanup(); //used to release anything allocated in initialise() |
| 84 string floatToString(float value) const; | 85 string floatToString(float value) const; |
| 86 vector<unsigned int> calculateTempogramNearestNeighbourLogBins() const; | |
| 85 void updateBPMParameters(); | 87 void updateBPMParameters(); |
| 88 int bpmToBin(const float &bpm) const; | |
| 86 | 89 |
| 87 //FFT params for noveltyCurve -> tempogra | 90 //Novelty Curve specific parameters |
| 88 float m_log2WindowLength; | 91 float m_noveltyCurveCompressionConstant; |
| 89 size_t m_windowLength; | |
| 90 float m_log2FftLength; | |
| 91 size_t m_fftLength; | |
| 92 float m_log2HopSize; | |
| 93 size_t m_hopSize; | |
| 94 | 92 |
| 95 float m_minBPM; // tempogram output bin range min | 93 //Tempogram specific parameters |
| 96 float m_maxBPM; // tempogram output bin range max | 94 float m_tempogramLog2WindowLength; |
| 97 unsigned int m_minBin; | 95 size_t m_tempogramWindowLength; |
| 98 unsigned int m_maxBin; | 96 float m_tempogramLog2FftLength; |
| 97 size_t m_tempogramFftLength; | |
| 98 float m_tempogramLog2HopSize; | |
| 99 size_t m_tempogramHopSize; | |
| 99 | 100 |
| 100 vector<Vamp::RealTime> ncTimestamps; | 101 float m_tempogramMinBPM; // tempogram output bin range min |
| 102 float m_tempogramMaxBPM; // tempogram output bin range max | |
| 103 unsigned int m_tempogramMinBin; | |
| 104 unsigned int m_tempogramMaxBin; | |
| 105 | |
| 106 //Cyclic tempogram parameters | |
| 107 float m_cyclicTempogramMinBPM; | |
| 108 int m_cyclicTempogramNumberOfOctaves; | |
| 109 int m_cyclicTempogramOctaveDivider; | |
| 101 }; | 110 }; |
| 102 | 111 |
| 103 | 112 |
| 104 #endif | 113 #endif |
