Ardour  9.0-pre0-386-g96ef4d20f2
GetKeyMode.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005 Centre for Digital Music ( C4DM )
3  Queen Mary Univesrity of London
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License as
7  published by the Free Software Foundation; either version 2 of the
8  License, or (at your option) any later version. See the file
9  COPYING included with this distribution for more information.
10  */
11 
12 #ifndef GETKEYMODE_H
13 #define GETKEYMODE_H
14 
15 
18 
19 
20 class GetKeyMode
21 {
22 public:
23  GetKeyMode( int sampleRate, float tuningFrequency,
24  double hpcpAverage, double medianAverage );
25 
26  virtual ~GetKeyMode();
27 
28  int process( double* PCMData );
29 
30  double krumCorr( double* pData1, double* pData2, unsigned int length );
31 
33  unsigned int getHopSize() { return m_ChromaHopSize*m_DecimationFactor; }
34 
35  double* getChroma() { return m_ChrPointer; }
36  unsigned int getChromaSize() { return m_BPO; }
37 
38  double* getMeanHPCP() { return m_MeanHPCP; }
39 
40  double *getKeyStrengths() { return m_keyStrengths; }
41 
42  bool isModeMinor( int key );
43 
44 protected:
45 
46  double m_hpcpAverage;
48  unsigned int m_DecimationFactor;
49 
50  //Decimator (fixed)
52 
53  //chroma configuration
55 
56  //Chromagram object
58 
59  //Chromagram output pointer
60  double* m_ChrPointer;
61 
62  //Framesize
63  unsigned int m_ChromaFrameSize;
64  //Hop
65  unsigned int m_ChromaHopSize;
66  //Bins per octave
67  unsigned int m_BPO;
68 
69 
70  unsigned int m_ChromaBuffersize;
71  unsigned int m_MedianWinsize;
72 
73  unsigned int m_bufferindex;
74  unsigned int m_ChromaBufferFilling;
75  unsigned int m_MedianBufferFilling;
76 
77 
79  double* m_ChromaBuffer;
80  double* m_MeanHPCP;
81 
82  double* m_MajCorr;
83  double* m_MinCorr;
84  double* m_Keys;
87 
88  double *m_keyStrengths;
89 };
90 
91 #endif // !defined GETKEYMODE_H
double m_medianAverage
Definition: GetKeyMode.h:47
unsigned int getBlockSize()
Definition: GetKeyMode.h:32
double * getMeanHPCP()
Definition: GetKeyMode.h:38
double * m_MeanHPCP
Definition: GetKeyMode.h:80
double * m_ChrPointer
Definition: GetKeyMode.h:60
ChromaConfig m_ChromaConfig
Definition: GetKeyMode.h:54
double * getChroma()
Definition: GetKeyMode.h:35
double * m_keyStrengths
Definition: GetKeyMode.h:88
Decimator * m_Decimator
Definition: GetKeyMode.h:51
double * getKeyStrengths()
Definition: GetKeyMode.h:40
unsigned int getHopSize()
Definition: GetKeyMode.h:33
unsigned int m_MedianBufferFilling
Definition: GetKeyMode.h:75
unsigned int m_DecimationFactor
Definition: GetKeyMode.h:48
virtual ~GetKeyMode()
double m_hpcpAverage
Definition: GetKeyMode.h:46
double * m_MinCorr
Definition: GetKeyMode.h:83
Chromagram * m_Chroma
Definition: GetKeyMode.h:57
unsigned int m_ChromaBufferFilling
Definition: GetKeyMode.h:74
double * m_ChromaBuffer
Definition: GetKeyMode.h:79
GetKeyMode(int sampleRate, float tuningFrequency, double hpcpAverage, double medianAverage)
double * m_Keys
Definition: GetKeyMode.h:84
unsigned int m_MedianWinsize
Definition: GetKeyMode.h:71
int process(double *PCMData)
double * m_DecimatedBuffer
Definition: GetKeyMode.h:78
unsigned int m_ChromaBuffersize
Definition: GetKeyMode.h:70
unsigned int getChromaSize()
Definition: GetKeyMode.h:36
double krumCorr(double *pData1, double *pData2, unsigned int length)
unsigned int m_ChromaHopSize
Definition: GetKeyMode.h:65
int * m_MedianFilterBuffer
Definition: GetKeyMode.h:85
int * m_SortedBuffer
Definition: GetKeyMode.h:86
unsigned int m_bufferindex
Definition: GetKeyMode.h:73
double * m_MajCorr
Definition: GetKeyMode.h:82
bool isModeMinor(int key)
unsigned int m_ChromaFrameSize
Definition: GetKeyMode.h:63
unsigned int m_BPO
Definition: GetKeyMode.h:67
PBD::PropertyDescriptor< timecnt_t > length