c@232: /* c@378: Copyright (c) 2005 Centre for Digital Music ( C4DM ) c@378: Queen Mary Univesrity of London c@378: c@378: This program is free software; you can redistribute it and/or c@378: modify it under the terms of the GNU General Public License as c@378: published by the Free Software Foundation; either version 2 of the c@378: License, or (at your option) any later version. See the file c@378: COPYING included with this distribution for more information. c@232: */ c@232: c@265: #ifndef GETKEYMODE_H c@232: #define GETKEYMODE_H c@232: c@232: c@232: #include "dsp/rateconversion/Decimator.h" c@232: #include "dsp/chromagram/Chromagram.h" c@232: c@232: c@232: class GetKeyMode c@232: { c@232: public: c@234: GetKeyMode( int sampleRate, float tuningFrequency, c@234: double hpcpAverage, double medianAverage ); c@232: c@232: virtual ~GetKeyMode(); c@232: c@232: int process( double* PCMData ); c@232: c@232: double krumCorr( double* pData1, double* pData2, unsigned int length ); c@232: c@232: unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; } c@232: unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; } c@232: c@232: double* getChroma() { return m_ChrPointer; } daschuer@458: unsigned int getChromaSize(); c@232: c@232: double* getMeanHPCP() { return m_MeanHPCP; } c@232: c@265: double *getKeyStrengths() { return m_keyStrengths; } c@265: c@268: bool isModeMinor( int key ); c@232: c@232: protected: c@232: c@232: double m_hpcpAverage; c@232: double m_medianAverage; c@232: unsigned int m_DecimationFactor; c@232: c@232: //Decimator (fixed) c@232: Decimator* m_Decimator; c@232: c@232: //chroma configuration c@234: ChromaConfig m_ChromaConfig; c@232: c@232: //Chromagram object c@232: Chromagram* m_Chroma; c@232: c@232: //Chromagram output pointer c@232: double* m_ChrPointer; c@232: c@232: //Framesize c@232: unsigned int m_ChromaFrameSize; c@232: //Hop c@232: unsigned int m_ChromaHopSize; c@232: c@232: c@232: unsigned int m_ChromaBuffersize; c@232: unsigned int m_MedianWinsize; c@232: c@232: unsigned int m_bufferindex; c@232: unsigned int m_ChromaBufferFilling; c@232: unsigned int m_MedianBufferFilling; c@232: c@232: c@232: double* m_DecimatedBuffer; c@232: double* m_ChromaBuffer; c@232: double* m_MeanHPCP; c@232: c@232: double* m_MajCorr; c@232: double* m_MinCorr; c@232: double* m_Keys; c@232: int* m_MedianFilterBuffer; c@232: int* m_SortedBuffer; c@265: c@265: double *m_keyStrengths; c@232: }; c@232: c@232: #endif // !defined GETKEYMODE_H