Unified · Split
| @@ -51,6 +51,7 @@ float tEnvelopeFollower_tick(tEnvelopeFollower* const ef, float x) · 50 unmodified lines | |||
| 51 | 51 | ||
| 52 | if (x < 0.0f ) x = -x; /* Absolute value. */ | 52 | if (x < 0.0f ) x = -x; /* Absolute value. */ |
| 53 | 53 | ||
| 54 | if (isnan(x)) return 0.0f; | ||
| 54 | if ((x >= e->y) && (x > e->a_thresh)) e->y = x; /* If we hit a peak, ride the peak to the top. */ | 55 | if ((x >= e->y) && (x > e->a_thresh)) e->y = x; /* If we hit a peak, ride the peak to the top. */ |
| 55 | else e->y = e->y * e->d_coeff; /* Else, exponential decay of output. */ | 56 | else e->y = e->y * e->d_coeff; /* Else, exponential decay of output. */ |
| 56 | 57 | ||