Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Rapsodius on August 15, 2009, 11:33:43 pm
-
Well, basically my main question is how to know the number of measures (NM) of a wav or ogg to add it to music.tbl
The wiki shows a formula for calculating samples per measure (SPM) as: 2*SF*L/NM, so if we got only the 2*SF*L part we would get total samples, however I discovered the true number of samples of a music file (be it 1 or 2 channels) is SF*L. Anyways, I found not even V used that formula since I don't get coincidental results when doing SPM*NM (on the retail music.tbl) and comparing that number with 2*SF*L (on the retail wave files) using Audacity.
I will be very pleased if someone could answer the first question, the other is just a comment, as I have searched HLP and the web using Google, and I didn't find anything.
-
I had (and I have) the same problem, pal. My only solution: put a random number in the music file until you get what you want. And it works :)
-
What the wiki says is basically this:
First you need your complete track, then think about how many times will you split that track... let's say... 20 times (the more you split it, the faster the track will "Switch" from Ambience to Battle music and so on).
Now 20 will be you NM (number of mesures), with this you already have one part of your formula "SPM = 2 * SF * L / NM" complete.
Now SF is a constant (sampling frequency) on every track, so you just cross that off the list.
now you are missing the variable "L" which is the lenght of the music track in seconds OF EVERY PIECE, so... basically what you need to do here is:
Take the original file, write down the exact lenght in seconds (if you got a minute, replace it with 60 secs ^^) then take your "NM" variable and divide the total seconds by NM, this will be your "L" variable.
That's it.
a note aside, when you are gonna use a custom made music table, in your mission editor place only the your custom music pack, never use the "use this music pack if not present" because it seems to override the custom made music pack even if it works correctly.
-
I KNOW how much a minute is ;)
@Alex Navarro sig:
Hey... What the.... FS2 in Spanish?!
Only coincidential we, the 3 people in this thread know spanish.
Back on topic:
Thanks, Rodo. I had that idea before, only I thought waves and oggs have their own NM and it wasn't an arbitrary number.
So it basically cuts the track in equal parts, and I have to modify it so it makes a perfect fit with the next.
-
@Alex Navarro sig:
Hey... What the.... FS2 in Spanish?!
Yep. ;7. I've modified the link in my signature; it's more direct now.