Skip to content

Commit

Permalink
Merge commit 'refs/pull/14/head' of github.com:Artefact2/libxm
Browse files Browse the repository at this point in the history
  • Loading branch information
Artefact2 committed Apr 13, 2021
2 parents a7e5888 + 7759aec commit 657662e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/play.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,18 +410,17 @@ static void xm_handle_note_and_instrument(xm_context_t* ctx, xm_channel_context_
if(HAS_TONE_PORTAMENTO(ch->current) && ch->instrument != NULL && ch->sample != NULL) {
/* Tone portamento in effect, unclear stuff happens */
xm_trigger_note(ctx, ch, XM_TRIGGER_KEEP_PERIOD | XM_TRIGGER_KEEP_SAMPLE_POSITION);
} else if(s->note == 0 && ch->sample != NULL) {
/* Ghost instrument, trigger note */
/* Sample position is kept, but envelopes are reset */
xm_trigger_note(ctx, ch, XM_TRIGGER_KEEP_SAMPLE_POSITION);
} else if(s->instrument > ctx->module.num_instruments) {
/* Invalid instrument, Cut current note */
xm_cut_note(ch);
ch->instrument = NULL;
ch->sample = NULL;
} else {
ch->instrument = ctx->module.instruments + (s->instrument - 1);
if(s->note == 0 && ch->sample != NULL) {
/* Ghost instrument, trigger note */
/* Sample position is kept, but envelopes are reset */
xm_trigger_note(ctx, ch, XM_TRIGGER_KEEP_SAMPLE_POSITION);
}
}
}

Expand Down
Binary file added tests/ins-without-note1.xm
Binary file not shown.
Binary file added tests/ins-without-note2.xm
Binary file not shown.
Binary file added tests/ins-without-note3.xm
Binary file not shown.

0 comments on commit 657662e

Please sign in to comment.