diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index d053ebf535..d6fda78aab 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -297,13 +297,13 @@ signed short int synthVoice(struct SynthObject * so) { if(wf->mode & LOOP_REVERSE) { - so->cp = (wf->endLoop)<endLoop; + cpShifted = wf->endLoop-(wf->startLoop-cpShifted); + so->cp = (cpShifted)<delta = -so->delta; + so->delta = -so->delta; /* At this point cpShifted is wrong. We need to take a step */ so->loopDir = LOOPDIR_FORWARD; } } @@ -313,8 +313,8 @@ signed short int synthVoice(struct SynthObject * so) so->loopState = STATE_LOOPING; if((wf->mode & (24)) == 0) { - so->cp = (wf->startLoop)<startLoop; + cpShifted = wf->startLoop + (cpShifted-wf->endLoop); + so->cp = (cpShifted)<