FastLED 3.10.8
Loading...
Searching...
No Matches

◆ updateAttackTime() [2/2]

void fl::audio::detector::Transient::updateAttackTime ( float flux)
private

Definition at line 151 of file transient.cpp.hpp.

151 {
152 // Estimate attack time based on flux magnitude
153 // Higher flux = faster attack = shorter attack time
154 // Range: ~1-20ms for typical transients
155 const float minAttackTime = 1.0f; // ms
156 const float maxAttackTime = 20.0f; // ms
157
158 // Inverse relationship: stronger flux = shorter attack time
159 float normalized = fl::min(1.0f, flux / 10.0f);
160 mAttackTime = maxAttackTime - (normalized * (maxAttackTime - minAttackTime));
161}
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71

References fl::FL_NO_EXCEPT, mAttackTime, and fl::min().

Referenced by update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: