59 bool needsFFT()
const override {
return true; }
61 const char*
getName()
const override {
return "DropDetector"; }
62 void reset()
override;
float rms(fl::span< const int16_t > data)
void update(shared_ptr< Context > context) override
float getTrebleEnergy(const fft::Bins &fft) const
float calculateEnergyFlux(float currentRMS) const
function_list< void(const Drop &)> onDropEvent
bool shouldTriggerDrop(float impact, u32 timestamp) const
function_list< void()> onDrop
float mEnergyFluxThreshold
float calculateBassFlux(float currentBass) const
~DropDetector() FL_NOEXCEPT override
bool mDropDetectedThisFrame
void setImpactThreshold(float threshold)
bool needsFFTHistory() const override
float getBassEnergy(const fft::Bins &fft) const
const char * getName() const override
bool needsFFT() const override
void setEnergyFluxThreshold(float threshold)
void setMinTimeBetweenDrops(u32 ms)
void setBassThreshold(float threshold)
shared_ptr< const fft::Bins > mRetainedFFT
float calculateDropImpact(float energyFlux, float bassFlux, float spectralNovelty, float rms) const
const Drop & getLastDrop() const
DropDetector() FL_NOEXCEPT
function_list< void(float impact)> onDropImpact
float getMidEnergy(const fft::Bins &fft) const
u32 getTimeSinceLastDrop(u32 currentTime) const
void updateBaselines(float rms, float bass)
float calculateSpectralNovelty(float bass, float mid, float treble) const
void fireCallbacks() override
Base definition for an LED controller.