Music Specs?

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
Kieve
Posts: 952
Joined: Tue Sep 18, 2012 2:21 pm

Music Specs?

Postby Kieve » Fri Dec 07, 2012 8:08 am

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?
shark
Posts: 173
Joined: Thu Nov 08, 2012 10:11 am

Re: Music Specs?

Postby shark » Fri Dec 07, 2012 8:16 am

Why not PM Justin about it? After all, he's the guy whose name you see all across the code.
Roses are #FF0000
Violets are #0000FF
All of our mods
are belong to you.
User avatar
Kieve
Posts: 952
Joined: Tue Sep 18, 2012 2:21 pm

Re: Music Specs?

Postby Kieve » Fri Dec 07, 2012 8:34 am

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.
boa13
Posts: 829
Joined: Mon Sep 17, 2012 11:42 pm

Re: Music Specs?

Postby boa13 » Fri Dec 07, 2012 9:33 am

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.
Forum janitor — If you spot spam, PM me the URL and/or the username of the spammer.
I have powers, moderator powers. I am not keen on using them, but will do so if needed.
thashepherd
Posts: 194
Joined: Fri Nov 16, 2012 11:45 pm

Re: Music Specs?

Postby thashepherd » Fri Dec 07, 2012 1:13 pm

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.
You are the weak, and I am the tyranny of evil men - but I'm trying, I'm trying real hard to be the shepherd.

"Wow, that Kieve guy is one angsty nerd eh."
Sonata - "Best use of Common Lisp in an indie space roguelike!"
User avatar
Kieve
Posts: 952
Joined: Tue Sep 18, 2012 2:21 pm

Re: Music Specs?

Postby Kieve » Fri Dec 07, 2012 3:53 pm

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.
thashepherd
Posts: 194
Joined: Fri Nov 16, 2012 11:45 pm

Re: Music Specs?

Postby thashepherd » Fri Dec 07, 2012 7:11 pm

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.
You are the weak, and I am the tyranny of evil men - but I'm trying, I'm trying real hard to be the shepherd.

"Wow, that Kieve guy is one angsty nerd eh."
Sonata - "Best use of Common Lisp in an indie space roguelike!"