annotate NNLSBase.h @ 35:cf8898a0174c matthiasm-plugin

* Split out NNLSChroma plugin into three plugins (chroma, chordino, tuning) with a common base class. There's still quite a lot of duplication between the getRemainingFeatures functions. Also add copyright / copying headers, etc.
author Chris Cannam
date Fri, 22 Oct 2010 11:30:21 +0100
parents NNLSChroma.h@93c836cfb8c5
children d6bb9b43ac1c
rev   line source
Chris@23 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
matthiasm@0 2
Chris@35 3 /*
Chris@35 4 NNLS-Chroma / Chordino
Chris@35 5
Chris@35 6 Audio feature extraction plugins for chromagram and chord
Chris@35 7 estimation.
Chris@35 8
Chris@35 9 Centre for Digital Music, Queen Mary University of London.
Chris@35 10 This file copyright 2008-2010 Matthias Mauch and QMUL.
Chris@35 11
Chris@35 12 This program is free software; you can redistribute it and/or
Chris@35 13 modify it under the terms of the GNU General Public License as
Chris@35 14 published by the Free Software Foundation; either version 2 of the
Chris@35 15 License, or (at your option) any later version. See the file
Chris@35 16 COPYING included with this distribution for more information.
Chris@35 17 */
Chris@35 18
Chris@35 19 #ifndef _NNLS_BASE_
Chris@35 20 #define _NNLS_BASE_
matthiasm@0 21
matthiasm@0 22 #include <vamp-sdk/Plugin.h>
matthiasm@0 23 #include <list>
Chris@35 24
matthiasm@0 25 using namespace std;
matthiasm@0 26
Chris@35 27 class NNLSBase : public Vamp::Plugin
matthiasm@0 28 {
matthiasm@0 29 public:
Chris@35 30 virtual ~NNLSBase();
matthiasm@0 31
matthiasm@0 32 string getMaker() const;
matthiasm@0 33 int getPluginVersion() const;
matthiasm@0 34 string getCopyright() const;
matthiasm@0 35
matthiasm@0 36 InputDomain getInputDomain() const;
matthiasm@0 37 size_t getPreferredBlockSize() const;
matthiasm@0 38 size_t getPreferredStepSize() const;
matthiasm@0 39 size_t getMinChannelCount() const;
matthiasm@0 40 size_t getMaxChannelCount() const;
matthiasm@0 41
matthiasm@0 42 ParameterList getParameterDescriptors() const;
matthiasm@0 43 float getParameter(string identifier) const;
matthiasm@0 44 void setParameter(string identifier, float value);
matthiasm@0 45
matthiasm@0 46 ProgramList getPrograms() const;
matthiasm@0 47 string getCurrentProgram() const;
matthiasm@0 48 void selectProgram(string name);
matthiasm@0 49
matthiasm@0 50 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
matthiasm@0 51 void reset();
matthiasm@0 52
Chris@35 53 protected:
Chris@35 54 NNLSBase(float inputSampleRate);
Chris@35 55 void baseProcess(const float *const *inputBuffers,
Chris@35 56 Vamp::RealTime timestamp);
matthiasm@0 57
Chris@35 58 int m_frameCount;
Chris@35 59 FeatureList m_logSpectrum;
matthiasm@0 60 size_t m_blockSize;
matthiasm@0 61 size_t m_stepSize;
matthiasm@0 62 int m_lengthOfNoteIndex;
Chris@23 63 float m_meanTuning0;
Chris@23 64 float m_meanTuning1;
Chris@23 65 float m_meanTuning2;
matthiasm@0 66 float m_localTuning0;
matthiasm@0 67 float m_localTuning1;
matthiasm@0 68 float m_localTuning2;
matthiasm@0 69 float m_paling;
Chris@23 70 float m_preset;
matthiasm@0 71 vector<float> m_localTuning;
Chris@23 72 vector<float> m_kernelValue;
Chris@23 73 vector<int> m_kernelFftIndex;
Chris@23 74 vector<int> m_kernelNoteIndex;
Chris@23 75 float *m_dict;
matthiasm@0 76 bool m_tuneLocal;
matthiasm@0 77 int m_dictID;
Chris@23 78 vector<float> m_chorddict;
Chris@23 79 vector<string> m_chordnames;
Chris@23 80 float m_doNormalizeChroma;
Chris@23 81 float m_rollon;
matthiasm@0 82 };
matthiasm@0 83
matthiasm@0 84
matthiasm@0 85
matthiasm@0 86 #endif