I've been thinking of this for a longer time. It would be an awesome change to the game if music would be more than just some level-specific background noise.
My idea: some new events. This might be overly complicated here, but even the basics of this functionality would give this game a nice boost in terms of earcandy.
Some music events could be used to set the music volume, change the speed (chances are this is easier to do with module music than with MP3's and the like, but I don't know exactly),... things like that.
Most importantly: a Change Music event. In my idea, it comes with parameters
TextID,
FadeStart,
FadeLength,
EndPosition and
Start Position.
It changes the music to the filename specified in the text field with ID
TextID, if that exists. TextID 0 should load the level's default music.
FadeStart specifies the event on which the fade of
FadeLength seconds should begin*. Note that this can also be 0 seconds, which in fact means the music changes instantly. Values of
FadeStart:
-0: as soon as the specified file is loaded
-1: at the first pattern jump (AKA position jump) or pattern end encountered after the specified file is loaded (or immediately if the played music format does not involve patterns)
-2: at the first pattern end encountered after the specified file is loaded (or immediately if the played music format does not involve patterns); pattern jumps do not trigger the transition
-3: when the end of the current music file is first encountered after the specified file is loaded
-4: when the cursor leaves the pattern in the
EndPositionst position in the current music's pattern order (or after
EndPosition*10 seconds from the beginning of a non-module file)
-5: when the cursor enters the pattern in the
EndPositionst position in the current music's pattern order (or after
EndPosition*10 seconds from the beginning of a non-module file)
-6: ?
-7: ? (stupid bitfields :/)
Finally,
StartPosition is the position in the pattern order of the specified music file where the new music would start. This may be useful if you've got multiple loops in the same module file. Again, if it's not a module file just skip the first
StartPosition*10 seconds.
Now imagine this. You enter one of those TOTALLY AWESOME GroundForce levels. A modified version of TSF's City1g.it begins to play (would be great if music could be downloaded off servers** too ;p but let's assume you have the modified file already). The first two patterns are played over and over again (position jump at the end of the second one...). It's this finger snapping intro.
Then, as you manage to wallclimb yourself into the wall and get transported to the waiting room, you pass the Set Music event: 0,4,0,1,2. As soon as the second pattern ends again, it starts playing the third (position #2, 0 based, you get it). At the end of 2, you go to 3, 3 to 4, 4 to 5 and the end of 5 points back to position 4. This waiting music is a little bit more interesting than this dull snap snap thingy.
Finally the 'starter' comes back from the toilet and everyone zaps into the playing field. Set Music: 0,4,0,5,6. Some guitarish thingy starts playing and the game has started. The end of position 15 jumps to position 6 (maybe the pattern at position 15 should be altered a bit to make this sound good).
As soon as you drop out, you move past another Set Music event: 0,0,0,0,16. This jumps directly to position 16. The end of the music begins. The last row of the last pattern (position 20) should point back to position 19 for a nice loop for the time being.
*If another Set Music event is touched before this, I think you'd best just cancel the first one.
**Download lag may be an issue as upload speeds are still making me sad. An external music file database server thingy would be a great alternative: after loading the level, JJ2 connects to this server and requests the music file/s specified in the level file. The ones present on the server are then downloaded. But this is getting way too complicated.