I guess I can answer my own question, in part, by looking at the code. The key section is here:
{
curve_x_ += (curve_scalar_ / time_samps);
val = beg + inc * (1.0f - EXPF(curve_x_));
if(val != val)
val = 0.0f; // NaN check
}
Where EXPF
is a function that basically computes x^10:
inline float expf_fast(float x)
{
x = 1.0f + x / 1024.0f;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
x *= x;
return x;
}
…but I don’t really know why it does that, or why it behaves as strangely as it does. I watched a video on envelopes (found the link in an earlier discussion here) and while I can follow the math and the code in general, I’m not quite sure what’s going on in this case. Anyone have a clearer explanation, or a suggestion to improve AdEnv?