Page 1 of 1
Music Specs?
Posted: Fri Dec 07, 2012 8:08 am
by Kieve
Question for the devs:
-What are the music specifications the .OGG files are saved with? I've tried exporting several times in various bit-rates with no success. That is, everything packs up just fine, but when it comes time to play the music, the game's just silent.
For anyone else:
-Has anyone tried adding in new music, and did you have any luck getting it to play?
Re: Music Specs?
Posted: Fri Dec 07, 2012 8:16 am
by shark
Why not PM Justin about it? After all, he's the guy whose name you see all across the code.
Re: Music Specs?
Posted: Fri Dec 07, 2012 8:34 am
by Kieve
shark wrote:Why not PM Justin about it? After all, he's the guy whose name you see all across the code.
Eh, I could, but it was an open question.
And while I was replying, I did get it functional - apparently, it's less about file spec than file
name - I simply renamed mine from krs_MUS_IncursorTheme.ogg to the main-title filename, and it worked just fine. I'd still like to know the file specs for export, just to be consistent with the existing tunes, but I have for the moment solved my own issue. Yay me?
EDIT:
-Further analysis shows "bp_MUS_" prefix is all you really need for the title. Haven't gotten so far as to find out whether the EXPLORE/BATTLE all-caps suffixes are equally necessary, but for anyone else doing music I'd recommend it anyway for consistency's sake.
Re: Music Specs?
Posted: Fri Dec 07, 2012 9:33 am
by boa13
Considering FTL uses the standard Ogg Vorbis library, I would be surprised if it had an issue with the file format. As long as it is a standard Ogg Vorbis file (whatever the bitrate), it should work just fine.
Re: Music Specs?
Posted: Fri Dec 07, 2012 1:13 pm
by thashepherd
Kieve wrote:Question for the devs:
-What are the music specifications the .OGG files are saved with? I've tried exporting several times in various bit-rates with no success. That is, everything packs up just fine, but when it comes time to play the music, the game's just silent.
For anyone else:
-Has anyone tried adding in new music, and did you have any luck getting it to play?
Yeah, you can throw .mp3, .oggs, .wavs, whatever at it and it'll play it - you load the file in sounds.xml and then you have to attach it to a sector in sectordata. Added a new soundtrack for Sonata 7; the process was surprisingly sane.
The only weird thing is that a given "explore" and "battle" theme are tied together and sort of treated as one track (it mixes between them as you go in/out of fights). If one is longer than the other, you can get a few seconds of silence at the end.
EDIT: What I'm saying is that you don't need to stick to the vanilla naming scheme (and probably shouldn't, to distinguish your custom files) - use sounds.xml to control what is loaded. It's probably pretty clumsy just to replace the stock music with something with the same filename.
Re: Music Specs?
Posted: Fri Dec 07, 2012 3:53 pm
by Kieve
thashepherd wrote:What I'm saying is that you don't need to stick to the vanilla naming scheme (and probably shouldn't, to distinguish your custom files) - use sounds.xml to control what is loaded. It's probably pretty clumsy just to replace the stock music with something with the same filename.
Maybe not entirely, but my main title didn't work until I renamed it to bp_MUS_ so there seems to be at least a little going on under the hood, beyond what we see in Sounds.xml. I do agree about full-on replacement though, that's generally to be avoided wherever possible.
Also, good info on the track lengths, I didn't realize they needed to be the same duration.

Will definitely need to keep it in mind.
Re: Music Specs?
Posted: Fri Dec 07, 2012 7:11 pm
by thashepherd
Kieve wrote:
Maybe not entirely, but my main title didn't work until I renamed it to bp_MUS_ so there seems to be at least a little going on under the hood, beyond what we see in Sounds.xml. I do agree about full-on replacement though, that's generally to be avoided wherever possible.
Also, good info on the track lengths, I didn't realize they needed to be the same duration.

Will definitely need to keep it in mind.
The game actually covers for it pretty well - you just get a few moments of silence at the end of a track, NBD and usually barely noticeable.
I'm not sure why you're having issues with the title; it went smoothly for me (and feel free to check out my code base
here if you want an example in context).
Basically: track is proteus_fading.ogg. Code in sounds.xml.append:
Code: Select all
<music>
...
<track>
<name>title</name>
<explore>proteus_fading.ogg</explore>
</track>
...
</music>
That's all you need for the title track; obviously you need to assign other tracks to a particular sector. For example:
//sounds.xml.append
Code: Select all
<music>
...
<track>
<name>laststand3</name>
<explore>barkley_jam.mp3</explore>
</track>
...
</music>
//sectordata.xml
Code: Select all
<sectorDescription name="FINAL" minSector="7" unique="true">
...
<trackList>
...
<track>laststand3</track>
</trackList>
...
</sectorDescription>
You can add several tracks to the tracklist, but (as with most lists in Sonata) it seems like it'll pull the first one first most of the time. Just to re-iterate, this code is in-game and working.
EDIT: Realized that may have not been the best example since the "Last Stand" tracks just have <explore/> but most tracks have <explore/> and <battle/> - should give you the right idea tho. BTW, Kieve - since you have this secret project and all - I just found out that it's easy to modify 1. the projectile crews shoot when they're fighting on a ship and 2. the sound it makes. Also, it seems like you can come pretty close to enforcing a specific sector progression using a combination of minSector, maxSector (which MIGHT work - haven't tested, but the tags are used elsewhere), and unique=true. Just some tricks I've found.