View Issue Details

IDProjectCategoryView StatusLast Update
0001934OpenMPTPlayback Compatibilitypublic2025-12-11 08:28
ReporterLachesis Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSWineOS Version10.15 (Staging)
Product VersionOpenMPT 1.32.05.00 / libopenmpt 0.8.3 (current stable) 
Summary0001934: XM invalid instrument number inaccuracies :)
Description

I found some interesting new things about invalid instrument numbers while trying to fix libxmp's Fasttracker 2 default volume implementation. I've attached the new libxmp test module for these quirks, but to summarize the suspected OpenMPT bugs:

1) When a channel currently has an invalid instrument active, instrument numbers should not apply default volume/pan or reset the envelope positions. Row 4 of the example (rows 4-5, 20-21 of the module) plays too loud in OpenMPT, presumably because it reset the envelope positions. This also causes row A of the example below (rows 10-11 of the module) to play when it should be silent.

2) When activating an invalid instrument cuts the channel, it should also zero the channel volume—the volume number by row 4 (rows 4, 20 of the module) is actually necessary for the note to be heard. Rows 28-29 in the module should be silent, but they can be heard in OpenMPT.

0| C-5 01 --    play regular note
1| --- 7f --    invalid instrument sets default volume, resets envelope
2| C-5 -- --    activates invalid instrument; cut channel; no envelope update
3| --- 01 --    no default volume, no envelope reset/update
4| C-6 -- 40    ONLY plays with a volume effect, thus row 2 also zeroed volume.
                Starts on tick (speed) of envelope, thus row 1 reset the
                envelope positions and rows 2/3 did not update them.

8| C-5 7f --    play invalid note; cut, zero volume, no envelope reset/update
9| --- 01 --    no default volume, no envelope reset/update
A| C-6 -- 40    inaudible, because the envelope did not reset. If the envelope
                is extended, however, this does play.
Steps To Reproduce

Compare the attached module's playback with OpenMPT (or openmpt123) to Fasttracker 2 (or clone). The left channel contains the invalid instrument lines, and the right channel contains equivalents using normal constructs. Both channels should play the same, aside from some clicks in the left channel in the original FT2.

Additional Information

https://github.com/libxmp/libxmp/pull/927

(please extend the bug report form timeout if possible)

TagsNo tags attached.
Attached Files
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Lachesis

Lachesis

2025-12-10 03:47

reporter   ~0006531

Slight correction: the zero volume seems to not be any special handling but rather the result of an invalid instrument applying default volume. It also resets the pan to 0x80 plus whatever else is updated by that part of the original playercode.

Lachesis

Lachesis

2025-12-11 08:28

reporter   ~0006532

Since the originally attached test and description are a bit confused (see prior comment), I've split the two bugs into separate test files.

1) ft2_envelope_invalid_ins_v2.xm.zip: modified original module to just exhibit the envelope positions bug using volume commands to work around invalid instrument defaults.

0| C-4 01 --    play regular note
1| --- 7f --    invalid instrument sets default volume, resets envelope
2| C-4 -- --    activate invalid instrument; cut channel
3| --- 01 --
4| C-5 -- 40    Starts on tick (speed) of envelope; thus either row 1 reset
5|              the envelope positions and rows 2/3 did not update them [A];
6|              or row 3 also reset the envelope positions [B].
7|
8| C-4 7f --    activate invalid instrument; cut channel
9| --- 01 --
A| C-5 -- 40    envelope resumes from its position at the start of row 8,
                because neither of the previous rows reset the envelope
                position. Thus, [A] is correct.

2) ft2_invalid_ins_defaults.xm.zip: only tests the default volume/pan bug. Row 13-14 is the part OpenMPT gets wrong: row 13 should be silent, row 14 should be center pan.

Issue History

Date Modified Username Field Change
2025-12-09 13:29 Lachesis New Issue
2025-12-09 13:29 Lachesis File Added: ft2_envelope_invalid_ins.xm.zip
2025-12-10 03:47 Lachesis Note Added: 0006531
2025-12-11 08:28 Lachesis Note Added: 0006532
2025-12-11 08:28 Lachesis File Added: ft2_invalid_ins_defaults.xm.zip
2025-12-11 08:28 Lachesis File Added: ft2_envelope_invalid_ins_v2.xm.zip