View Single Post
Seren Seren's Avatar

JCF Member

Joined: Feb 2010

Posts: 857

Seren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to allSeren is a name known to all

Jul 31, 2022, 08:17 AM
Seren is offline
Reply With Quote
As pointed out in the post you linked to, the mod JJ2+, used by the majority of the active community, supports mp3 and ogg files out of the box. As such, many levels uploaded to Jazz2Online simply come with mp3 or ogg music. There is no support for custom loops and files are always played beginning to end before looping.

If you want an mp3 file to play in vanilla JJ2, the short answer is no. JJ2 only supports module music files. You can learn more about the difference in the post you linked to. Install JJ2+ or use module music.

For the long answer, let me use a simile. Say you have modeled a 3D scene in Blender and you want a picture of it. This is easy, you just render it. This corresponds to converting from module music like j2b or xm to stream music like mp3 or ogg—also easy, because all that mp3 and ogg need to know is how to play the music, and there is software that plays j2b and xm files.

Now say you have a picture and you want to convert it to a 3D scene. This should immediately sound more complicated if not entirely ill-defined as a task. The picture is just a set of pixels. It contains no information about shapes of the models that could've been used to create it. It's missing an entire dimension. The only way you could possibly "convert" it is by a painstaking manual process, modeling the scene yourself and making sure it matches. This is what "converting" from a stream format to a module format would look like. An mp3 doesn't know the difference between a drum and a guitar string, it's just a wave that tells your headphones membrane how to vibrate. An xm needs to have a clean sample of the instrument you're using and needs to know the sequence of notes you're playing—that's just how the format works.

There is, of course, a second approach. When tasked with converting a picture to a 3D scene, you could just model a single rectangle and slap the picture onto it as a texture. That is, technically, converting the picture to a 3D scene. It's not pretty, it doesn't really utilize the fact it's in 3D, it's not what you think of when you say "3D scene," but if that's all you need, it might work. This is also achievable in the original case. You can, technically, create a module music file that only has one sample, one instrument, and one pattern, which does nothing but play the sample, which is the entire mp3 file. In theory, this actually works. In practice, there is a catch. To my knowledge, other than mo3 (not supported by vanilla JJ2), no module music format supports compressed samples. All samples are raw wav files. This means that, unless your song is only a few seconds long, the resulting file would be gigantic, likely on the order of 100 MB. A music file of this size is almost certain to crash JJ2, as the game is known to exceed its memory limits even with music files just a couple of megabytes in size.

In conclusion, install JJ2+ or use module music.
__________________

I am an official JJ2+ programmer and this has been an official JJ2+ statement.