summaryrefslogtreecommitdiff
path: root/apps/plugins/midi/synth.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/midi/synth.c')
-rw-r--r--apps/plugins/midi/synth.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index b2efce1f7d..f9af4876fd 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -316,29 +316,33 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
316 316
317 s2 = getSample((cp_temp >> FRACTSIZE)+1, wf); 317 s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
318 318
319 if(mode_mask28 && cp_temp >= end_loop) 319 if(mode_mask28)
320 { 320 {
321 if(!mode_mask24) 321 /* LOOP_REVERSE|LOOP_PINGPONG = 24 */
322 if(mode_mask24 && so->loopState == STATE_LOOPING && (cp_temp < start_loop))
322 { 323 {
323 cp_temp -= diff_loop; 324 if(mode_mask_looprev)
324 s2=getSample((cp_temp >> FRACTSIZE), wf); 325 {
326 cp_temp += diff_loop;
327 s2=getSample((cp_temp >> FRACTSIZE), wf);
328 }
329 else
330 {
331 so->delta = -so->delta; /* At this point cp_temp is wrong. We need to take a step */
332 }
325 } 333 }
326 else
327 {
328 so->delta = -so->delta;
329 334
330 /* LOOP_REVERSE|LOOP_PINGPONG = 24 */ 335 if(cp_temp >= end_loop)
331 if(cp_temp < start_loop) /* this appears to never be true in here */ 336 {
337 so->loopState = STATE_LOOPING;
338 if(!mode_mask24)
332 { 339 {
333 if(mode_mask_looprev) 340 cp_temp -= diff_loop;
334 { 341 s2=getSample((cp_temp >> FRACTSIZE), wf);
335 cp_temp += diff_loop; 342 }
336 s2=getSample((cp_temp >> FRACTSIZE), wf); 343 else
337 } 344 {
338 else 345 so->delta = -so->delta;
339 {
340 so->delta = -so->delta; /* At this point cp_temp is wrong. We need to take a step */
341 }
342 } 346 }
343 } 347 }
344 } 348 }