summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Moskovchenko <stevenm@rockbox.org>2007-09-29 03:07:31 +0000
committerStepan Moskovchenko <stevenm@rockbox.org>2007-09-29 03:07:31 +0000
commitaaf3e3269c9d1e3dc41255c9be5f47aba8acb515 (patch)
treebbf68566d2af3bac9c60be03b0f15706095dfb01
parentd1e306077ff111e148400a0202b548ce9ed3d7bc (diff)
downloadrockbox-aaf3e3269c9d1e3dc41255c9be5f47aba8acb515.tar.gz
rockbox-aaf3e3269c9d1e3dc41255c9be5f47aba8acb515.zip
MIDI: Fix off by one error with the guitar. Wow, I can't believe the off-keyness is finally fixed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14897 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/midi/synth.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index d6fda78aab..acf300fb44 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -308,7 +308,7 @@ signed short int synthVoice(struct SynthObject * so)
308 } 308 }
309 } 309 }
310 310
311 if((wf->mode & 28) && (cpShifted > wf->endLoop)) 311 if((wf->mode & 28) && (cpShifted >= wf->endLoop))
312 { 312 {
313 so->loopState = STATE_LOOPING; 313 so->loopState = STATE_LOOPING;
314 if((wf->mode & (24)) == 0) 314 if((wf->mode & (24)) == 0)
@@ -324,12 +324,10 @@ signed short int synthVoice(struct SynthObject * so)
324 } 324 }
325 } 325 }
326 326
327
328 /* Have we overrun? */ 327 /* Have we overrun? */
329 if( (cpShifted >= (wf->numSamples-1))) 328 if( (cpShifted >= (wf->numSamples-1)))
330 { 329 {
331 so->cp -= so->delta; 330 so->cp -= so->delta;
332
333 cpShifted = so->cp >> FRACTSIZE; 331 cpShifted = so->cp >> FRACTSIZE;
334 s2 = getSample((cpShifted)+1, wf); 332 s2 = getSample((cpShifted)+1, wf);
335 stopVoice(so); 333 stopVoice(so);