FastLED 3.9.15
Loading...
Searching...
No Matches
fl::audio::detector::Percussion Class Reference

Detailed Description

Definition at line 20 of file percussion.h.

#include <percussion.h>

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

Public Member Functions

 Percussion () FL_NOEXCEPT
 
 Percussion () FL_NOEXCEPT
 
 ~Percussion () FL_NOEXCEPT
 
 ~Percussion () FL_NOEXCEPT override
 
void fireCallbacks () override
 
float getBassToTotalRatio () const
 
float getClickRatio () const
 
float getHiHatConfidence () const
 
float getKickConfidence () const
 
float getMidToTrebleRatio () const
 
const char * getName () const override
 
float getOnsetSharpness () const
 
float getSnareConfidence () const
 
float getSubBassProxy () const
 
float getTomConfidence () const
 
float getTrebleFlatness () const
 
float getTrebleToTotalRatio () const
 
float getZeroCrossingFactor () const
 
bool isHiHat () const
 
bool isKick () const
 
bool isSnare () const
 
bool isTom () const
 
bool needsFFT () const override
 
bool needsFFTHistory () const override
 
void reset ()
 
void reset () override
 
void setHiHatThreshold (float threshold)
 
void setHiHatThreshold (float threshold)
 
void setKickThreshold (float threshold)
 
void setKickThreshold (float threshold)
 
void setSnareThreshold (float threshold)
 
void setSnareThreshold (float threshold)
 
void setTomThreshold (float threshold)
 
void update (shared_ptr< Context > context)
 
void update (shared_ptr< Context > context) override
 
- Public Member Functions inherited from fl::audio::Detector
virtual ~Detector () FL_NOEXCEPT=default
 
virtual void setSampleRate (int) FL_NOEXCEPT
 

Public Attributes

function_list< void()> onHiHat
 
function_list< void()> onKick
 
function_list< void(PercussionType type)> onPercussionHit
 
function_list< void(const char *type)> onPercussionHit
 
function_list< void()> onSnare
 
function_list< void()> onTom
 

Private Member Functions

void applyCrossBandRejection ()
 
void computeConfidences ()
 
void computeFeatures (const fft::Bins &fft)
 
bool detectHiHat (float trebleEnergy, float trebleFlux, u32 timestamp)
 
bool detectKick (float bassEnergy, float bassFlux, u32 timestamp)
 
bool detectSnare (float midEnergy, float midFlux, u32 timestamp)
 
float getBassEnergy (const fft::Bins &fft)
 
float getMidEnergy (const fft::Bins &fft)
 
float getTrebleEnergy (const fft::Bins &fft)
 

Private Attributes

float mBassToTotal
 
float mClickRatio
 
float mHiHatConfidence
 
bool mHiHatDetected
 
float mHiHatThreshold
 
float mKickConfidence
 
bool mKickDetected
 
float mKickThreshold
 
u32 mLastHiHatTime
 
u32 mLastKickTime
 
u32 mLastSnareTime
 
u32 mLastTomTime
 
float mMidToTreble
 
float mOnsetSharpness
 
float mPrevBassEnergy
 
float mPrevMidEnergy
 
float mPrevTrebleEnergy
 
shared_ptr< const fft::BinsmRetainedFFT
 
float mSnareConfidence
 
bool mSnareDetected
 
float mSnareThreshold
 
float mSubBassProxy
 
float mTomConfidence
 
bool mTomDetected
 
float mTomThreshold
 
AttackDecayFilter< float > mTotalEnvelope {0.15f, 0.005f}
 
float mTrebleFlatness
 
float mTrebleToTotal
 
float mZeroCrossingFactor
 

Static Private Attributes

static constexpr u32 HIHAT_COOLDOWN_MS = 50
 
static constexpr u32 KICK_COOLDOWN_MS = 100
 
static constexpr u32 SNARE_COOLDOWN_MS = 80
 
static constexpr u32 TOM_COOLDOWN_MS = 100
 

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