void-packages/srcpkgs/whysynth/patches/fix_agran.patch

15 lines
652 B
Diff

diff --git src/agran_oscillator.c src/agran_oscillator.c
index 6630215..3bdf555 100644
--- src/agran_oscillator.c
+++ src/agran_oscillator.c
@@ -418,7 +418,8 @@ create_grain_envelopes(unsigned long sample_rate)
for (i = 0; i <= peak; i++) {
const float t = (float)i * scale;
const float ampl = expf(-t*t/2);
- env[e].data[Y_CONTROL_PERIOD + peak + i] = ampl;
+ env[e].data[Y_CONTROL_PERIOD + env[e].length - 1
+ - peak + i] = ampl;
env[e].data[Y_CONTROL_PERIOD + peak - i] = ampl;
}
}