FastLED 3.10.6
Loading...
Searching...
No Matches

◆ Vibe()

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

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

33 {
34 // Tau chosen for LED visualizer feel: ~0.3s gives ~1 second of silence
35 // to fully gate, matching user expectation that beats decay quickly when
36 // music stops. The envelope targets 0.0 — full silence on the metric.
37 SilenceEnvelope::Config cfg;
38 cfg.decayTauSeconds = 0.3f;
39 cfg.targetValue = 0.0f;
40 for (int i = 0; i < 3; ++i) {
41 mImmRelEnv[i].configure(cfg);
42 mAvgRelEnv[i].configure(cfg);
43 // Seed cached "last audio" value at 1.0 to match the detector's
44 // initial public state (getBass()/getMid()/getTreb() return 1.0
45 // before any update()). Without this, the first silent update
46 // would immediately decay from 0 — no visible change, but semantic.
47 mImmRelEnv[i].reset(1.0f);
48 mAvgRelEnv[i].reset(1.0f);
49 }
50}
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: