From 463a77bba70d23d84d4f8cc47edee47b2364bf30 Mon Sep 17 00:00:00 2001 From: Claudio Matsuoka Date: Mon, 11 Feb 2013 13:13:50 -0200 Subject: [PATCH] [xmp] Add option --offset-bug-emulation Add this option from xmp 3.5.0 to handle bugs in Protracker 2.x set sample offset command. From: Martin Willers Subject: Incorrect Protrack-effect 0x09 To: xmp-bugs@helllabs.org Date: Mon, 21 Dec 1998 05:28:48 +0100 (MET) Reply-to: M.Willers@tu-bs.de I've downloaded and installed the xmp-snapshot from Sun, Dec 20 today. Don't know just how good the protrack-emulation is planned to get, but there's a bug in the interpretation of Protracker's handling of effect 0x09 (SetSampleOffset), that causes some MODs to play incorrectly. Original Protracker-source has some bug in handling effect 09, in that the sample offset given in the effect byte is added +twice+ to the current sample offset, once before playing this instrument (as is expected), and once again after this instrument has been played! So, if on the same channel the same instrument is played again without resetting the instrument's parameters (eg. when just a note period is specified, but not the instrument number again? or the other way round? :), the offset is twice as high as one would expect. This can be heard very easy eg. in the (very popular) song "No Mercy" by Alf/VTL, Position #2-#3 in the sequence. Signed-off-by: Claudio Matsuoka --- src/options.c | 5 +++++ src/xmp.1 | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/options.c b/src/options.c index 3e5c1ca..e2e5ca6 100644 --- a/src/options.c +++ b/src/options.c @@ -66,6 +66,7 @@ static void usage(char *s) " -l --loop Enable module looping\n" " -M --mute ch-list Mute the specified channels\n" " --nocmd Disable interactive commands\n" +" --offset-bug-emulation Emulate Protracker 2.x bug in effect 9\n" " -R --random Random order playing\n" " -S --solo ch-list Set channels to solo mode\n" " -s --start num Start from the specified order\n" @@ -113,6 +114,7 @@ static struct option lopt[] = { { "null", 0, 0, 'N' }, { "nocmd", 0, 0, OPT_NOCMD }, { "nofilter", 0, 0, 'F' }, + { "offset-bug-emulation",0, 0, OPT_FX9BUG }, { "output-file", 1, 0, 'o' }, { "pan", 1, 0, 'P' }, { "probe-only", 0, 0, OPT_PROBEONLY }, @@ -216,6 +218,9 @@ void get_options(int argc, char **argv, struct options *options) options->driver_id = "file"; } break; + case OPT_FX9BUG: + options->flags |= XMP_FLAGS_FX9BUG; + break; case 'P': options->mix = strtoul(optarg, NULL, 0); if (options->mix < 0) diff --git a/src/xmp.1 b/src/xmp.1 index e2a10d1..b9733e8 100644 --- a/src/xmp.1 +++ b/src/xmp.1 @@ -24,6 +24,7 @@ xmp - Extended Module Player [\fB-N, --null\fP] [\fB--nocmd\fP] [\fB-o, --output-file\fP \fIfilename\fP] +[\fB--offset-bug-emulation\fP] [\fB-P, --pan\fP \fIpan\fP] [\fB--probe-only\fP] [\fB-q, --quiet\fP] @@ -94,6 +95,8 @@ Disable interactive commands\&. .IP "\fB-o, --output-file\fP \fIfilename\fP" Set the output file name when mixing to raw or WAV files\&. If \'-\' is given as the file name, the output will be sent to stdout\&. +.IP "\fB--offset-bug-emulation\fP" +Emulate Protracker 2.x handling of effect 0x09 (set sample offset)\&. .IP "\fB-P, --pan\fP \fInum\fP" Set the percentual panning amplitude\&. .IP "\fB--probe-only\fP"