c@0: c@0: // This is a skeleton file for use in creating your own plugin c@0: // libraries. Replace MyPlugin and myPlugin throughout with the name c@0: // of your first plugin class, and fill in the gaps as appropriate. c@0: c@0: c@0: // Remember to use a different guard symbol in each header! c@0: #ifndef _TEMPOGRAM_H_ c@0: #define _TEMPOGRAM_H_ c@0: c@0: #include c@7: #include "FIRFilter.h" c@7: #include "WindowFunction.h" c@7: #include "NoveltyCurve.h" c@7: #include c@7: #include c@7: #include c@7: #include c@7: #include "Spectrogram.h" c@0: c@0: using std::string; c@0: using std::vector; c@0: c@0: class Tempogram : public Vamp::Plugin c@0: { c@0: public: c@0: Tempogram(float inputSampleRate); c@0: virtual ~Tempogram(); c@0: c@0: string getIdentifier() const; c@0: string getName() const; c@0: string getDescription() const; c@0: string getMaker() const; c@0: int getPluginVersion() const; c@0: string getCopyright() const; c@0: c@0: InputDomain getInputDomain() const; c@0: size_t getPreferredBlockSize() const; c@0: size_t getPreferredStepSize() const; c@0: size_t getMinChannelCount() const; c@0: size_t getMaxChannelCount() const; c@0: c@0: ParameterList getParameterDescriptors() const; c@0: float getParameter(string identifier) const; c@0: void setParameter(string identifier, float value); c@0: c@0: ProgramList getPrograms() const; c@0: string getCurrentProgram() const; c@0: void selectProgram(string name); c@0: c@0: OutputList getOutputDescriptors() const; c@0: c@0: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@7: void cleanup(); c@0: void initialiseForGRF(); c@0: void cleanupForGRF(); c@0: void reset(); c@0: c@0: FeatureSet process(const float *const *inputBuffers, c@0: Vamp::RealTime timestamp); c@0: c@0: FeatureSet getRemainingFeatures(); c@0: c@0: protected: c@0: // plugin-specific data and methods go here c@0: size_t m_blockSize; c@1: size_t m_stepSize; c@0: float compressionConstant; c@3: float specMax; c@0: float *previousY; c@0: float *currentY; c@4: vector< vector > specData; c@0: vector noveltyCurve; c@3: float minDB; c@0: c@0: unsigned int tN; c@0: unsigned int thopSize; c@0: double * fftInput; c@0: double * fftOutputReal; c@0: double * fftOutputImag; c@0: c@3: int numberOfBlocks; c@0: float *hannWindowtN; c@0: c@0: vector ncTimestamps; c@0: }; c@0: c@0: c@0: #endif