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

Method computeTargetGain

src/fl/audio/auto_gain.cpp.hpp:148–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148float AutoGain::computeTargetGain() {
149 const float peakEnv = mPeakEnvelope.value();
150
151 // Avoid division by very small numbers
152 if (peakEnv < 1.0f) {
153 return mConfig.maxGain; // Signal is essentially silent
154 }
155
156 return mConfig.targetRMSLevel / peakEnv;
157}
158
159float AutoGain::updatePIController(float targetGain, float dt) {
160 const float error = targetGain - mLastGain;

Callers

nothing calls this directly

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected