Tracker XM,Mod,S3M, loader

Well since I’m currently kinda stuck with a opengl 1.0 netbook but tons of free time, I searched for projects that would be at least of any use for my game :slight_smile:



I suddenly got the idea, that I could try to write a xm loader for jme3.

→ xm ultra short description: xm is kinda great for background musik, a similar system was used in the unreal1 engine and it was untill recently one of the main musik systems used on nintendo devices.



Good idea?

Anything to keep in mind, respecting the current sound system?

Any chance of -if i get this done- this might be added to the jme3 source?

2 Likes

Sure, why not? You can look at the ogg decoder for an example, it would obviously be different as you have to assemble the sound from the sampler data but the part where you put the audio buffers in the system would be the same.

I actually don’t plan on write a complete sampler/tracker myself.

I will look what jme licence compatible trackers for java are out there, and then look into making one of them that looks promising compatible with jme, and update the code to at least java 1.5 and to throw proper asset errors if needed.

No need to reinvent the wheel :slight_smile:

Alright, the format isn’t that complicated actually… But as long as you don’t bring a native library, GPL lib or other kitchen sink, hf :slight_smile:

LGPL would be fine if I undrstand it correctly or?

Yeah, if its a separate jar file. Adding LGPL code is not ok.

How can I create XM files? Is there any tools or conversion software?

Theres trackers that can export to various formats. http://www.modplug.com/

Try milkytracker, it’s gui is kinda basic, but it is also quite good.



Also if oyu need some example files, take a look at

Good first step done, found a nice and cleanly written library that is under lgpl and supports xm s3m, mod and similar.

----



Now the next step is to update it to todays java (mostly generics and such stuff) and add a output device for jme3



Then I will package it again as a library, include sourcode and licence.txt

→ This will be the basis for the jme3 use then



After that I will use that lgpl library and add it to buildpath, create some examples and make a basic xm file for it with no stolen instruments or similar problems, so it can be distributed in the test data package.

2 Likes

If this library you’re talking about is not maintained any longer, it might be worth shooting the developer an e-mail to ask if you may apply your own license (i.e. New BSD), while still giving the original developer credit for the library of course.

After some slight cough cough inactivity

The last reply to this topic is now over 1219 days old.

I finally found a nice mod player that has lgpl and kinda works.
A first prototype is at:

https://github.com/empirephoenix/OZMOD-4-JME

Currently it uses way to much cpu and seems to play files a bit to fast.
I only made mod files work for the first step, xm and s3m will follow as soon as the issues are sorted out.
The audio is in streaming mode, as these files could have infinite length due to repeat commands, and populating a buffer with it might easily kill all memory.

If anyone is interested in helping me with sorting things out, and bringing ozmod to current java conventions, I would be very happy.
Especially if anyone might know a better performing implementation/changes for
https://github.com/empirephoenix/OZMOD-4-JME/blob/master/src/main/java/com/jme3x/ozmod/loader/BufferedQueueInputStream.java

Last I checked IBXM could play some files pretty well:
https://code.google.com/p/micromod/source/browse/trunk/ibxm/
Its released under new BSD license.

And of course the option of using a native library is always there, and you will get the best compatibility.

The library itself seems to work good enough, the problem is getting the stuff into JME’s audio system :stuck_out_tongue:
Originally it used javax.sound stuff.

There’s a conveniently placed IBXM.getAudio() method for that purpose. I actually had it working at one point but it must have been lost while upgrading PCs or OS.

Hm ok i tested a bit further with ozmod, and run into some internal problems of that library.
Next try is ibxm then :slight_smile: At least i now have the necessary wrapper classes for streaming pcm data to jme ready :smile:
(As mod files can be infinite length streaming is a must)

So anyone here wants to try the loader?
I actually managed to get bufferd and streaming mode to work :wink:
Still nidds a little cleanup and a few more utility methods, but that should be doable.