Understanding the Ultratracker file format [Solved]

This forum is about all development around libVLC.
akarnokd
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2023 22:40

Understanding the Ultratracker file format [Solved]

Postby akarnokd » 13 Mar 2023 23:01

Hi. I'm working on reverse engineering an old game that uses a music format very similar to the Ultratracker ULT files.

Unfortunately, I don't fully understand the ULT format just by looking at the HEX decode and a format specification. I found the point where track instructions start but calculating its length, and thus getting to the audio sample section, turned out to be incorrect. I searched the VLC source code and found the magic string "MAS_UTrack_" but couldn't find anything else relating to the file format (by string search).

Is there some source code in VLC that parses the ULT file I could look at?

Thank you for your time.

Edit: 2023.03.14

With the help of libmodplugin and similar C code, I managed to convert the game file into an ULT file and got (almost) the expected sound. Thank you for the feedback.
Last edited by akarnokd on 14 Mar 2023 16:41, edited 1 time in total.

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: Understanding the Ultratracker file format

Postby mfkl » 14 Mar 2023 05:16

Can VLC play your file? Can you share the sample?
https://mfkl.github.io

akarnokd
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2023 22:40

Re: Understanding the Ultratracker file format

Postby akarnokd » 14 Mar 2023 08:24

VLC can't play the game music.

https://drive.google.com/file/d/16jvS_f ... sp=sharing

The music file format is custom made for the game. It looks very similar to an ULT file, but it has no text and filenames. it has a more compact sample registry, the same pattern-index table, the same track - 1 and pattern - 1 numers, the same pan info. However, the game uses a 6 - byte instruction setup (note, sample, f1, f2, f2_param, f1_param) and is never packed. In contrast, ULT has a 5 - byte instruction map and possible packing. Lastly, the sample bytes are listed.

I documented my findings so far here: https://github.com/akarnokd/open-ig/wik ... ile-Format

akarnokd
New Cone
New Cone
Posts: 3
Joined: 13 Mar 2023 22:40

Re: Understanding the Ultratracker file format

Postby akarnokd » 14 Mar 2023 13:59

I have new information regarding the game's music file XMF.

It is an incarnation of the ULT format, but it also uses the Fast Tracker II command 0x10 - Set Global Volume. Since ULT only allows function 0x0 .. 0xF, I don't know how this command could be represented in ULT.

Also the XMF pattern data is organized as patterns|rows|tracks|instruction . The instruction is (note, sample, f1, f2, f2 param, f1 param).

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Understanding the Ultratracker file format

Postby Rémi Denis-Courmont » 14 Mar 2023 14:10

VLC can't parse trackers per se. It uses libmodplug.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 5 guests