Make prefetch-piped samples stop correctly.
commit730a4e0d645d70a0073f21368e15a7ccdf5c83ae
authorAdam Sampson <ats@offog.org>
Sat, 4 Apr 2015 21:25:39 +0000 (4 22:25 +0100)
committerAdam Sampson <ats@offog.org>
Sat, 4 Apr 2015 21:25:39 +0000 (4 22:25 +0100)
tree0f2eab38ad48787a50ed8bb601407b27778aa935
parentba935ab03589acd41dd68091711694fc16ad895b
Make prefetch-piped samples stop correctly.

If a sample playing from a prefetch pipe got down to exactly 4 frames
remaining, this bit of code would call sampler_gen_sample_playback and
ask it to play a maximum of 0 frames -- so bigpos wouldn't advance, and
the sample would just sit there forever (if nothing else stopped it,
like a note release).

Change the test above so that the sample finished when there are 4 or
fewer frames remaining, rather than 3 or fewer.

(Found while playing SalamanderGrandPianoV3, which triggers a fairly
long "release string resonance" sample on every note release -- the
"harmL*" samples were all getting stuck in this way, meaning that
calfbox quickly ran out of both voices and prefetch pipes.)
sampler_voice.c