ProffieOS7.x "Randomization of Selected Sounds" pre-alpha discussion

This allows for the randomization of selected sounds. This can be used for any effect but is especially important for Transition Sounds here: ProffieOS7.x "Transition Sounds" pre-alpha discussion

The Transition Sound is a selected sound, meaning the style code will select the exact sound file to play. In order to prevent monotony Fredrik has added this new way to randomize sounds.
If I set up a “Lightning” bolt sound, an explosion sound, a fireball sound, etc. for use in transition animations, the style code would select and play that sound by it’s number so say it’s:

tr000.wav for lightning
tr001.wav for explosion
tr002.wav for fireball

When I want the lightning sound to trigger the style code calls sound “0” (which = 000), for explosion it would call “1” and fireball it would call “002”. Now if I wanted to have multiple sounds for each to get more diversity in the sounds I would set up the tr sounds like so:

<root>
     tr/
          000/
                 000.wav
                 001.wav
                 002.wav
                 003.wav
                 004.wav
          001/
                 000.wav
                 001.wav
                 002.wav
                 003.wav
                 004.wav
          002/
                 000.wav
                 001.wav
                 002.wav
                 003.wav
                 004.wav
    

Then when the 0 sound is called the OS will randomly select from the 000.wav, 001.wav, 002.wav, 003.wav or 004.wav available.
NOTE: all sounds must have the same number of sub files or you will get an error in font directory.
This allows the style to pick the right sound but still have some randomization in what’s played.

3 Likes