View Issue Details

IDProjectCategoryView StatusLast Update
0001412OpenMPTlibopenmptpublic2021-02-13 20:00
ReporterJosepMaJAZ Assigned ToSaga Musix  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindowsOS Version10
Product VersionOpenMPT 1.29.07.00 / libopenmpt 0.5.5 (upgrade first) 
Target VersionOpenMPT 1.29.08.00 / libopenmpt 0.5.6/0.5.7 (upgrade first)Fixed in VersionOpenMPT 1.29.08.00 / libopenmpt 0.5.6/0.5.7 (upgrade first) 
Summary0001412: Load incorrectness on a specific S3M file
Description

This specific Adlib-kind S3M file loads one of the samples incorrectly, and so it doesn't play right.

I've been able to locate the problem on the sample speed, which is incorrectly loaded in openMPT as 1024768Hz, while the rest of the samples are "correctly" set to 8363 (aside of one of them that has a different value intentionally).

It was created with Scream Tracker 3 in 1997, and has 0000 as the speed in all samples (except the different one), so I don't know why some are remapped to 8363 as they should, but not the last one.

(See additional info)

Additional Information

I checked the code and located what might be the problem in S3MSampleHeader::ConvertToMPT
https://source.openmpt.org/browse/openmpt/trunk/OpenMPT/soundlib/S3MTools.cpp

What I believe that happens is that probably this file has, due to a bug or something, some of the upper bits in the c5speed set at 1 while it should all be zero, so the if checks in S3MTools do accept the invalid speed.

Probably, it is needed, at least if the file is detected to come from Scream Tracker, that the upper limit is clipped at 0xFFFF (setting it to 8363 just like with the value 0), or something.
like:

// C-5 frequency
mptSmp.nC5Speed = c5speed;
if(mptSmp.nC5Speed == 0 || (isST3 && mptSmp.nC5Speed > 0xFFFF))
{
    mptSmp.nC5Speed = 8363;
} else if(mptSmp.nC5Speed < 1024)
{
    mptSmp.nC5Speed = 1024;
TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

Saga Musix

Saga Musix

2021-02-13 19:21

administrator   ~0004628

ST3 does indeed ignore the upper bits this fix will have to take the tracked used to create the file into account.

Saga Musix

Saga Musix

2021-02-13 19:22

administrator   ~0004629

Did you intend to attach a file to demonstrate the problem?

JosepMaJAZ

JosepMaJAZ

2021-02-13 19:24

reporter   ~0004630

Attaching the file, sorry.

ADLIB.zip (2,817 bytes)
Saga Musix

Saga Musix

2021-02-13 20:00

administrator   ~0004631

Fixed in r14146.

Issue History

Date Modified Username Field Change
2021-02-13 19:19 JosepMaJAZ New Issue
2021-02-13 19:21 Saga Musix Note Added: 0004628
2021-02-13 19:21 Saga Musix Assigned To => Saga Musix
2021-02-13 19:21 Saga Musix Status new => assigned
2021-02-13 19:22 Saga Musix Note Added: 0004629
2021-02-13 19:24 JosepMaJAZ Note Added: 0004630
2021-02-13 19:24 JosepMaJAZ File Added: ADLIB.zip
2021-02-13 20:00 Saga Musix Note Added: 0004631
2021-02-13 20:00 Saga Musix Status assigned => resolved
2021-02-13 20:00 Saga Musix Resolution open => fixed
2021-02-13 20:00 Saga Musix Fixed in Version => OpenMPT 1.29.08.00 / libopenmpt 0.5.6/0.5.7 (upgrade first)
2021-02-13 20:00 Saga Musix Target Version => OpenMPT 1.29.08.00 / libopenmpt 0.5.6/0.5.7 (upgrade first)