Revisiting some DOS games of old...
I've been playing old PC DOS shareware games lately in DOSBox
, and one of the most nostalgic aspects of this is always the music (of course ;).
So, I've been playing Alien Carnage
, also known as Halloween Harry. I found that I still knew the melodies (if not the exact sound of the instruments) despite the fact that I had last heard them over 10 years ago. The music was composed by George Stamatiadis
, with the title theme done by Steven Baker
; the latter also composed the soundtrack for Mystic Towers
, another Apogee game with great atmospheric music (and a killer main menu theme).
I also happened upon Brudal Baddle
, a not-so-great fighting game which I nonetheless remembered from the same mid-90s era, and first tracked down the soundtrack files
, then, unexpectedly, the composer's website (with downloads and original track titles)
. The artist goes by The Finn
for these tracks.Encoding to MP3 with GStreamer
Eventually, I wanted to have this music extracted and playable in mpd (my music player of choice). But how? After some googling, I found a starter's guide to GStreamer
, from which I picked up the following command:
gst-launch filesrc location="INPUT_FILE_HERE" ! decodebin2 ! lame quality=3 vbr=4 ! filesink location="OUTPUT_FILE_HERE"
I tried this on a .MOD file, and it worked! I'm not sure whether the ability to decode MODs is provided by a specific plugin, though; I have the Good, Bad and Ugly plugins installed for GStreamer.
Anyway, typing/pasting a long command like that for every single file would be tedious, so I adapted it as a shell script, which I saved as tomp3.sh:
gst-launch filesrc location="$1" ! decodebin2 ! lame quality=3 vbr=4 ! filesink location="$2"
The $1 and $2 variables are replaced at execution time with the first and second arguments passed to the script, respectively. So, I can convert FOO.MOD to BAR.MP3 by running:
./tomp3.sh FOO.MOD BAR.MP3
However, I still wasn't satisfied, as I was too lazy to even run this for every single file. So I made a simple loop to run the script for all the .MOD files in the current directory, like this:
for a in `dir *.MOD`;do;sh tomp3.sh $a $a.mp3;done
It's not perfect; for FOO.MOD, it'll produce a file named FOO.MOD.mp3. But that can be solved by using sed to substitute ".mp3" for ".MOD" in the second argument, like so:
for a in `dir *.MOD`;do;sh tomp3.sh $a `echo $a|sed s/\\.MOD/.mp3/`;done
This'll take FOO.MOD and produce an output file named FOO.mp3, which is about as far as I'd go in terms of nitpicking about these filenames.
After that, I opt to grab a medium- or large-sized image of the game's box art, crop out a 300x300 region (or, at least, the largest square region possible from the source image), and use that as the "album cover" image. Just for completeness.Note: In these example commands, I wrote gst-launch. However, on my particular system, this app was installed as gst-launch-0.10. Your setup may vary.