yummy wrote:Yup, usually, the workaround is to chop your file into multiple parts, one being the intro, then the looping parts which will loop endlessly.
The other workaround would be to put two audio files, playing on different sound channels, with blank fillers in between.
Actually, I remember playing few visual novels that had elaborate soundtracks, than didn't seem to be your usual one-piece files. After meedling a bit with the game's archieves you could see them as a whole bunch of small chunks that are then played and manually sequenced within the game code in a proper order. It's just a matter of a clever music composition and using such parts in this kind of way would be possible as it is now in Ren'Py without any problems. Many games use such music playing systems, because it enables to create a more atmospheric feeling and allows the music to change dynamically in-game using various variables.
The other way would be to program a code in Python that would manage to split the music file into parts (by looking up to the time), and then replay them. I'm sure this would be somehow possible with a bit of external coding.
As far as I can remember, most of the tracker music formats, such as .mod, .it, .xm and .s3m uses a clever way to play the music. While the normal files are digitally-encoded sound files, tracked music files are composed of bits called sound samples and instruments that are split over different tracks and music patterns along with tempo, notes and effects that tell the sequencer how to play them. Then, everything is played via the so-known master list. It was quite interesting, because you could leave some options that told the sequencer to replay some of the patterns few times before the music would progress, or even add some additional ones after the song ends, allowing the whole file to be practically a bunch of few music pieces tied together with same samples (allowing to create rearrangements). Many older games (such as Unreal) used those formats because of that (they were also small in filesize and didn't need a lot of processing power.
On the other side, it would be interesting to see a plugin for Ren'Py that would allow to play mod's and manage some of their basic functions, but I remember PyTom said once that it would be propably too much work to get it running, and the results would be impractical compared to using modern file formats, such as .ogg or .mp3. The downside to tracked music is that most of them sound quite synthetic (most of them run on 8bit file samples) and there's a limit on how much patterns and loops you can use. While it is possible to create high quality music on screamtracker or even protracker, those programs are plain old and would have to use some really HQ music samples, which are quite big (600kb-1,2mb, 1,5 mb filesizes) and make everything nonsense (these music types were created mainly for the purpose of having quite long music pieces that are small in filesize). People were able to squeze a decent sounding 3:45-5 minute long music into 300-600kb, while the same file encoded as a sound in an .mp3 or .ogg would have a filesize of at least 3-5 megabytes in 128 kbps and having a higher quality even doubles their filesize. Anyway, it's good when you want to have an real retro-feel to your game (almost every old game, starting from C64 had simple tracked music, it was only after modern PC's were born enabling to use a more rich and powerful sound encoding.
Those that are interested in tracking music nowadays with good results, can take a look at Madtracker. It's the most modern and powerful music tracker and while the basics of it's working principles remain the same as his older counterparts, it can use high quality sound samples and instruments and make use of VST plugins, enabling the composer to create music no different in quality from those created on other kinds of music sequencers. It's a good beggining to those, who want to start with music composing.