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

◆ updateCompression()

void fl::audio::detector::DynamicsAnalyzer::updateCompression ( )
private

Definition at line 161 of file dynamics_analyzer.cpp.hpp.

161 {
162 // Calculate dynamic range compression ratio
163 // Compression ratio = (peak - min) / peak
164 // High compression (near 1.0) = small dynamic range
165 // Low compression (near 0.0) = large dynamic range
166
167 if (mPeakRMS < 1e-6f) {
168 mCompressionRatio = 1.0f;
169 return;
170 }
171
172 float dynamicRange = mPeakRMS - mMinRMS;
174
175 // Clamp to 0-1
177}
const float dynamicRange
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Definition math.h:71
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
Definition math.h:75

References dynamicRange, fl::max(), mCompressionRatio, fl::min(), mMinRMS, and mPeakRMS.

Referenced by update().

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