qm-dsp
1.8
|
#include <GetKeyMode.h>
Classes | |
struct | Config |
Public Member Functions | |
GetKeyMode (Config config) | |
virtual | ~GetKeyMode () |
int | process (double *pcmData) |
Process a single time-domain input sample frame of length getBlockSize(). More... | |
double * | getKeyStrengths () |
Return a pointer to an internal 24-element array containing the correlation of the chroma vector generated in the last process() call against the stored key profiles for the 12 major and 12 minor keys, where index 0 is C major and 12 is C minor. More... | |
int | getBlockSize () |
int | getHopSize () |
Protected Member Functions | |
double | krumCorr (const double *pDataNorm, const double *pProfileNorm, int shiftProfile, int length) |
Protected Attributes | |
double | m_hpcpAverage |
double | m_medianAverage |
int | m_decimationFactor |
Decimator * | m_decimator |
Chromagram * | m_chroma |
double * | m_chrPointer |
int | m_chromaFrameSize |
int | m_chromaHopSize |
int | m_chromaBufferSize |
int | m_medianWinSize |
int | m_bufferIndex |
int | m_chromaBufferFilling |
int | m_medianBufferFilling |
double * | m_decimatedBuffer |
double * | m_chromaBuffer |
double * | m_meanHPCP |
double * | m_majProfileNorm |
double * | m_minProfileNorm |
double * | m_majCorr |
double * | m_minCorr |
int * | m_medianFilterBuffer |
int * | m_sortedBuffer |
double * | m_keyStrengths |
Detailed Description
Definition at line 19 of file GetKeyMode.h.
Constructor & Destructor Documentation
GetKeyMode::GetKeyMode | ( | Config | config | ) |
Definition at line 54 of file GetKeyMode.cpp.
References ChromaConfig::BPO, ChromaConfig::CQThresh, GetKeyMode::Config::frameOverlapFactor, ChromaConfig::FS, Chromagram::getFrameSize(), Pitch::getFrequencyForPitch(), kBinsPerOctave, m_bufferIndex, m_chroma, m_chromaBuffer, m_chromaBufferFilling, m_chromaBufferSize, m_chromaFrameSize, m_chromaHopSize, m_decimatedBuffer, m_decimationFactor, m_decimator, m_hpcpAverage, m_keyStrengths, m_majCorr, m_majProfileNorm, m_meanHPCP, m_medianAverage, m_medianBufferFilling, m_medianFilterBuffer, m_medianWinSize, m_minCorr, m_minProfileNorm, m_sortedBuffer, MajProfile, ChromaConfig::max, MathUtilities::mean(), ChromaConfig::min, MinProfile, ChromaConfig::normalise, MathUtilities::NormaliseUnitMax, GetKeyMode::Config::sampleRate, and GetKeyMode::Config::tuningFrequency.
Referenced by GetKeyMode::Config::Config().
|
virtual |
Definition at line 144 of file GetKeyMode.cpp.
References m_chroma, m_chromaBuffer, m_decimatedBuffer, m_decimator, m_keyStrengths, m_majCorr, m_majProfileNorm, m_meanHPCP, m_medianFilterBuffer, m_minCorr, m_minProfileNorm, and m_sortedBuffer.
Referenced by GetKeyMode::Config::Config().
Member Function Documentation
int GetKeyMode::process | ( | double * | pcmData | ) |
Process a single time-domain input sample frame of length getBlockSize().
Successive calls should provide overlapped data with an advance of getHopSize() between frames.
Return a key index in the range 0-24, where 0 indicates no key detected, 1 is C major, and 13 is C minor.
Definition at line 192 of file GetKeyMode.cpp.
References MathUtilities::compareInt(), MathUtilities::getMax(), kBinsPerOctave, krumCorr(), m_bufferIndex, m_chroma, m_chromaBuffer, m_chromaBufferFilling, m_chromaBufferSize, m_chrPointer, m_decimatedBuffer, m_decimator, m_majCorr, m_majProfileNorm, m_meanHPCP, m_medianBufferFilling, m_medianFilterBuffer, m_medianWinSize, m_minCorr, m_minProfileNorm, m_sortedBuffer, MathUtilities::mean(), Decimator::process(), and Chromagram::process().
Referenced by GetKeyMode::Config::Config().
double * GetKeyMode::getKeyStrengths | ( | ) |
Return a pointer to an internal 24-element array containing the correlation of the chroma vector generated in the last process() call against the stored key profiles for the 12 major and 12 minor keys, where index 0 is C major and 12 is C minor.
Definition at line 292 of file GetKeyMode.cpp.
References kBinsPerOctave, m_keyStrengths, m_majCorr, and m_minCorr.
Referenced by GetKeyMode::Config::Config().
|
inline |
Definition at line 64 of file GetKeyMode.h.
References m_chromaFrameSize, and m_decimationFactor.
|
inline |
Definition at line 67 of file GetKeyMode.h.
References krumCorr(), m_chromaHopSize, and m_decimationFactor.
|
protected |
Definition at line 161 of file GetKeyMode.cpp.
Referenced by getHopSize(), and process().
Member Data Documentation
|
protected |
Definition at line 75 of file GetKeyMode.h.
Referenced by GetKeyMode().
|
protected |
Definition at line 76 of file GetKeyMode.h.
Referenced by GetKeyMode().
|
protected |
Definition at line 77 of file GetKeyMode.h.
Referenced by getBlockSize(), getHopSize(), and GetKeyMode().
|
protected |
Definition at line 80 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 83 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 86 of file GetKeyMode.h.
Referenced by process().
|
protected |
Definition at line 89 of file GetKeyMode.h.
Referenced by getBlockSize(), and GetKeyMode().
|
protected |
Definition at line 92 of file GetKeyMode.h.
Referenced by getHopSize(), and GetKeyMode().
|
protected |
Definition at line 94 of file GetKeyMode.h.
Referenced by GetKeyMode(), and process().
|
protected |
Definition at line 95 of file GetKeyMode.h.
Referenced by GetKeyMode(), and process().
|
protected |
Definition at line 97 of file GetKeyMode.h.
Referenced by GetKeyMode(), and process().
|
protected |
Definition at line 98 of file GetKeyMode.h.
Referenced by GetKeyMode(), and process().
|
protected |
Definition at line 99 of file GetKeyMode.h.
Referenced by GetKeyMode(), and process().
|
protected |
Definition at line 101 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 102 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 103 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 105 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 106 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 107 of file GetKeyMode.h.
Referenced by GetKeyMode(), getKeyStrengths(), process(), and ~GetKeyMode().
|
protected |
Definition at line 108 of file GetKeyMode.h.
Referenced by GetKeyMode(), getKeyStrengths(), process(), and ~GetKeyMode().
|
protected |
Definition at line 109 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 110 of file GetKeyMode.h.
Referenced by GetKeyMode(), process(), and ~GetKeyMode().
|
protected |
Definition at line 112 of file GetKeyMode.h.
Referenced by GetKeyMode(), getKeyStrengths(), and ~GetKeyMode().
The documentation for this class was generated from the following files:
Generated by 1.8.11