SSPLAYER: The System Shock Random Song Generator

----BEGIN TRANSMISSION----

Ever wanted a program that could play the XMI files from System Shock 1 and produce a random song?
Well then, this is your lucky day. Introducing The System Shock Random Song Generator.

Introduction

Back in the middle of 2000 I created a XMI file reader for Exult (The open source Ultima 7 and U7 part 2 engine). Being such a huge fan of System Shock (and it's music) I decided to adapt what I had done for Exult into a prgram that would directly read the XMI files from System Shock. You might ask, "Why bother, there are already MIDs and MP3s out there of the songs?" Well, there are three reasons.

Reason 1: Markus Hein's XMI2MID doesn't correctly convert XMIs to MIDs. The speed is incorrect. Sometime it can be too slow, but most of the time the songs are too fast. This has been bugging me for years. The most obvious songs that gets effected by this problem are THM6 and THM4 which are considerably faster than they are in the game. If you've got a savegame from the Security level or the Bridge go into the game, load either of the two levels, quit and compare to any of the mixes of THM6 out there. Notice that the mixes play way too fast. However, my converter does convert the speed correctly. It had too.

Reason 2: Generally all of the mixes out there have modified instruments. While this may be not actually be a bad thing, is still doesn't accuractly reflect what went on in the game.

Reason 3: System Shock was fairly unique with it's dynamic music system, and IMO the only way to truely listen to the music would be to reflect how the game plays the music. That is, differently every time.

Really, the reason to do this really were only number three, but the other 2 are also important.

Features

  • It Randomly Generates Songs From System Shock
  • It can also play XMI, MID or RMI files and follows XMI for/loop controllers.
  • It Has a cool note visulization display.
  • Can Extract sequences out of XMI files and write them to MIDI files
  • Can play and convert MIDI's that use the MT32 Capital Tone Patch Set to General Midi
  • It Is Open Source (GPL)
  • Download SSPLAYER

    SSPLAYER is based off of source from Exult, a GPL Application. This means SSPLAYER is also a GPL Application. You can view the license here.

    System Shock Random Song Generator Version 1.0

    Binary
    ssplayer10.zip 55KB.
    Includes RSG Files for System Shock

    C++ Source
    ssplayer10_source.zip 36KB.
    Includes Project Workspace for MSVC++ 6

    In order to play the RSG files included in the SSPLAYER ZIP, you will need to copy the XMI files from your System Shock SOUND\GENMIDI directory (or SOUND\SBLASTER if you only have a FM synthesizer) to the directory where the RSG files are (where SSPLAYER was unzipped to).

    Screenshots

    SSPLAYER in Windows 98

    SSPLAYER in Windows 2000 with 129 Character Wide Console

    SSPLAYER in Windows 2000 with Scrolling Note Display in a 110 Character Wide Console

    Program Usage

    SSPLAYER can be executed like a normal Windows program or it can be run from a DOS Box or command line.

    Remember, If you want to play a RSG file, you will need to copy the XMI file of the same name from your System Shock SOUND\GENMIDI directory (or SOUND\SBLASTER if you only have a FM synthesizer) to the same directory as the RSG file.

    If just double clicked a console window will open and you will be prompted for a filename. This screenshot is an example output. What you get will probably look a bit different.

    If the filename is a RSG file you will be prompted for the length of the song to generate. The length of the song is in sequences. Generally each sequence is about 10 seconds long.

    Next you will be prompted for a seed value. The seed value is used to set up the random number generator. Entering the same seed number will generate the same song everytime.

    Once all that is done, your song should be playing and you'll have something that looks like this.

    However, if you entered a MID, RMI, or a single sequence XMI things are a bit different. You wont be prompted for any more information and the song will begin playing. When playing one of these types of files, the song will repeat infinitely. XMIDI for/loop controllers will be followed, which means that some songs may not play as you'd expect. Try out end.xmi and hear what happens.

    If the file specified was actually a multiple sequence XMI, you will be asked for the sequence number to play. It must be noted, some sequences in the XMI may not actually play anything.

    SSPLAYER will now begin playing the Sequence you entered in the XMI file.

    SSPLAYER can also accept a variety of command line options. Here are the command line options that can be used.

    SSPLAYER  (filename.rsg (length (seed_value)))
    or
    SSPLAYER  (filename.mid/rmi)
    or
    SSPLAYER  (filename.xmi (sequence_number))
    
    Options:
    
    -?, -h, -h      - Displays this Information
    
    -width=val      - Sets the visulization width to val. This value should be
                      smaller than the width of the Window. If the value is the
                      same or larger than the window width, the visulization will
                      scoll. This defauls to 79.
    
    -visulize=val   - Sets the visulization update value to this count per quarter
                      note. The Default Value is 8 update per quarter note.
    
    -drum           - Enable visulization of the drum track.
    
    -hide           - Disable all Visulization.
    
    -mt32           - Convert Songs that use Captial MT32 Tones to General MIDI
    
    -extract        - Extract the Sequence from the File. This option does not work
                      with .RSG files
    
    -extractall     - Extract all Sequences from the File. This option does not work
                      with .RSG files
    
    NOTE that all options must begin with - and must be in lowercase
    
    If the filename, length, seed value or sequence number are not specified you
    will be prompted for them. 
    

    The two extract command line options are used to extract sequences from XMI files. They can also be used to do MT32 patch conversions of MID and RMI files. The output filename will be of the format filename-XX.mid where xx is the sequence number.

    It is not advised to use the -mt32 option unless you are actually listening to a file that uses MT32 patches. The results will be quite strange otherwise. The MT32 option will NOT work properly with songs that used custom MT32 Timbre's. Quite a few games used custom Timbre's and there is no real way of knowing if a game did or didn't. Results may be mixed.

    Known Problems

  • The UI of SSPLAYER is pretty terrible. In fact it doesn't have one. It's just a Windows console application, and once it starts playing, it will continue to play until it finishes, you force quit it, or you press Ctrl-C.
  • It doesn't play secondary and tertiary sequences like the original did. This include the playing of transitional sequences. Eventually this problem will be fixed in a future version.
  • Sometimes the program seems to just keep playing the same sequences over and over again. In the future I'll probably put in code to force a transition to a different sequence if the program detects that a certain sequence is being played too much.
  • Part linkages sometimes sound quite bad, or just sound strangely wrong. This is mostly due to me ignoring some musical considerations when programming. The songs pretty much require that the parts occur in pairs. Currently I've ignored this rule. The next version of SSPLAYER will have this problem fixed.
  • Other Stuff

    Associate RSG files to SSPLAYER in Windows. Assuming that no other program has accociated .RSG files, Right Click on a RSG file, choose "Open With", then choose SSPLAYER as the wanted application you want to use to play the RSG files. Make sure you also check "Always Use This Program to open these files." You may also want to associate XMI files to SSPLAYER as well.

    Just for fun play some songs with MT32 conversion enabled (-mt32 option on the command line). It sounds VERY different to normal. Doesn't always sound too bad either.

    There was one command line option that I didn't reveal above. It's the -create option. It's used to create RSG files. I'm not going explain how to use the creator because the format will be changing with the next version. All I will say is it can not be used with any of the other command line options and filename should not be specified. If a filename is specified, the file is a textfile and is used as the input for all the values. I don't advise on doing this. The denoter requested is the file to write without the extension. Remember the RSG and the XMI MUST have the same name. The creator WILL overwrite existing files without warning. I very much do not recommend using the creator.

    ----END TRANSMISSION----

    Return To The Colourless System Shock Page