<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code.random() &#187; demoscene</title>
	<atom:link href="http://code.pui.ch/category/demoscene/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.pui.ch</link>
	<description>Random code-snippets and tips</description>
	<lastBuildDate>Thu, 19 Jan 2012 07:09:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Turn demoscene modules into mp3s</title>
		<link>http://code.pui.ch/2007/02/18/turn-demoscene-modules-into-mp3s/</link>
		<comments>http://code.pui.ch/2007/02/18/turn-demoscene-modules-into-mp3s/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 17:39:11 +0000</pubDate>
		<dc:creator>philipp.keller</dc:creator>
				<category><![CDATA[demoscene]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://code.pui.ch/2007/02/18/turn-demoscene-modules-into-mp3s/</guid>
		<description><![CDATA[
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 [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 2em"><img src="/wp-content/upload/itunes_purple_motion.png" alt="iTunes screenshot of purple motions tracks"/><br />
tunes of purple motion turned into mp3s are playing in itunes</div>
<p>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..</p>
<div style="clear: right">&nbsp;</div>
<p><span id="more-6"></span></p>
<h2>short version for the impatient</h2>
<p>download <a href="/wp-content/upload/downloadmod.py">downloadmod.py</a> and <a href="/wp-content/upload/mod2mp3.py">mod2mp3.py</a> into /usr/local/bin/</p>
<div class="igBar"><span id="lcode-2"><a href="#" onclick="javascript:showPlainTxt('code-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-2">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; ">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo apt-get install xmp adplay unrar lame</div>
</li>
<li style="font-weight: bold;color:#26536A; ">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mkdir ~/modules/</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B; ">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">downloadmod.<span style="">py</span> ~/modules/ <span style="color:#CC0000;">"Purple Motion"</span></div>
</li>
<li style="font-weight: bold;color:#26536A; ">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mod2mp3.<span style="">py</span> ~/modules/ </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>First, get those modules</h3>
<p>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)</p>
<p>Afaik the most complete module resource is <a href="ftp://ftp.modland.com">modland</a>. 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.</p>
<p>To download all modules of a certain artist, I wrote a little <a href="/wp-content/upload/downloadmod.py">python script</a> 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.</p>
<p><code>downloadmod.py ~/modules/ &quot;Michael Land&quot;</code> 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.</p>
<p>Alternatively you can adapt a quick and dirty <a href="/wp-content/upload/downloadmod.sh">bash function</a>. 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.</p>
<h3>Then, convert those modules into mp3 files</h3>
<p>To convert the modules into mp3 files you usually take a module player and call with some special parameters in order to &quot;play&quot; the module into a wav-File and convert that wav into an mp3 file.</p>
<p>On linux, I'd suggest to install this module players (both exist as debian packages and work without hassle on my ubuntu installation)</p>
<ul>
<li><a href="http://xmp.sourceforge.net/">xmp</a> is *nix &quot;native&quot;</li>
<li><a href="http://adplug.sourceforge.net/">adplay</a> supports many adlib formats</li>
</ul>
<p>I wrote a <a href="/wp-content/upload/mod2mp3.py">python script</a> 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.</p>
<p>Just call <code>mod2mp3.py</code> 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.</p>
<p>If everything worked, you now should have mp3 files with correct id3 tags that can be imported into your amarok/itunes library.</p>
<h3>What about us windows users?</h3>
<p>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 <a href="http://www.modplug.com/playerinfo.html">modplug</a> and <a href="http://www.winamp.com">Winamp</a> with a <a href="http://www.winamp.com/plugins/details.php?id=132367">module player plugin</a> 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.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.pui.ch/2007/02/18/turn-demoscene-modules-into-mp3s/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

