No need to do extra addition at every cycle.

This commit is contained in:
carlo-bramini 2018-01-19 11:01:35 +01:00 committed by GitHub
parent c61d093aec
commit 57de2bf45a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -514,11 +514,11 @@ fluid_chorus_triangle(int *buf, int len, int depth)
incr = 2.0 / len * (double)depth * (double) INTERPOLATION_SUBSAMPLES;
/* Initialize first value */
val = 0.;
val = 0. - 3. * MAX_SAMPLES * INTERPOLATION_SUBSAMPLES;
/* Build triangular modulation waveform */
while (il <= ir) {
ival= (int)(val + 0.5) - 3 * MAX_SAMPLES * INTERPOLATION_SUBSAMPLES;
ival= (int)(val + 0.5);
*il++ = ival;
*ir-- = ival;