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

Namespaces

namespace  anonymous_namespace{equalizer.cpp.hpp}
 
namespace  anonymous_namespace{frequency_bands.cpp.hpp}
 

Classes

class  Backbeat
 Detects backbeats (beats 2 and 4 in 4/4 time) in music. More...
 
class  Beat
 
struct  Buildup
 
class  BuildupDetector
 
struct  Chord
 
class  ChordDetector
 
struct  ChordTemplate
 
class  Downbeat
 Detects downbeats (first beat of each measure) in music. More...
 
struct  Drop
 
class  DropDetector
 
class  DynamicsAnalyzer
 
class  EnergyAnalyzer
 
struct  Equalizer
 Snapshot of equalizer state, passed to onEqualizer callbacks. More...
 
struct  EqualizerConfig
 Configuration for the equalizer detector. More...
 
class  EqualizerDetector
 WLED-style equalizer detector that provides a 16-bin frequency spectrum normalized to 0.0-1.0, plus convenience bass/mid/treble/volume getters. More...
 
class  FrequencyBands
 
struct  Key
 
class  KeyDetector
 
struct  Mood
 
class  MoodAnalyzer
 
struct  MultibandAccent
 Multi-band accent information for backbeat detection. More...
 
class  MultiBandBeat
 MultiBandBeat performs frequency-specific beat detection. More...
 
struct  MultiBandBeatDetectorConfig
 Configuration for multi-band beat detection. More...
 
class  MusicalBeat
 MusicalBeat distinguishes true musical beats from random onset detection. More...
 
struct  MusicalBeatDetectorConfig
 Configuration for musical beat detection. More...
 
class  Note
 Note - Musical note detection with MIDI output. More...
 
class  Percussion
 
class  Pitch
 Pitch - Continuous pitch tracking using autocorrelation. More...
 
class  Silence
 
class  TempoAnalyzer
 
class  Transient
 Transient - Detects sharp attack transients in audio. More...
 
class  Vibe
 
struct  VibeLevels
 
class  Vocal
 
struct  VocalDetectorDiagnostics
 

Enumerations

enum class  ChordType {
  MAJOR , MINOR , DIMINISHED , AUGMENTED ,
  MAJOR7 , MINOR7 , DOMINANT7 , SUSPENDED2 ,
  SUSPENDED4 , UNKNOWN
}
 
enum class  FFTScalingMode : u8 { None , SquareRoot , Logarithmic , Linear }
 FFT bin scaling mode applied before per-bin normalization. More...
 
enum class  PercussionType : u8 { Kick , Snare , HiHat , Tom }
 

Variables

static const ChordTemplate kChordTemplates []
 
static const int kNumChordTemplates = sizeof(kChordTemplates) / sizeof(ChordTemplate)
 
static const char * NOTE_NAMES [12]
 
static int sFrequencyBandsFFTCount = 0
 
static int sVibeFFTCount = 0
 

When outputAttack > 0 AND outputDecay > 0, uses AttackDecayFilter instead of ExponentialSmoother for per-bin output smoothing. WLED-MM uses attack ~24-50ms, decay ~250-300ms. Output attack time (seconds). 0 = use smoothing tau.

float outputDecay = 0.0f Output decay time (seconds). 0 = use smoothing tau. FFTScalingMode scalingMode = FFTScalingMode::None FFT bin scaling mode applied to raw magnitudes before normalization. float silenceThreshold = 10.0f Raw RMS threshold for silence detection. float smoothing = 0.05f Bin temporal smoothing (ExponentialSmoother tau, used as attack)

◆ fl::audio::detector::MultibandAccent

struct fl::audio::detector::MultibandAccent
Class Members
float bass
float high
float mid
float total

◆ fl::audio::detector::MultiBandBeatDetectorConfig

struct fl::audio::detector::MultiBandBeatDetectorConfig
Class Members
float bassThreshold = 0.15f Bass beat threshold (0.0-1.0) Energy increase required to trigger bass beat.
u32 beatCooldownFrames = 10 Minimum cooldown between beats in same band (frames) Prevents double-triggering on same beat.
float correlationBoost = 0.05f Cross-band correlation boost (0.0-1.0) Added to threshold when multiple bands trigger together.
bool enableCrossBandCorrelation = true Enable cross-band correlation Boosts confidence when multiple bands trigger simultaneously.
float midThreshold = 0.12f Mid beat threshold (0.0-1.0) Energy increase required to trigger mid beat.
float trebleThreshold = 0.08f Treble beat threshold (0.0-1.0) Energy increase required to trigger treble beat.

◆ fl::audio::detector::MusicalBeatDetectorConfig

struct fl::audio::detector::MusicalBeatDetectorConfig
Class Members
float bpmSmoothingAlpha = 0.9f BPM estimation smoothing factor (0.0-1.0) Higher values = slower BPM adaptation, more stable tempo.
float maxBPM = 250.0f Maximum BPM to detect (default: 250 BPM)
u32 maxIBIHistory = 8 Maximum number of inter-beat intervals to track Higher values = better BPM estimation, more memory.
float minBeatConfidence = 0.5f Minimum beat confidence to report a beat (0.0-1.0) Higher values = fewer false positives, may miss weak beats.
float minBPM = 50.0f Minimum BPM to detect (default: 50 BPM)
u32 sampleRate = 22050 Sample rate (Hz) - used for timing calculations.
u32 samplesPerFrame = 512 Samples per frame - used for timing calculations.

◆ fl::audio::detector::VibeLevels

struct fl::audio::detector::VibeLevels
Class Members
float bass = 1.0f
float bassAvg = 0.0f
float bassLongAvg = 0.0f
float bassRaw = 0.0f
bool bassSpike = false
float mid = 1.0f
float midAvg = 0.0f
float midLongAvg = 0.0f
float midRaw = 0.0f
bool midSpike = false
float treb = 1.0f
float trebAvg = 0.0f
float trebLongAvg = 0.0f
float trebRaw = 0.0f
bool trebSpike = false
float vol = 1.0f

Enumeration Type Documentation

◆ ChordType

enum class fl::audio::detector::ChordType
strong
Enumerator
MAJOR 
MINOR 
DIMINISHED 
AUGMENTED 
MAJOR7 
MINOR7 
DOMINANT7 
SUSPENDED2 
SUSPENDED4 
UNKNOWN 

Definition at line 14 of file chord.h.

◆ FFTScalingMode

enum class fl::audio::detector::FFTScalingMode : u8
strong

FFT bin scaling mode applied before per-bin normalization.

WLED-MM default is SquareRoot; FastLED previously used None (raw CQT magnitudes).

Enumerator
None 

Raw magnitudes (no scaling)

SquareRoot 

Square root of magnitude (WLED-MM default, good perceptual balance)

Logarithmic 

Log10(1 + magnitude) — compresses high peaks.

Linear 

Identity (same as None, explicit name for WLED compat)

Definition at line 17 of file equalizer.h.

17 : u8 {
18 None,
21 Linear
22};
unsigned char u8
Definition stdint.h:131
@ Logarithmic
Log10(1 + magnitude) — compresses high peaks.
Definition equalizer.h:20
@ Linear
Identity (same as None, explicit name for WLED compat)
Definition equalizer.h:21
@ None
Raw magnitudes (no scaling)
Definition equalizer.h:18
@ SquareRoot
Square root of magnitude (WLED-MM default, good perceptual balance)
Definition equalizer.h:19

◆ PercussionType

enum class fl::audio::detector::PercussionType : u8
strong
Enumerator
Kick 
Snare 
HiHat 
Tom 

Definition at line 13 of file percussion.h.

Variable Documentation

◆ kChordTemplates

const ChordTemplate fl::audio::detector::kChordTemplates[]
static
Initial value:
= {
{ChordType::MAJOR, {0, 4, 7, -1, -1}, 3},
{ChordType::MINOR, {0, 3, 7, -1, -1}, 3},
{ChordType::DIMINISHED, {0, 3, 6, -1, -1}, 3},
{ChordType::AUGMENTED, {0, 4, 8, -1, -1}, 3},
{ChordType::MAJOR7, {0, 4, 7, 11, -1}, 4},
{ChordType::MINOR7, {0, 3, 7, 10, -1}, 4},
{ChordType::DOMINANT7, {0, 4, 7, 10, -1}, 4},
{ChordType::SUSPENDED2, {0, 2, 7, -1, -1}, 3},
{ChordType::SUSPENDED4, {0, 5, 7, -1, -1}, 3},
}

Definition at line 23 of file chord.cpp.hpp.

23 {
24 {ChordType::MAJOR, {0, 4, 7, -1, -1}, 3},
25 {ChordType::MINOR, {0, 3, 7, -1, -1}, 3},
26 {ChordType::DIMINISHED, {0, 3, 6, -1, -1}, 3},
27 {ChordType::AUGMENTED, {0, 4, 8, -1, -1}, 3},
28 {ChordType::MAJOR7, {0, 4, 7, 11, -1}, 4},
29 {ChordType::MINOR7, {0, 3, 7, 10, -1}, 4},
30 {ChordType::DOMINANT7, {0, 4, 7, 10, -1}, 4},
31 {ChordType::SUSPENDED2, {0, 2, 7, -1, -1}, 3},
32 {ChordType::SUSPENDED4, {0, 5, 7, -1, -1}, 3},
33};

Referenced by fl::audio::detector::ChordDetector::detectChord(), and fl::audio::detector::ChordDetector::initializeTemplateMap().

◆ kNumChordTemplates

const int fl::audio::detector::kNumChordTemplates = sizeof(kChordTemplates) / sizeof(ChordTemplate)
static

Definition at line 34 of file chord.cpp.hpp.

Referenced by fl::audio::detector::ChordDetector::detectChord(), and fl::audio::detector::ChordDetector::initializeTemplateMap().

◆ NOTE_NAMES

const char* fl::audio::detector::NOTE_NAMES[12]
static
Initial value:
= {
"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
}

Definition at line 52 of file key.cpp.hpp.

52 {
53 "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
54};

Referenced by fl::audio::detector::Key::getRootName().

◆ sFrequencyBandsFFTCount

int fl::audio::detector::sFrequencyBandsFFTCount = 0
static

Definition at line 11 of file frequency_bands.cpp.hpp.

Referenced by fl::audio::detector::FrequencyBands::getPrivateFFTCount(), fl::audio::detector::FrequencyBands::resetPrivateFFTCount(), and fl::audio::detector::FrequencyBands::update().

◆ sVibeFFTCount

int fl::audio::detector::sVibeFFTCount = 0
static

Definition at line 19 of file vibe.cpp.hpp.

Referenced by fl::audio::detector::Vibe::getPrivateFFTCount(), fl::audio::detector::Vibe::resetPrivateFFTCount(), and fl::audio::detector::Vibe::update().