c@0: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ c@0: c@0: /* c@0: QM Vamp Plugin Set c@0: c@0: Centre for Digital Music, Queen Mary, University of London. c@0: All rights reserved. c@0: */ c@0: c@0: #ifndef _TONALCHANGEDETECT_ c@0: #define _TONALCHANGEDETECT_ c@0: c@3: #include c@0: c@3: #include c@3: #include c@3: #include c@0: c@0: #include c@0: #include c@0: #include c@0: c@0: class TonalChangeDetect : public Vamp::Plugin c@0: { c@0: public: c@0: TonalChangeDetect(float fInputSampleRate); c@0: virtual ~TonalChangeDetect(); c@0: c@0: bool initialise(size_t channels, size_t stepSize, size_t blockSize); c@0: void reset(); c@0: c@0: InputDomain getInputDomain() const { return TimeDomain; } c@0: c@0: std::string getName() const; c@0: std::string getDescription() const; c@0: std::string getMaker() const; c@0: int getPluginVersion() const; c@0: std::string getCopyright() const; c@0: c@0: ParameterList getParameterDescriptors() const; c@0: float getParameter(std::string) const; c@0: void setParameter(std::string, float); c@0: c@0: c@0: size_t getPreferredStepSize() const; c@0: size_t getPreferredBlockSize() const; c@0: c@0: OutputList getOutputDescriptors() const; c@0: c@0: FeatureSet process(float **inputBuffers, Vamp::RealTime timestamp); c@0: c@0: FeatureSet getRemainingFeatures(); c@0: c@0: private: c@0: void setupConfig(); c@0: c@0: ChromaConfig m_config; c@0: Chromagram *m_chromagram; c@0: TonalEstimator m_TonalEstimator; c@0: mutable size_t m_step; c@0: mutable size_t m_block; c@0: size_t m_stepDelay; c@0: std::queue m_pending; c@0: ChromaVector m_vaCurrentVector; c@0: TCSGram m_TCSGram; c@0: c@0: private: c@0: int m_iSmoothingWidth; // smoothing window size c@0: c@0: int m_minMIDIPitch; // chromagram parameters c@0: int m_maxMIDIPitch; c@0: float m_tuningFrequency; c@0: c@0: }; c@0: c@0: c@0: #endif // _TONALCHANGEDETECT_