Skip to content

Commit

Permalink
Fix: spike when tone portamento is used without a target note. Thanks @…
Browse files Browse the repository at this point in the history
…DanielOaks for pinpointing the issue.
  • Loading branch information
Artefact2 committed Jan 8, 2015
1 parent 69a5e8a commit 467d312
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ tremor.xm | PASS | MilkyTracker | Should sound identical
amiga.xm | FAIL | MilkyTracker, xmp | Should sound identical.
pattern-lo….xm| PASS | MilkyTracker | Should play the same notes at the same time.
finetune.xm | PASS | MilkyTracker | Left and right channels should sound identical.
tone-porta….xm| FAIL | MilkyTracker | Should sound identical.
tone-porta….xm| PASS | MilkyTracker | Should sound identical.
~~~
Thanks
Expand Down
4 changes: 4 additions & 0 deletions src/play.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ static void xm_arpeggio(xm_context_t* ctx, xm_channel_context_t* ch, uint8_t par
}

static void xm_tone_portamento(xm_context_t* ctx, xm_channel_context_t* ch) {
/* 3xx called without a note, wait until we get an actual
* target note. */
if(ch->tone_portamento_target_period == 0.f) return;

if(ch->period != ch->tone_portamento_target_period) {
XM_SLIDE_TOWARDS(ch->period,
ch->tone_portamento_target_period,
Expand Down

0 comments on commit 467d312

Please sign in to comment.