PDA

View Full Version : Music Formats


Phil Steinmeyer
07-26-2005, 02:20 PM
I'm making a downloadable casual puzzle game. Music has to be very compact. My preferred budget is <2MB for 20+ minutes of music, though that's just a starting ballpark. MP3 and OGG seem much too big for what I need, so I'm looking at the alternatives.

I'm new to all the types of compacted/looping music, and trying to sort out what to use.

MIDI is an old standby that I'm familiar with, but its issues seem to be:
Bad>>
Could sound quite different from machine to machine (based on user's MIDI tables)
Overall rather limited sound style versatility (i.e. - the music sounds MIDI-ish)

Good>>
Easy to playback in SDL
Compacts to a very very small size

Then there are a number of other loop based formats (MOD, MO3, XM, etc), that, AFAIK, work on the principle of repeating and layering various tight loops, which, I guess are themselves just compressed sample files (WAV, MP3, OGG). I've listened to a number of looped tracks like this, and in the hands of a talented musician, these seem to sound quite good and varied.

Among these formats, what are the differences/tradeoffs in terms of size versus musical flexibility? About how small can one realistically expect these files to be (i.e. How many KB, on average, for a 3 minute song)?

And how easy will they be to integrate into my PC/Mac game, targeting 500 Mhz machine, using SDL_Mixer currently for sound?

Thanks,
Phil

Mike Boeh
07-26-2005, 02:49 PM
.oxm is fmod's compressed .xm format
bass has something similar called .mo3
I do not know of any other tracker formats that ogg compress the samples.

With either, you can have great 3-5 minute songs that take less than 200k each...

soniCron
07-26-2005, 02:56 PM
Then there are a number of other loop based formats (MOD, MO3, XM, etc), that, AFAIK, work on the principle of repeating and layering various tight loops, which, I guess are themselves just compressed sample files (WAV, MP3, OGG).

Among these formats, what are the differences/tradeoffs in terms of size versus musical flexibility? About how small can one realistically expect these files to be (i.e. How many KB, on average, for a 3 minute song)?

And how easy will they be to integrate into my PC/Mac game, targeting 500 Mhz machine, using SDL_Mixer currently for sound? You're in the right ballpark. These music formats store samples, which are usually short single instrument hits and sometimes loops, and play them back at varying sample rates to change their frequency. Combine several of these samples at once, and you've got music! If you've ever played a musical keyboard, you've been witness to such "technology". The more the playback rate of the sample varies from the original frequency, the less realsitic it sounds. Because of this, sometimes several different audio samples are used for a single instrument, each taking over when a particular threshold has been reached. For example, between C3 and C4 on the piano, sample 1 will play, but from C4 to C5 sample 2 will play.

Module (MOD) authors utilize these instrument samples when composing a song or soundtrack by entering the desired note and sample to be played in a particular channel. Each channel can usually play one sample at a time. During playback, the channels are then mixed together to create music. The composer has many playback options for each note while constructing a song, ranging from volume and pitch to vibrato and tremelo.

The advantage of MOD music is that the composer can store a single note of a piano, for example, and write an entire composition with negligible storage considerations beyond the initial sample size. Typically, musicians will write an entire soundtrack using the same 10-40 individual samples. This means that once the instruments have been chosen, an entire soundtrack upwards of 5 hours can have a filesize only slightly larger than a single song using the same instruments.

Since the instrument samples take up the vast majority of space, careful consideration is to be taken when selecting samples. Quality, length, and mono/stereo can greatly vary the final size of the sample library. The popular module formats (IT and XM) typically store the samples using minor lossless compression. Since the data is raw audio, the savings are very little, at best.

Another format, MO3, is merely an XM module with MP3 or OGG compressed samples. Because of the lossy compression used in MO3's, the final size can be considerably smaller than that of its more popular counterparts. A song stored in XM or IT at around 4.5MB can be as little as ~450KB, and possibly less if heavy compression is used. (Heavy compression is not recommended because it can seriously degrade the quality of music!)

Unfortunately, Un4Seen (http://www.un4seen.com/), maker of the BASS audio library, seems to hold the torch on MO3, as it appears to be exclusive to the BASS library. This means that in order to take advantage of lossy sample compression, you'll either have to handle the module loading yourself or use the BASS library. The BASS library is Win32 only. A good alternative to MO3 is FMOD (http://www.fmod.org/)'s OXM format. FMOD (http://www.fmod.org/) is multi-platform, though quite a bit more expensive than BASS.

If you're willing to learn the module's file format, you can handle the sample loading yourself and use SDL_mixer to playback the result. I haven't any experience with this, however.

I hope this helps!

Phil Steinmeyer
07-26-2005, 03:27 PM
Thanks for the detailed feedback.

Is it fairly easy to convert amongst the uncompressed versions of these formats, thus allowing me to have a musician create uncompressed MODs, then , when they're all supplied to me, tinker with which format to compress to ?

(i.e. the way one might have all art sourced in PSDs or TGAs, which can of course be easily converted to JPG or any other compressed format).

Or conversely, are there peculiar format exceptions that might hurt this (format X supports fewer voices, format Y is missing other features, etc.)?

Is there a fairly universal tool that most musicians use for these things and that I can also use to open them and convert them (ala Photoshop for images)?


Thanks again,
Phil

Robert Cummings
07-26-2005, 03:42 PM
A bigger consideration is also finding musicians. Not all of them will do compressed MOD+OGG samples and so on...

If you know anywhere I can get mod music cheap, let me know (a library would be nice)

soniCron
07-26-2005, 03:59 PM
Is it fairly easy to convert amongst the uncompressed versions of these formats, thus allowing me to have a musician create uncompressed MODs, then , when they're all supplied to me, tinker with which format to compress to ? Sort of. You'll want to get the file in the XM format. You can do the compression on your own after your musician has completed the work. You'll want to stay away from IT because it has a lot of features that aren't possible to translate to the compressed formats. In addition, stay away from older formats like S3M, STM, MTM, ULT, 669, FAR, AMF, OKT, PTM, and MOD because of feature limitations.

Is there a fairly universal tool that most musicians use for these things and that I can also use to open them and convert them (ala Photoshop for images)? None that I'm aware of, but once you've got the original in XM format, the conversion software for BASS and FMOD will handle the file without a hickup. XM is about as standard as you'll get, and the most widely supported overall. Any tracker (a person who composes module music) worth his salt can, and probably usually does, work in XM.

Phil Steinmeyer
07-26-2005, 04:00 PM
I went through the folks listed in the "art and sound portfolios" section of this forum and contacted several of them - most seem able to do MODs, and their prices seem pretty reasonable to me (though there is a fair spread in price from bottom to top).

bluejay
07-26-2005, 04:00 PM
Is it fairly easy to convert amongst the uncompressed versions of these formats, thus allowing me to have a musician create uncompressed MODs, then , when they're all supplied to me, tinker with which format to compress to ?


modplug tracker from
www.modplug.com
can convert between the mod formats.



Or conversely, are there peculiar format exceptions that might hurt this (format X supports fewer voices, format Y is missing other features, etc.)?


I believe .it format has more advance function like customer instrument envelope effects, while .xm format doesn't. at least that's what the last composer (michael huang) I used told me.

but some mod compression software will only support xm though...

soniCron
07-26-2005, 04:01 PM
A bigger consideration is also finding musicians. Not all of them will do compressed MOD+OGG samples and so on... This is a non-issue. There's no real need for them to. I'm not even aware of any tracker that does work with lossy compressed samples. The compression is something you do before the release. Just like you don't work with MP3's when recording music, you don't track with compressed samples. At least, in my experience (16 years+).

Robert Cummings
07-26-2005, 05:09 PM
Spent half an hour googling for licensable top quality XM music and I couldn't find a library of it that I could choose from and pay for.

soniCron
07-26-2005, 05:11 PM
Spent half an hour googling for licensable top quality XM music and I couldn't find a library of it that I could choose from and pay for. Maybe not, but there are plenty MOD sites on the web. Find some stuff you like and contact some of the artists. You'll be surprised how many of them will be willing to license their music.

Phil Steinmeyer
07-26-2005, 05:22 PM
Does using MOD/XM/MO3 impose a significant (i.e. >10%) CPU hit on a low end 500Mhz-ish machine?

Robert Cummings
07-26-2005, 05:28 PM
I think it's ok actually... considering they were used for game music on 8 bit, 8mhz machines.

soniCron
07-26-2005, 05:28 PM
Does using MOD/XM/MO3 impose a significant (i.e. >10%) CPU hit on a low end 500Mhz-ish machine? No, it does not. And there is also no difference between using compressed and uncompressed formats, since the samples are decompressed at loadtime.

Abscissa
07-26-2005, 06:46 PM
No, it does not. And there is also no difference between using compressed and uncompressed formats, since the samples are decompressed at loadtime.
And, in fact, it's better for low-end systems than non-mod-based formats, since it's lower memory usage and no need to stream from disk. (Although I hope I'm not just stating the obvious...)

soniCron
07-26-2005, 06:53 PM
And, in fact, it's better for low-end systems than non-mod-based formats, since it's lower memory usage and no need to stream from disk. (Although I hope I'm not just stating the obvious...) In addition, with lower quality MOD playback (which is of negligible difference), the pure processing can be an order of magnitude faster than decoding an MP3 or OGG. Of course, there are a million ways to make MOD playback a CPU hog. Add sinc interpolation, EQ, etc and you can eat up CPU cycles like an ant colony on cookies. Frankly, however, MODs sound great without all that fancy extra processing. (You'd be hard pressed to hear the difference most of the time.)

Ryan Clark
07-26-2005, 07:22 PM
We used FMOD's OXM format for Professor Fizzwizzle, and I think the results are quite good! Each of our 5 tracks of music are barely over 100kb.

We used Michael Huang of Game Noise (http://gamenoise.com) as our composer, and he did an excellent job with the restrictive tracker format.

soniCron
07-26-2005, 07:29 PM
We used FMOD's OXM format for Professor Fizzwizzle, and I think the results are quite good! Each of our 5 tracks of music are barely over 100kb. OT: Do any of the tracks share instruments?

Emmanuel
07-26-2005, 10:24 PM
Ive worked with Andrew ("janwinnicki" in the art & sound portfolio) for mod (well, .xm) music for Garden Golf and I highly recommend him. He's fast and serious about his work. Judging from the thread in the portfolio area, this opinion is shared by other indies as well.

I've used mikmod for playback in the Windows version of ggolf (phelios' ksound for mac, since mikmod is terminally broken on OS X) but I'll be updating ggolf for windows to use KSound as well soon.

If you're looking for 20+ minutes of music under 2 MB, for sure this is the kind of music format you need (soniCron already having pointed out how it all works). This said, demo size may not be as big of a problem as you think. Atlantis is 14 MB on PC and 17 MB on Mac (InnoSetup has better compression than zip), and we've sold 47 copies in two days.

Best regards,
Emmanuel

soniCron
07-26-2005, 10:36 PM
Atlantis is 14 MB on PC and 17 MB on Mac (InnoSetup has better compression than zip), and we've sold 47 copies in two days. Sorry for the off topic comment, but great job, emmanuel! Congrats!! Keep it up and keep us updated! :)

Sharkbait
07-27-2005, 12:09 AM
Ive worked with Andrew ("janwinnicki" in the art & sound portfolio) for mod (well, .xm) music for Garden Golf and I highly recommend him. He's fast and serious about his work. Judging from the thread in the portfolio area, this opinion is shared by other indies as well.

I've worked with Andrew as well and was very satisfied with the results. He can do both MP3/OGG and MOD/MO3/etc. based music.

On a slightly different note - one caveat with regards to using SDL: Don't use MIDI if you wish to control overall sound/music volume (on Windows / my environment, at least). Volume control is fine with MP3 OGG and MOD formats (don't know about others) but doesn't work with MIDI.

[edit] Fixed quote marks.

Robert Cummings
07-27-2005, 01:55 AM
Midi can also sound different on different cards. Plenty of people have different cards in the casual market.

soniCron
07-27-2005, 02:06 AM
Of course, you could always render the MIDI yourself, though you'd still require samples. (Or synthesize the sounds yourself, which doesn't sound too great. ;) )

Emmanuel
07-27-2005, 12:52 PM
Sorry for the off topic comment, but great job, emmanuel! Congrats!! Keep it up and keep us updated! :)

Thanks, I will! Sales are still coming in at the same rate so far.

soniCron, now, are you getting ready to complete your game yet? :)

Best regards,
Emmanuel

soniCron
07-27-2005, 01:06 PM
soniCron, now, are you getting ready to complete your game yet? :) Yes, actually! :D I'm polishing it off right now and want to give it another week or so just to make sure I didn't forget anything. I'm definitely going to let everyone know when it's ready! (I know, I know. I keep pushing the dates! But it's all but complete now, so it's just a matter of patience!)

Emmanuel
07-27-2005, 02:46 PM
But it's all but complete now, so it's just a matter of patience!)

Cool, when now that I'm out of my cave and that the initial marketing is done, if you need compatibility or usability testing I'll be happy to provide.

Best regards,
Emmanuel