Just so you know, the game considers a single stereo sample to be 2 samples. Thus, if (and only if) the song has 2 channels (which most do), you will need to double the samples-per-second value that you put into the table. If you don't do this, the song will only play halfway through.
How to turn this:
So, first off, couple requirements. You'll need Audacity
, which is both available for free and absolutely awesome. You might also need a couple extensions for Audacity to allow it to decode certain formats. We'll get to those later.
Import your audio file in Audacity, like so:
You should see something like this:
First thing first, make sure of two things: The empty nothingness at the start is cut out. Do this by zooming in with control+mousewheel, selecting the empty space, and cuting it out with control-X. Done? Very good.
Second, go down to the bottom, and make sure the format is set to samples. This is because the FS2 music engine works in samples and samples per measure, and not milliseconds or whatever it is. Do so like this:
Okay, the basics are over with! Now, open up your music table, and start the beginnings of a new soundtrack entry like so:
Obviously we'll fill that in and make it not TODO later on, but that's for later.
Go back in audacity, and cut out a few portions as you'd like. Just use your judgement, cut out bits you feel are right for ambience, for battle, for enemy arrivals, for bad ends and such. Use control+X to cut, then open a new audacity window and paste your cut bit into the new audacity window.
Now, the advice I'm about to give may not be consistent through each and every music track you want to tablify and soundtrack-ify. Songs will have different methods, different "loop points" so to speak, use your judgement.
This is also going to be very hard to explain without being able to listen to it, bear with me, this'll probably be better in video format but I'm terrible at that so just bear with me!
Try and listen to the song, get a feel for it, get a feel for the points it "loops" or "repeats". In this example, it takes about four seconds for the cycle, so we'll start at four seconds in, or as the engine'll have it, 175000 samples.
Now, get the full length of your track in samples, and use a calculator. In my case, I've got 3116000 samples and 175000 samples per measure. The calculator gives me a result of 17.8057 whatever, so I'll just put in 18 in the table.
Export your cut bit as a .ogg in your mod's /music folder, put the numbers in the table like so...
And voila! You have your first track! Now, rinse and repeat the process about 8 to 11 times until you have your finished soundtrack.
This method may be a lot trickier and time-consuming than the wiki method of just dividing by sample frequency and such, but it also produces more accurate, better-sounding music that transitions much better ingame.