1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
6 Centre for Digital Music, Queen Mary, University of London.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
15 #ifndef _TONALCHANGEDETECT_
16 #define _TONALCHANGEDETECT_
18 #include <vamp-sdk/Plugin.h>
20 #include <dsp/chromagram/Chromagram.h>
21 #include <dsp/tonal/TonalEstimator.h>
22 #include <dsp/tonal/TCSgram.h>
28 class TonalChangeDetect : public Vamp::Plugin
31 TonalChangeDetect(float fInputSampleRate);
32 virtual ~TonalChangeDetect();
34 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
37 InputDomain getInputDomain() const { return TimeDomain; }
39 std::string getIdentifier() const;
40 std::string getName() const;
41 std::string getDescription() const;
42 std::string getMaker() const;
43 int getPluginVersion() const;
44 std::string getCopyright() const;
46 ParameterList getParameterDescriptors() const;
47 float getParameter(std::string) const;
48 void setParameter(std::string, float);
51 size_t getPreferredStepSize() const;
52 size_t getPreferredBlockSize() const;
54 OutputList getOutputDescriptors() const;
56 FeatureSet process(const float *const *inputBuffers,
57 Vamp::RealTime timestamp);
59 FeatureSet getRemainingFeatures();
64 ChromaConfig m_config;
65 Chromagram *m_chromagram;
66 TonalEstimator m_TonalEstimator;
67 mutable size_t m_step;
68 mutable size_t m_block;
70 std::queue<ChromaVector> m_pending;
71 ChromaVector m_vaCurrentVector;
74 int m_iSmoothingWidth; // smoothing window size
75 int m_minMIDIPitch; // chromagram parameters
77 float m_tuningFrequency;
79 Vamp::RealTime m_origin;
84 #endif // _TONALCHANGEDETECT_