Help explaining code
Hi. Im having trouble understanding this bit of code. Its from Losers Waveshaping Distortion.
Mostly the second line "hdistr =....". How does the "100,.999" bit work? I get that It gives a value for "foo" to be calculated and then used in the formula. How would I enter these values in a regular calculator? Slider range is 0-100.
/thx
@slider
hdistr = min(slider1/100,.999);
foo = 2*hdistr/(1-hdistr);
@sample
spl0 = min(max(spl0,-1),1);
spl1 = min(max(spl1,-1),1);
spl0 = (1+foo)*spl0/(1+foo*abs(spl0));
spl1 = (1+foo)*spl1/(1+foo*abs(spl1));
|