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

◆ resolvePreset()

void fl::audio::AutoGain::resolvePreset ( )
private

Resolve preset enum into concrete PI tuning parameters.

Definition at line 29 of file auto_gain.cpp.hpp.

29 {
30 switch (mConfig.preset) {
32 mPeakDecayTau = 3.3f;
33 mKp = 0.6f;
34 mKi = 1.7f;
35 mGainFollowSlowTau = 12.3f;
36 mGainFollowFastTau = 0.38f;
37 break;
39 mPeakDecayTau = 1.3f;
40 mKp = 1.5f;
41 mKi = 1.85f;
42 mGainFollowSlowTau = 8.2f;
43 mGainFollowFastTau = 0.26f;
44 break;
46 mPeakDecayTau = 6.7f;
47 mKp = 0.65f;
48 mKi = 1.2f;
49 mGainFollowSlowTau = 16.4f;
50 mGainFollowFastTau = 0.51f;
51 break;
53 mPeakDecayTau = mConfig.peakDecayTau;
54 mKp = mConfig.kp;
55 mKi = mConfig.ki;
56 mGainFollowSlowTau = mConfig.gainFollowSlowTau;
57 mGainFollowFastTau = mConfig.gainFollowFastTau;
58 break;
59 }
60 // Reconfigure peak envelope filter with resolved decay tau
61 // Attack is always fast (10ms), decay varies by preset
62 mPeakEnvelope = AttackDecayFilter<float>(0.01f, mPeakDecayTau, mConfig.targetRMSLevel);
63}
AttackDecayFilter< float > mPeakEnvelope
Peak envelope tracker: fast attack (10ms), slow decay (preset-dependent)
Definition auto_gain.h:152
AutoGainConfig mConfig
Definition auto_gain.h:140
@ AGCPreset_Vivid
Faster response: 1.3s peak decay, higher PI gains.
Definition auto_gain.h:15
@ AGCPreset_Normal
Balanced: 3.3s peak decay, moderate PI gains.
Definition auto_gain.h:14
@ AGCPreset_Custom
Use custom PI tuning fields below.
Definition auto_gain.h:17
@ AGCPreset_Lazy
Slower, more stable: 6.7s peak decay, lower PI gains.
Definition auto_gain.h:16

References fl::audio::AGCPreset_Custom, fl::audio::AGCPreset_Lazy, fl::audio::AGCPreset_Normal, fl::audio::AGCPreset_Vivid, mConfig, mGainFollowFastTau, mGainFollowSlowTau, mKi, mKp, mPeakDecayTau, and mPeakEnvelope.

Referenced by configure().

+ Here is the caller graph for this function: