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

◆ grainEnvelope()

float mood_ring::anonymous_namespace{layers.cpp}::grainEnvelope ( float ageSec)

Rise over attack, hold, fall to zero at life. Smooth at both ends.

Definition at line 48 of file layers.cpp.

48 {
49 if (ageSec < kGrainAttackSec) {
50 return smoothstepf(0.0f, kGrainAttackSec, ageSec);
51 }
52 return 1.0f - smoothstepf(kGrainAttackSec, kGrainLifeSec, ageSec);
53}
float smoothstepf(float e0, float e1, float x)
0 below e0, 1 above e1, smooth in between.

References grainEnvelope(), kGrainAttackSec, kGrainLifeSec, and mood_ring::smoothstepf().

Referenced by grainEnvelope().

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