Hi Nagual - I hadn't really noticed the custom music folders until you've asked!
[edit: corrected description of custom music after a better look/test of it]
The implementation is intending that you can drop one or more .mp3 file into each sub folder and it will then randomly play one of them.
The battle and docking folders are
supposed to be used when FFED3D wants to play the fight/docking music. It's simply checking for the track being index #21 for battle or #22 for docking. So this is unfortunate as it isn't actually context aware, and as there are actually only 17 music entries in any case! #15 is Ride of the Valkries, #16 Blue Danube.
[edit2] well having scoured the .asm and also checked back to the r16/17 FFED3D sources it seems that the 21/22 index values were deliberate - as FFE, with continuous music enabled, will select randomly from all of the music tracks. indices 21/22 are used to denote when the docking/combat music does reflect the situation rather than these tracks just being selected for play. This works for selecting the custom music, but I guess they forgot it'd break the standard music tracks as it's looking for track names in the array with invalid indices. I hadn't realised this before, due to not playing with music, as well as my PC soundcard and laptop breaking last summer. (thankfully both now fixed)
I've fixed the routine in the C code anyway to fall back correctly for tracks 21/22.
There are two more distinct scenarios that I've found - I think when you're promoted it'll play track #8 'paradise' and for an unidentified scenario it'll play track #17 'great gates of Kiev'. I could add new custom folders for these?
The station folder is intended to cover being docked at a star port as well as a space station. This attempted to check the player's state but it's checking the status value via an int data type rather than a byte - so this one generally fails as it erroneously picks up extra data in the value.
If the player isn't docked then any other tracks will attempt to play a song from the Space folder. Not what I'd expect either.
So in short, this feature is currently a load of
Meh!!!
It would be easy to correct/add status checks to see if the player actually is in combat, docking or landed/docked and play from the appropriate folder. I would at least go one step further though and extend the station to have separate folders to differentiate between open air star ports, subterranean bays and space stations. Maybe station types, system allegiance etc should be considered too! what do people think?
As far as samples go, there's only a limited set and reuse would probably be an issue as it stands. Their names are currently hardcoded into a 28-element array, much of which is mapped to the zero byte 'nowt.raw' and for example the wind noise 'airopen.raw' is defined in there 4 times. Whether any of the slots holding 'nowt.raw' are referenced, I've no idea - but given the state of the video tables, probably not. Unlike the video tables though, this one is held in the FFED3D C code so could probably be exposed for customisation at a later date.
If you wanted to replace a sample then it looks like they need to be saved in raw 16-bit PCM format and they're monophonic (1 channel) @ 22.05 kHz.