Author Topic: Making your own event music  (Read 4792 times)

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Making your own event music
Making new battle tracks has aggravated Freespace modders for ages.  No one knew how to do it, and the best method was usually estimating.  Well, now that we have the source code, all we need to do is look.  Here's what I discovered...

--Find out the number of measures in the file.  The best way to do this is to keep time (by clapping or getting a metronome, finding the average time for one measure, and multiplying by the number of seconds.  For reference, FS2_AArv_A01 is a march.  Count "ONE, two, ONE..." and don't quite make it to "two" again.  This corresponds with the table, where it says that this bit of music is 1.8 measures long.  This is rather straightforward.  The next part is what people had trouble figuring out, and needed the source to see.

--The number of samples per measure is the number of bytes per measure divided by 2.  The event-driven music is usually formatted as 16 bits per sample.  A stereo track at 44,100 Hz will be 172 kilobytes per second.  So multiply this number by the length, in seconds, of your music to get the total number of kilobytes actually used by the music itself.  Multiply this by 1024 to get the number of bytes in your music.  Now divide the number of bytes by the number of measures to get bytes per measure, and then again by 2 to get samples per measure.

--There you have it.  Put your file name, the number of measures, and the number of samples per measure in music.tbl, and you have the foundation of a new battle track.  And with FS2_Open, you now have the capability to include up to 30 soundtracks and 30 briefing/mainhall tracks in a single music.tbl. :)

Note - I did some calculations based on the Volition soundtracks, and they didn't come out correctly, much to my puzzlement.  I traced through the code, however, and that seems to be what it is.  If anyone wants to take a look, the relevant stuff is in eventmusic.cpp.
« Last Edit: March 29, 2003, 03:59:09 am by 561 »

 

Offline diamondgeezer

Making your own event music
Blimey, good effort Goob. I don't approve of the use of the word 'bollixed', however :p

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Making your own event music
No?  Why?  Did I miss a nuance somewhere? :) (AFAIK it just means to confuse or confound.)
« Last Edit: March 29, 2003, 03:59:21 am by 561 »

 

Offline diamondgeezer

Making your own event music
Yeah, sorry, I just felt the forum needed a bit of a smut injection :)

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Making your own event music
:wtf:

*looks up word*

*word seems innocent enough*

*is confused :confused:*

*notices word etymology*

:eek:

Whoops! :o I will edit that straight away. :o


*Note to self - look up slang before using it*

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • FLAMES OF WAR
Making your own event music
Anyone ever tried Fruty Loops?
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Making your own event music
Awesome work Goober...counting for a pre-recorded piece of music seems very insane but doable and having the information is really useful.

How does it really benefit us however?  TBP's been working for 2 years without any proper calcuations.
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Making your own event music
Quote
Originally posted by TrashMan
Anyone ever tried Fruty Loops?
Yes.  Made lots of stuff with it, such as this dark and trippy little number.  What has that to do with this topic, however?
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Fry_Day

  • 28
Making your own event music
Naturally, Volition's music files don't calculate sizes correctly, as they use the ADPCM compression codec, which means the bitrate is significantly lower. ADPCM generally reduces the sizes four-fold.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Making your own event music
I'm still a bit confused here, as I am not really familiar with the music terminology. :p What exactly is a measure? Is it a drum beat sound? A certain length of time?

  

Offline Fry_Day

  • 28
Making your own event music
BPM is a way to measure tempo. It basically tells you how fast to play the music from notes. It's dependant on how you composed the music, not the destination file (Unless that file is a .mod, .s3m, .xm or .it).

 

Offline Killfrenzy

  • Slaughter-class cruiser
  • 210
  • Randomly Existing
Making your own event music
Quote
Originally posted by Sesquipedalian
Yes.  Made lots of stuff with it, such as this dark and trippy little number.  What has that to do with this topic, however?


Where can I get Fruty Loops?
Death has more impact than life, for everyone dies, but not everyone lives. [/b]
-Tomoe Hotaru (Sailor Saturn
------------
Founder of Shadows of Lylat

 

Offline Fry_Day

  • 28
Making your own event music
Fruity loops is commercial software that costs lots of money. Do what you always do, and go warez it.


Disclamer: The author of this message is in no way trying to evoke illicit activities. He is merely telling people to act the way the already do :)

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
Making your own event music
Now that you've implemented that play-music SEXP, will a track still have to be in the music tbl?

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Making your own event music
Dude, READ THE SEXP PAGE.  It tells you how to use it.

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
Making your own event music
I have, and it told me nothing.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Making your own event music
Hmm.  I guess it didn't address that.

No, any music played with play-sound-file does not need to be in music.tbl. :)

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
Making your own event music
YES!

 

Offline Killfrenzy

  • Slaughter-class cruiser
  • 210
  • Randomly Existing
Making your own event music
Ah, but does it play continuously? :D
Death has more impact than life, for everyone dies, but not everyone lives. [/b]
-Tomoe Hotaru (Sailor Saturn
------------
Founder of Shadows of Lylat

 
Making your own event music
Quote
Originally posted by TrashMan
Anyone ever tried Fruty Loops?


hehee shhhhhhhhhhh! your letting out the secret music program!

now ima have to redo the album....