Fix rounding for triangular modulation waveform

This commit is contained in:
carlo-bramini 2018-01-20 12:26:42 +01:00 committed by GitHub
parent 57de2bf45a
commit a4bccd9a49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -518,7 +518,8 @@ fluid_chorus_triangle(int *buf, int len, int depth)
/* Build triangular modulation waveform */
while (il <= ir) {
ival= (int)(val + 0.5);
/* Assume 'val' to be always negative for rounding mode */
ival = (int)(val - 0.5);
*il++ = ival;
*ir-- = ival;