void-packages/srcpkgs/whysynth/patches/fix_agran.patch
Đoàn Trần Công Danh 04b9978a29 srcpkgs/w*: convert patches to -Np1
* wine is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

13 lines
601 B
Diff

diff --git src/agran_oscillator.c src/agran_oscillator.c
index 6630215..3168469 100644
--- a/src/agran_oscillator.c
+++ b/src/agran_oscillator.c
@@ -421,6 +421,9 @@ create_grain_envelopes(unsigned long sample_rate)
env[e].data[Y_CONTROL_PERIOD + peak + i] = ampl;
env[e].data[Y_CONTROL_PERIOD + peak - i] = ampl;
}
+ if (env[e].length % 2 == 0) { /* if length is even, zero last frame of buffer */
+ env[e].data[Y_CONTROL_PERIOD + env[e].length - 1] = 0.0f;
+ }
}
break;