Page 1 of 1

New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Sun Mar 02, 2025 3:35 pm
by TheShadsy
The updated ZMusic library introduced in 4.13.0 no longer plays .mptm tracker files correctly. This seems to be a problem with the new libXMP module replayer.

.mptm files are an extended version of the .it tracker format. My suspicion is that libXMP is playing these as vanilla .it files, which ignores the extended .mptm features that are supported by the Dumb replayer.

See samples here: https://drive.google.com/drive/folders/ ... sp=sharing

The most noticeable example is related to tempo. While .it files have a max tempo of 255, the .mptm format allows tempos up to 1000. However, libXMP still caps the playback tempo for all .mptm files to 255, like they're .it files. The example file MUSPIZZ5.mptm has a tempo of 500; it sounds fast and frantic under the old Dumb replayer, which is how it was intended. However, it is significantly slower under libXMP because it's being capped at 255. There are other ways to set tempo that are unique to the .mptm format, such as setting the number of rows per beat, but none of those settings are supported by libXMP either.

In some cases, the notes/music playback are affected as well. The example file MUSBRI07.mptm plays correctly under the Dumb replayer, but in libXMP, notes sometimes play incorrectly or continue playing for too long, likely because they use syntax that's unique to .mptm. It should be noticeable within in the first 15-20 seconds.

I understand the benefits of switching to libXMP as the default player in GZDoom, but the current implementation breaks support for the .mptm format. It could be that libXMP does have proper support for .mptm, just that it's not implemented correctly right now in ZMusic. But in the event that .mptm is not actually supported by libXMP, is it possible to default to using the old module replayer for .mptm files specifically?

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Sun Jun 29, 2025 2:14 pm
by Graf Zahl
The main problem here is that I have no idea how to detect .mptm files, they look like standard .it files with the exact same header as them.
Right now the only solution would be to default to DUMB for all .it files.

I wouldn't do that for other formats - I have found several .s3m files that sound significantly better with XMP.

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Mon Jun 30, 2025 4:03 am
by TheShadsy
Graf Zahl wrote: Sun Jun 29, 2025 2:14 pm The main problem here is that I have no idea how to detect .mptm files, they look like standard .it files with the exact same header as them.
Right now the only solution would be to default to DUMB for all .it files.

I wouldn't do that for other formats - I have found several .s3m files that sound significantly better with XMP.
Got something that might help! .mptm files add a chunk at the end of the file rather than using the header. Documentation is here.

I've attached a simple .it and a corresponding .mptm for comparison. At the very end of the .mptm, you can see there are some additional chunks that start with "228" that declare the mptm format.

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Mon Jun 30, 2025 11:28 am
by Graf Zahl
It's a really poorly designed format but that should be enough to write some identifying code.

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Mon Oct 06, 2025 7:59 am
by Graf Zahl
Special detection for this format has been added.

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Mon Oct 06, 2025 4:11 pm
by TheShadsy
Graf Zahl wrote: Mon Oct 06, 2025 7:59 am Special detection for this format has been added.
Thank you for figuring this out! I'm glad there was a workaround to fix this per-music track in sndinfo, but this will definitely help with compatibility for older mods.

Re: New ZMusic from 4.13.0 breaks support for .mptm files

Posted: Fri Oct 10, 2025 4:40 pm
by Redneckerz
Graf Zahl wrote: Mon Jun 30, 2025 11:28 am It's a really poorly designed format but that should be enough to write some identifying code.
To be frank, the standard is mostly there for pure musicians and to use VST's (Something you can also do in a XM or IT module, but it isn't recommended). They even list these additions as hacks so take that as you will.
It is also used in a demoscene related manner, because of OpenMPT's open source nature (not so much the format itself however. Scene musicians usually still rely on good old .mod format, together with custom synthesizer to generate the samples. Hence why modern Protracker modules sound very different compared to the old ones, despite both being able to run on an Amiga.