It's pretty simple, you just need to know what you are doing.
You need to create a map called Defs and in that a submap called SongDefs, then create a .xml file which contains the following lines :
Quote
<?xml version="1.0" encoding="utf-8" ?>
<SongDefs>
<SongDef>
<clipPath>track1</clipPath>
<volume>0.9</volume>
<allowedTimeOfDay>Day</allowedTimeOfDay>
</SongDef>
<SongDef>
<clipPath>track2</clipPath>
<volume>0.8</volume>
<allowedTimeOfDay>night</allowedTimeOfDay>
</SongDef>
<SongDef>
<clipPath>track3</clipPath>
</SongDef>
</SongDefs>
The 3 examples provided above all work, except in this particular case "track1" will only play during the day, "track2" will only work during the night, and "track3" is able to play no matter what. Do note, that in the examples above I played around with some variables. You can independantly increase or decrease the volume with the <volume></volume> tags, which should speak for itself, and the optional restriction of when it plays is controlled with the <allowedTimeOfDay></allowedTimeOfDay> tags.
At this stage, you've got the code, but you're not 100% done just yet. Now you need to include a Sounds map in your mod folder, which contains the new music tracks. Do note, in the clipPath you reference "track1" and not "track1.wav", referencing to the latter will give you an error.
Now all you need to do to have a working mod is to include a .wav file corresponding to the correct name in your Sounds folder and you should be good to go!
I might actually go ahead and write an "official" guide on this in the help section, because this was something that I myself struggled with for a good hour or so.