mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-30 16:01:51 +00:00
Merge pull request #328 from carlo-bramini/master
No need to do extra addition at every cycle.
This commit is contained in:
commit
0417d42a51
1 changed files with 3 additions and 2 deletions
|
@ -514,11 +514,12 @@ fluid_chorus_triangle(int *buf, int len, int depth)
|
||||||
incr = 2.0 / len * (double)depth * (double) INTERPOLATION_SUBSAMPLES;
|
incr = 2.0 / len * (double)depth * (double) INTERPOLATION_SUBSAMPLES;
|
||||||
|
|
||||||
/* Initialize first value */
|
/* Initialize first value */
|
||||||
val = 0.;
|
val = 0. - 3. * MAX_SAMPLES * INTERPOLATION_SUBSAMPLES;
|
||||||
|
|
||||||
/* Build triangular modulation waveform */
|
/* Build triangular modulation waveform */
|
||||||
while (il <= ir) {
|
while (il <= ir) {
|
||||||
ival= (int)(val + 0.5) - 3 * MAX_SAMPLES * INTERPOLATION_SUBSAMPLES;
|
/* Assume 'val' to be always negative for rounding mode */
|
||||||
|
ival = (int)(val - 0.5);
|
||||||
|
|
||||||
*il++ = ival;
|
*il++ = ival;
|
||||||
*ir-- = ival;
|
*ir-- = ival;
|
||||||
|
|
Loading…
Reference in a new issue