New ZMusic from 4.13.0 breaks support for .mptm files

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
TheShadsy
Posts: 86
Joined: Sun Apr 15, 2012 2:58 pm

New ZMusic from 4.13.0 breaks support for .mptm files

Post 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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post 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.
TheShadsy
Posts: 86
Joined: Sun Apr 15, 2012 2:58 pm

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

Post 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.
Attachments
sample.mptm.zip
(42.84 KiB) Downloaded 13 times
sample.it.zip
(47.98 KiB) Downloaded 7 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post by Graf Zahl »

It's a really poorly designed format but that should be enough to write some identifying code.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

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

Post by Graf Zahl »

Special detection for this format has been added.
TheShadsy
Posts: 86
Joined: Sun Apr 15, 2012 2:58 pm

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

Post 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.
User avatar
Redneckerz
Spotlight Team
Posts: 1149
Joined: Mon Nov 25, 2019 8:54 am
Graphics Processor: Intel (Modern GZDoom)

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

Post 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.
Post Reply

Return to “Closed Bugs [GZDoom]”