7 * Copyright (c) 2005 Centre for Digital Music ( C4DM )
\r
8 * Queen Mary Univesrity of London
\r
11 * This program is not free software; you cannot redistribute it
\r
12 * without the explicit authorization from the centre for digital music,
\r
13 * queen mary university of london
\r
17 #ifndef GETKEYMODE_H
\r
18 #define GETKEYMODE_H
\r
21 #include "dsp/rateconversion/Decimator.h"
\r
22 #include "dsp/chromagram/Chromagram.h"
\r
28 GetKeyMode( int sampleRate, float tuningFrequency,
\r
29 double hpcpAverage, double medianAverage );
\r
31 virtual ~GetKeyMode();
\r
33 int process( double* PCMData );
\r
35 double krumCorr( double* pData1, double* pData2, unsigned int length );
\r
37 unsigned int getBlockSize() { return m_ChromaFrameSize*m_DecimationFactor; }
\r
38 unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; }
\r
40 double* getChroma() { return m_ChrPointer; }
\r
41 unsigned int getChromaSize() { return m_BPO; }
\r
43 double* getMeanHPCP() { return m_MeanHPCP; }
\r
45 double *getKeyStrengths() { return m_keyStrengths; }
\r
47 bool isModeMinor( int key );
\r
51 double m_hpcpAverage;
\r
52 double m_medianAverage;
\r
53 unsigned int m_DecimationFactor;
\r
56 Decimator* m_Decimator;
\r
58 //chroma configuration
\r
59 ChromaConfig m_ChromaConfig;
\r
62 Chromagram* m_Chroma;
\r
64 //Chromagram output pointer
\r
65 double* m_ChrPointer;
\r
68 unsigned int m_ChromaFrameSize;
\r
70 unsigned int m_ChromaHopSize;
\r
75 unsigned int m_ChromaBuffersize;
\r
76 unsigned int m_MedianWinsize;
\r
78 unsigned int m_bufferindex;
\r
79 unsigned int m_ChromaBufferFilling;
\r
80 unsigned int m_MedianBufferFilling;
\r
83 double* m_DecimatedBuffer;
\r
84 double* m_ChromaBuffer;
\r
90 int* m_MedianFilterBuffer;
\r
91 int* m_SortedBuffer;
\r
93 double *m_keyStrengths;
\r
96 #endif // !defined GETKEYMODE_H
\r