Music Modding

Music files need to be in .ogg format. Be careful not to upload copyrighted music or it may get taken down. You'll want to give your mod a copy of Resources/Sounds/composer.xnt, which tells the game when to play music and is somewhat complicated to understand.

composer.xnt est omnis divisa in partes tres:
 * 1) definitions. There is one for each intensity the game may call for, depending on how much action is happening at the time. Each of their subparts also check the intensity of the themes, percussions, or fills being played; it is possible to play high intensity sounds in low intensity compositions, if you want.  "numthemelayers" is used to figure out how many parts of sections should be playing at a given time; an example is , which says there is a 20 chance of zero low-intensity theme layers, a 20 chance of one, a 10 chance of two playing at once, and a 0 chance of more. These chances are weights; it doesn't matter what they add up to, only how they are relative to eachother, so something with a chance of 20 is equally likely to happen as another 20-chance thing, and twice as likely to happen as a 10-chance thing. If you only want one theme to be playing at a time, you'll usually want  , which will guarantee one low-intensity track will play at a time.  "numpercussionlayers" operates much the same way, but for percussion layers instead of theme ones. If your percussion layers are part of the same music file as your theme ones, you don't need it this part of and should probably just skip having them altogether.  "filltiming" is how frequently parts from get played;   means that low intensity fills will be played every 16 to 128 seconds.
 * 2) is used for filler noises that play every once in a while. They are sorted into the appropriate intensities and have a filepath and a duration saying how long they last in milliseconds.
 * 3) definitions. The sections are collections of sound files that get called on by the composer; when the composer asks for one or two themes, it picks a section then chooses themes from that section and that section only. Each section includes a looplength, which tells the composer how long in milliseconds to stay in that section, and a collection of themes and percussions, all of which have filepaths, durations, and weights influencing the odds of that particular theme getting picked after that section has.

It's a bit complicated and largely built to use multiple sound layers at once, but since I assume you only want to play a single file at a time, you don't need to know the whole thing, just have the composition have all its numthemelayers set to 0 1 and it'll only pull one file from the section at a time.