Chris@23: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ matthiasm@0: Chris@35: /* Chris@35: NNLS-Chroma / Chordino Chris@35: Chris@35: Audio feature extraction plugins for chromagram and chord Chris@35: estimation. Chris@35: Chris@35: Centre for Digital Music, Queen Mary University of London. Chris@35: This file copyright 2008-2010 Matthias Mauch and QMUL. Chris@35: Chris@35: This program is free software; you can redistribute it and/or Chris@35: modify it under the terms of the GNU General Public License as Chris@35: published by the Free Software Foundation; either version 2 of the Chris@35: License, or (at your option) any later version. See the file Chris@35: COPYING included with this distribution for more information. Chris@35: */ Chris@35: Chris@35: #ifndef _NNLS_BASE_ Chris@35: #define _NNLS_BASE_ matthiasm@0: matthiasm@0: #include matthiasm@0: #include Chris@35: matthiasm@0: using namespace std; matthiasm@0: Chris@35: class NNLSBase : public Vamp::Plugin matthiasm@0: { matthiasm@0: public: Chris@35: virtual ~NNLSBase(); matthiasm@0: matthiasm@0: string getMaker() const; matthiasm@0: int getPluginVersion() const; matthiasm@0: string getCopyright() const; matthiasm@0: matthiasm@0: InputDomain getInputDomain() const; matthiasm@0: size_t getPreferredBlockSize() const; matthiasm@0: size_t getPreferredStepSize() const; matthiasm@0: size_t getMinChannelCount() const; matthiasm@0: size_t getMaxChannelCount() const; matthiasm@0: matthiasm@0: ParameterList getParameterDescriptors() const; matthiasm@0: float getParameter(string identifier) const; matthiasm@0: void setParameter(string identifier, float value); matthiasm@0: matthiasm@0: ProgramList getPrograms() const; matthiasm@0: string getCurrentProgram() const; matthiasm@0: void selectProgram(string name); matthiasm@0: matthiasm@0: bool initialise(size_t channels, size_t stepSize, size_t blockSize); matthiasm@0: void reset(); matthiasm@0: Chris@35: protected: Chris@35: NNLSBase(float inputSampleRate); Chris@35: void baseProcess(const float *const *inputBuffers, Chris@35: Vamp::RealTime timestamp); matthiasm@0: Chris@35: int m_frameCount; Chris@35: FeatureList m_logSpectrum; matthiasm@0: size_t m_blockSize; matthiasm@0: size_t m_stepSize; matthiasm@0: int m_lengthOfNoteIndex; Chris@23: float m_meanTuning0; Chris@23: float m_meanTuning1; Chris@23: float m_meanTuning2; matthiasm@0: float m_localTuning0; matthiasm@0: float m_localTuning1; matthiasm@0: float m_localTuning2; mail@41: float m_whitening; Chris@23: float m_preset; mail@41: float m_s; matthiasm@42: float m_useNNLS; matthiasm@0: vector m_localTuning; Chris@23: vector m_kernelValue; Chris@23: vector m_kernelFftIndex; Chris@23: vector m_kernelNoteIndex; Chris@23: float *m_dict; matthiasm@0: bool m_tuneLocal; Chris@23: vector m_chorddict; Chris@23: vector m_chordnames; Chris@23: float m_doNormalizeChroma; Chris@23: float m_rollon; matthiasm@0: }; matthiasm@0: matthiasm@0: matthiasm@0: matthiasm@0: #endif