Support for tracker (.mod, .xm, etc.) music?

This would allow for much smaller music files and, as a result, much smaller APKs. And maybe reduced CPU usage for playback.

Tracker music is perfect for background music in games and is often used for that purpose.

What would you say? :slight_smile: [import]uid: 52103 topic_id: 17711 reply_id: 317711[/import]


I know this topic is 12 years old. I and my team would like to have the possibility to play tracker formats in Solar2D, e.g. FastTracker XM format. The developers should be aware. Your Indy Game is not the only app on a smartphone. Many already have countless games installed there. Whatsapp videos, music, photos and much more on their NAND flash memory. We try to keep the games size as low as possible. So it has room for a lot of tracker music. 200kbyte for a song that lasts 4 - 6 minutes.

Is it possible to add an XM tracker module to Solar2D that is also supported by the different platforms?

1 Like

In addition to what I mentioned in this post, I saw this get open-sourced in the last few weeks: GitHub - icculus/armoda: Command line module player, written by John R. Hall. Seems like it should be possible to repurpose the command line bits as a plugin or part of the AL player.

1 Like

I have a couple updates on this stuff.

I was looking at the Solar audio code lately, so did just have a go and add loading of the Armoda-supported formats directly, in this branch. Using VLC as a baseline, it seems to produce similar results, though S3M volume seems a bit lower.

As far as SoLoud-related stuff goes (the other link), I’ll copy some comments I wrote in Discord a couple nights ago:

"In the last few weeks / months, I’ve been looking at WebAssembly, with the idea that maybe it would make a nice plugin target.

I played with several of the runtimes, although most of them have run into complications on Windows / 32-bit. WASM3 builds quite nicely, though, and has been easy to tinker on.

I got a few basic things working where you only needed static data, and that worked fine. I’ve lately been trying to work with the web bindings for libopenmpt (used by ModArchive’s player, for instance). This library is able to be used with SoLoud, but requires separate binaries. I’m curious about avoiding some of that hassle, so thought this would be a good first major attempt.

Said bindings come as a pair of files, one WebAssembly and the other Javascript. I tried to use the previous approach and only access the WASM part, but quickly realized you really do want the other stuff. :smiley: Partly by chance I came upon QuickJS-NG around the same time, and after some rather brutal learning (and in an even stranger coincidence also discovering txiki.js, which was also using WASM3, and borrowing heavily from and then expanding on those parts) seem to have gotten the “create file” bit finally working. Hoping to try actually pumping audio through it once I’m more awake.

I’m just loading the files like local jsw, err = wt.LoadJSWasmPair{ jsFilename = "libopenmpt.js" }, so that at least is perfectly general, although the testing is just hard-wired in at the moment. :slightly_smiling_face: I also have some vague ideas about how to mix-and-match Lua and JS code, now that this first slog seems to be winding down."

This mostly exists as a plugin, currently here (and minus most of my super-hacky test code), although I’ll probably rename it and tidy it up quite a lot. (I’ve only done anything on Windows so far, but am not aware of any blockers for other targets.)

Late last night I was able to get a file playing with it. :smiley: The tempo doesn’t agree with VLC, but some of that might just be my parameters. (EDIT: Fixed, I think. Just a little goof in the samples count due to it being stereo.)

I’m not quite sure what form these will ultimately take, but anyhow they’re out there. :slight_smile:

1 Like