Mercurial > hg > beaglert
diff projects/d-box/FeedbackOscillator.cpp @ 51:4f8db16f17b5 newapi
D-Box updates; should work as old version did
author | andrewm |
---|---|
date | Sat, 30 May 2015 13:25:51 -0500 |
parents | be427da6fb9c |
children |
line wrap: on
line diff
--- a/projects/d-box/FeedbackOscillator.cpp Sat May 30 12:34:32 2015 -0500 +++ b/projects/d-box/FeedbackOscillator.cpp Sat May 30 13:25:51 2015 -0500 @@ -62,7 +62,12 @@ float outFloat = coeffs[COEFF_B0] * input + coeffs[COEFF_B1] * lastInput - coeffs[COEFF_A1] * lastOutput; int requestRenderLength = 0; - *output = outFloat; + if(outFloat < -0.5) + *output = 0; + else if(outFloat > 0.5) + *output = 1; + else + *output = outFloat + 0.5; if(canTrigger && outFloat > 0 && lastOutput <= 0) { triggered = true;