1
0
Fork 0
forked from len0rd/rockbox

MIDI: Fix two year old loop bug that caused distortion on some instruments. I been looking for this one

for at least 6 months.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14896 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Stepan Moskovchenko 2007-09-29 02:20:49 +00:00
parent 23a89b06ab
commit d1e306077f

View file

@ -297,13 +297,13 @@ signed short int synthVoice(struct SynthObject * so)
{ {
if(wf->mode & LOOP_REVERSE) if(wf->mode & LOOP_REVERSE)
{ {
so->cp = (wf->endLoop)<<FRACTSIZE; cpShifted = wf->endLoop-(wf->startLoop-cpShifted);
cpShifted = wf->endLoop; so->cp = (cpShifted)<<FRACTSIZE;
s2=getSample((cpShifted), wf); s2=getSample((cpShifted), wf);
} }
else else
{ {
so->delta = -so->delta; so->delta = -so->delta; /* At this point cpShifted is wrong. We need to take a step */
so->loopDir = LOOPDIR_FORWARD; so->loopDir = LOOPDIR_FORWARD;
} }
} }
@ -313,8 +313,8 @@ signed short int synthVoice(struct SynthObject * so)
so->loopState = STATE_LOOPING; so->loopState = STATE_LOOPING;
if((wf->mode & (24)) == 0) if((wf->mode & (24)) == 0)
{ {
so->cp = (wf->startLoop)<<FRACTSIZE; cpShifted = wf->startLoop + (cpShifted-wf->endLoop);
cpShifted = wf->startLoop; so->cp = (cpShifted)<<FRACTSIZE;
s2=getSample((cpShifted), wf); s2=getSample((cpShifted), wf);
} }
else else