annotate plugins/ConstantQSpectrogram.h @ 9:507f923a93e8

* Add Constant-Q Spectrogram plugin
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 15 May 2006 19:56:21 +0000
parents
children 99dadc93042e
rev   line source
c@9 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@9 2
c@9 3 /*
c@9 4 QM Vamp Plugin Set
c@9 5
c@9 6 Centre for Digital Music, Queen Mary, University of London.
c@9 7 All rights reserved.
c@9 8 */
c@9 9
c@9 10 #ifndef _CONSTANT_Q_SPECTROGRAM_PLUGIN_H_
c@9 11 #define _CONSTANT_Q_SPECTROGRAM_PLUGIN_H_
c@9 12
c@9 13 #include <vamp-sdk/Plugin.h>
c@9 14 #include <dsp/chromagram/ConstantQ.h>
c@9 15
c@9 16 #include <queue>
c@9 17
c@9 18 class ConstantQSpectrogram : public Vamp::Plugin
c@9 19 {
c@9 20 public:
c@9 21 ConstantQSpectrogram(float inputSampleRate);
c@9 22 virtual ~ConstantQSpectrogram();
c@9 23
c@9 24 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
c@9 25 void reset();
c@9 26
c@9 27 InputDomain getInputDomain() const { return FrequencyDomain; }
c@9 28
c@9 29 std::string getName() const;
c@9 30 std::string getDescription() const;
c@9 31 std::string getMaker() const;
c@9 32 int getPluginVersion() const;
c@9 33 std::string getCopyright() const;
c@9 34
c@9 35 ParameterList getParameterDescriptors() const;
c@9 36 float getParameter(std::string) const;
c@9 37 void setParameter(std::string, float);
c@9 38
c@9 39 size_t getPreferredStepSize() const;
c@9 40 size_t getPreferredBlockSize() const;
c@9 41
c@9 42 OutputList getOutputDescriptors() const;
c@9 43
c@9 44 FeatureSet process(float **inputBuffers, Vamp::RealTime timestamp);
c@9 45
c@9 46 FeatureSet getRemainingFeatures();
c@9 47
c@9 48 protected:
c@9 49 int m_minMIDIPitch;
c@9 50 int m_maxMIDIPitch;
c@9 51 float m_tuningFrequency;
c@9 52 bool m_normalized;
c@9 53 int m_bpo;
c@9 54 int m_bins;
c@9 55
c@9 56 void setupConfig();
c@9 57
c@9 58 CQConfig m_config;
c@9 59 ConstantQ *m_cq;
c@9 60 mutable size_t m_step;
c@9 61 mutable size_t m_block;
c@9 62
c@9 63 Feature normalize(const Feature &);
c@9 64 };
c@9 65
c@9 66
c@9 67 #endif