Turn demoscene modules into mp3s

tunes of purple motion turned into mp3s are playing in itunes
If you were part of the demoscene in your former life, if you were and still are fond of modules (those sound files with the mod, xm, s3m, it, ... ending), if you are a linux user and if you still want to listen to this music on your computer without doing all the tweaks of installing (or even compiling) music player plugins for itunes or amarok or if you simply want to listen to Purple Motions tunes on your mp3 player then this little tutorial is for you. If not, then you won't have read that far anyway..
short version for the impatient
download downloadmod.py and mod2mp3.py into /usr/local/bin/
-
sudo apt-get install xmp adplay unrar lame
-
mkdir ~/modules/
-
downloadmod.py ~/modules/ "Purple Motion"
-
mod2mp3.py ~/modules/
First, get those modules
The first task is to get those modules onto your computer (as you most certainly deleted them - either per accident or when you were in needed of some space on your hard drive back when hard drives where small and expensive)
Afaik the most complete module resource is modland. The crux is that it's just an ftp site with deep directory structure and without a search facility. All it has got is a complete list of all the modules in a RAR file (which is kept up to date by a cron job) that holds a text file with all the available modules and their path.
To download all modules of a certain artist, I wrote a little python script that downloads the module list, unrars it, caches it for further search requests, searches for the artist and downloads all modules of that particular artist.
downloadmod.py ~/modules/ "Michael Land" downloads all Adlib songs of Michael Land and places them into ~/modules/Michael Land/ and writes some artist/album meta information into those newly created directories.
Alternatively you can adapt a quick and dirty bash function. It uses wget and is quite messy but it should do the task as well. You have to download and unpack the module list before you call the shell function.
Then, convert those modules into mp3 files
To convert the modules into mp3 files you usually take a module player and call with some special parameters in order to "play" the module into a wav-File and convert that wav into an mp3 file.
On linux, I'd suggest to install this module players (both exist as debian packages and work without hassle on my ubuntu installation)
I wrote a python script that converts the downloaded modules into mp3s using the just mentioned module players. You need at least xmp or adplay. If you install both, you'd be able to play about 90% of all modules.
Just call mod2mp3.py with your root module directory as argument and the script creates a mp3 file for each module that is convertible and isn't already converted. If you downloaded the modules with my download script, this script will use the meta information of the first script to write the id3 tags of the mp3s.
If everything worked, you now should have mp3 files with correct id3 tags that can be imported into your amarok/itunes library.
What about us windows users?
Sorry guys. I've got to let you down. One whole evening I tried to get any module player writing it's output to a wave file from the command line. I tried modplug and Winamp with a module player plugin but without luck. If you succeed, let me know. Up to then, just take a linux box, copy/download all modules there and let the box convert your modules over night and import it back into your iTunes player. That's what I did.
I'll fix the xmp portamento problem.
Hi Claudio. Wow, what an honor, I'm looking forward for the fix.
Humm, this one will be hard to fix. The problem is a dissonance caused by beating between the same sample playing in channels 6 and 7, after an "open" pitchbend effect F25 is used to change from a note to another (usually composers set the destination note and perform a tone portamento to that note instead of placing a note and then apply a pitch bending). Each channel seems ok when played alone, but together they generate that bad chord. This will require more research to see we can fix it without breaking other formats, but eventually we'll fix it. Thanks for noticing that, I added a comment in the s3m loader.
BTW xmp can be built in windows using cygwin. Sound output using winmm is broken at the moment, but file or wav output are ok. Try the current CVS version or 2.2.0-pre3.
Hopefully all pitch problems have been fixed in 2.5.0, and the windows port (stand-alone console-based player and winamp plugin) seems to be working well.
Claudio: Thank a lot! I removed the sentence from the post mentioning the flaw.