Author Topic: Need help with music files  (Read 1878 times)

0 Members and 1 Guest are viewing this topic.

Need help with music files
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.
<Hades> YOU DO NOT UNDERSTAND
<Hades> And neither do I
------------------------------------------------------------
<pecenipicek> can you root my /?
<mura> HEY!
<mura> get a room
<mura> you perverts

 
Re: Need help with music files
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  :)
Working on the Freespace 2 spanish translation. In case you want to play the game in castillian, click here. You'll need some spanish there, though, sorry :p

If you want your mod/campaign translated to spanish, please PM me or send me an e-mail message.

I could translate from spanish to english too, if you want, but it wouldn't be perfect, not at all. For spanish->english translations comes better an english native with spanish knowledge.

 

Offline Rodo

  • Custom tittle
  • 212
  • stargazer
    • Minecraft
    • Steam
Re: Need help with music files
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.

el hombre vicio...

 
Re: Need help with music files
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.
<Hades> YOU DO NOT UNDERSTAND
<Hades> And neither do I
------------------------------------------------------------
<pecenipicek> can you root my /?
<mura> HEY!
<mura> get a room
<mura> you perverts

  
Re: Need help with music files
Quote
@Alex Navarro sig:
Hey... What the.... FS2 in Spanish?!


Yep.  ;7. I've modified the link in my signature; it's more direct now.
Working on the Freespace 2 spanish translation. In case you want to play the game in castillian, click here. You'll need some spanish there, though, sorry :p

If you want your mod/campaign translated to spanish, please PM me or send me an e-mail message.

I could translate from spanish to english too, if you want, but it wouldn't be perfect, not at all. For spanish->english translations comes better an english native with spanish knowledge.