Process one 512-sample block; returns [0…1] with inertia.
Definition at line 32 of file fx.h.
32 {
34
35 float peak = 0.0f;
36 for (
size_t i = 0; i <
length; ++i) {
37 float v = std::abs(samples[i]) * (1.0f/32768.0f);
38 peak = std::max(peak, v);
39 }
40
41
43
44
46 float riseFactor = 1.0f - std::exp(-
attackRate_ * dt);
48 } else {
49 float decayFactor = std::exp(-
decayRate_ * dt);
51 }
52
53
54 float outFactor = 1.0f - std::exp(-
outputRate_ * dt);
56
58 }
UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)
References attackRate_, currentLevel_, decayRate_, length(), outputRate_, sampleRate_, and smoothedOutput_.