c@232: /* c@232: * Author: c.landone c@232: * Description: c@232: * c@232: * Syntax: C++ c@232: * c@232: * Copyright (c) 2005 Centre for Digital Music ( C4DM ) c@232: * Queen Mary Univesrity of London c@232: * c@232: * c@232: * This program is not free software; you cannot redistribute it c@232: * without the explicit authorization from the centre for digital music, c@232: * queen mary university of london c@232: * 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; } c@232: unsigned int getChromaSize() { return m_BPO; } c@232: c@232: double* getMeanHPCP() { return m_MeanHPCP; } c@232: c@265: double *getKeyStrengths() { return m_keyStrengths; } c@265: c@232: int 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: //Bins per octave c@232: unsigned int m_BPO; 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