FastLED 3.9.15
Loading...
Searching...
No Matches

◆ Vibe()

fl::audio::detector::Vibe::Vibe ( )

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

24 {
25 // Tau chosen for LED visualizer feel: ~0.3s gives ~1 second of silence
26 // to fully gate, matching user expectation that beats decay quickly when
27 // music stops. The envelope targets 0.0 — full silence on the metric.
28 SilenceEnvelope::Config cfg;
29 cfg.decayTauSeconds = 0.3f;
30 cfg.targetValue = 0.0f;
31 for (int i = 0; i < 3; ++i) {
32 mImmRelEnv[i].configure(cfg);
33 mAvgRelEnv[i].configure(cfg);
34 // Seed cached "last audio" value at 1.0 to match the detector's
35 // initial public state (getBass()/getMid()/getTreb() return 1.0
36 // before any update()). Without this, the first silent update
37 // would immediately decay from 0 — no visible change, but semantic.
38 mImmRelEnv[i].reset(1.0f);
39 mAvgRelEnv[i].reset(1.0f);
40 }
41}
SilenceEnvelope mImmRelEnv[3]
Definition vibe.h:170
SilenceEnvelope mAvgRelEnv[3]
Definition vibe.h:171

References fl::audio::SilenceEnvelope::Config::decayTauSeconds, mAvgRelEnv, mImmRelEnv, and fl::audio::SilenceEnvelope::Config::targetValue.

Referenced by update().

+ Here is the caller graph for this function: