FastLED 3.10.8
Loading...
Searching...
No Matches
fl::audio::detector::KeyDetector Class Reference

Detailed Description

Definition at line 81 of file key.h.

#include <key.h>

+ Inheritance diagram for fl::audio::detector::KeyDetector:
+ Collaboration diagram for fl::audio::detector::KeyDetector:

Public Member Functions

 KeyDetector () FL_NO_EXCEPT
 
 ~KeyDetector () FL_NO_EXCEPT override
 
void fireCallbacks () FL_NO_EXCEPT override
 
const Key & getCurrentKey () const FL_NO_EXCEPT
 
const char * getName () const FL_NO_EXCEPT override
 
bool hasKey () const FL_NO_EXCEPT
 
bool needsFFT () const FL_NO_EXCEPT override
 
void reset () FL_NO_EXCEPT override
 
void setAveragingFrames (int frames) FL_NO_EXCEPT
 
void setConfidenceThreshold (float threshold) FL_NO_EXCEPT
 
void setMinDuration (u32 ms) FL_NO_EXCEPT
 
void update (shared_ptr< Context > context) FL_NO_EXCEPT override
 
- Public Member Functions inherited from fl::audio::Detector
virtual ~Detector () FL_NO_EXCEPT=default
 
virtual bool needsFFTHistory () const FL_NO_EXCEPT
 
virtual void setSampleRate (int) FL_NO_EXCEPT
 

Public Attributes

function_list< void(const Key &key)> onKey
 
function_list< void(const Key &key)> onKeyChange
 
function_list< void()> onKeyEnd
 

Private Member Functions

float correlateWithProfile (const float *chroma, const float *profile, int rootNote) FL_NO_EXCEPT
 
Key detectKey (const float *chroma, u32 timestamp) FL_NO_EXCEPT
 
void extractChroma (const fft::Bins &fft, float *chroma) FL_NO_EXCEPT
 
void getAveragedChroma (float *chroma) FL_NO_EXCEPT
 
void initializeProfileStats () FL_NO_EXCEPT
 
void normalizeChroma (float *chroma) FL_NO_EXCEPT
 
void updateChromaHistory (const float *chroma) FL_NO_EXCEPT
 

Private Attributes

int mAveragingFrames
 
vector< float > mChromaHistory [12]
 
float mConfidenceThreshold
 
Key mCurrentKey
 
bool mFireKey = false
 
bool mFireKeyChange = false
 
bool mFireKeyEnd = false
 
int mHistoryIndex
 
int mHistorySize
 
bool mKeyActive
 
u32 mKeyStartTime
 
float mMajorProfileMean = 0.0f
 
float mMajorProfileStdDev = 0.0f
 
u32 mMinKeyDuration
 
float mMinorProfileMean = 0.0f
 
float mMinorProfileStdDev = 0.0f
 
Key mPreviousKey
 
shared_ptr< const fft::Bins > mRetainedFFT
 

Static Private Attributes

static const float MAJOR_PROFILE [12]
 
static const float MINOR_PROFILE [12]
 

The documentation for this class was generated from the following files: