MCPcopy Create free account
hub / github.com/FastLED/FastLED / Reactive

Method Reactive

src/fl/audio/audio_reactive.cpp.hpp:16–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace audio {
15
16Reactive::Reactive()
17 : mConfig{}, mContext(fl::make_shared<Context>(Sample())), mFFTBins(16) // Initialize with 16 frequency bins
18{
19 // Initialize enhanced beat detection components
20 mSpectralFluxDetector = fl::make_unique<SpectralFluxDetector>();
21 mPerceptualWeighting = fl::make_unique<PerceptualWeighting>();
22
23 // Initialize previous magnitudes array to zero
24 for (fl::size i = 0; i < mPreviousMagnitudes.size(); ++i) {
25 mPreviousMagnitudes[i] = 0.0f;
26 }
27
28 // Configure spectral silence envelopes — tau=0.2s chosen because FFT noise
29 // floor is brittle; these metrics should snap to zero quickly in silence.
30 SilenceEnvelope::Config envCfg;
31 envCfg.decayTauSeconds = 0.2f;
32 envCfg.targetValue = 0.0f;
33 mDominantFrequencyEnvelope.configure(envCfg);
34 mMagnitudeEnvelope.configure(envCfg);
35 mSpectralFluxEnvelope.configure(envCfg);
36}
37
38Reactive::~Reactive() FL_NOEXCEPT = default;
39

Callers

nothing calls this directly

Calls 3

SampleClass · 0.70
sizeMethod · 0.45
configureMethod · 0.45

Tested by

no test coverage detected