<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.6" -->
<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/"
	>

<channel>
	<title>The Stoic Monkey</title>
	<link>http://www.stoicmonkey.com</link>
	<description>cogitating, reasoning, flinging poo</description>
	<pubDate>Fri, 03 Oct 2008 05:27:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.6</generator>
	<language>en</language>
			<item>
		<title>Fisheye lens photo without a fisheye lens</title>
		<link>http://www.stoicmonkey.com/2007/02/fisheye-lens-photo-without-a-fisheye-lens/</link>
		<comments>http://www.stoicmonkey.com/2007/02/fisheye-lens-photo-without-a-fisheye-lens/#comments</comments>
		<pubDate>Sun, 11 Feb 2007 07:42:28 +0000</pubDate>
		<dc:creator>S. Monkey</dc:creator>
		
		<category>photography</category>

		<guid isPermaLink="false">http://www.stoicmonkey.com/2007/02/fisheye-lens-photo-without-a-fisheye-lens/</guid>
		<description><![CDATA[Today I experimented with a program called hugin to create a fisheye lens effect by stitching together seven separate photos.  Here&#8217;s a picture of my music studio.  That&#8217;s Chico on the lower right.


]]></description>
			<content:encoded><![CDATA[<p>Today I experimented with a program called <a href="http://hugin.sourceforge.net/">hugin</a> to create a fisheye lens effect by stitching together seven separate photos.  Here&#8217;s a picture of my music studio.  That&#8217;s Chico on the lower right.<br />
<img width="500" src="http://stoicmonkey.com/img/myStudio2.png" alt="" />
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoicmonkey.com/2007/02/fisheye-lens-photo-without-a-fisheye-lens/feed/</wfw:commentRss>
		</item>
		<item>
		<title>GPL&#8217;d VROOM!!! for Linux</title>
		<link>http://www.stoicmonkey.com/2007/01/gpl-vroom-for-linux/</link>
		<comments>http://www.stoicmonkey.com/2007/01/gpl-vroom-for-linux/#comments</comments>
		<pubDate>Tue, 16 Jan 2007 19:06:21 +0000</pubDate>
		<dc:creator>S. Monkey</dc:creator>
		
		<category>programming</category>

		<category>python</category>

		<category>game development</category>

		<category>vroom</category>

		<guid isPermaLink="false">http://www.stoicmonkey.com/blog/2007/01/vroom-for-linux-released-under-gpl/</guid>
		<description><![CDATA[By popular demand I released a pared down version of VROOM for Linux under the GPL so people can study and modify it.  The internet scores part has been stripped out because that would make it way too easy to cheat.  I&#8217;ve been meaning to enhance it to use a fixed time step [...]]]></description>
			<content:encoded><![CDATA[<p>By popular demand I released a pared down version of <a href="http://www.stoicmonkey.com/2007/01/vroom/">VROOM</a> for Linux under the <a href="http://www.gnu.org/licenses/gpl.txt">GPL</a> so people can study and modify it.  The internet scores part has been stripped out because that would make it way too easy to cheat.  I&#8217;ve been meaning to enhance it to use a fixed time step as <a href="http://www.gaffer.org/game-physics/fix-your-timestep/">described here</a>.  If someone succeeds at this before I get around to it please let me know.</p>
<ul>
<li><a href="http://stoicmonkey.com/vroom/vroomDemo.tar.gz">Download vroomDemo.tar.gz</a> (for i686 GNU/Linux)
</ul>
<p>This version includes a new feature.  The engine sound revs much more smoothly.  I made a couple of tweaks to the SDL_mixer and Pygame code to make this work.  I&#8217;ll try to cover the details soon.</p>
<p>To run, you&#8217;ll need to set an environment variable so Pygame will pick up the new SDL_mixer library:</p>
<blockquote><pre>% tar -xzvf vroomDemo.tar.gz
% cd vroomDemo
% setenv LD_LIBRARY_PATH ./sdl_mixer
% python vroomDemo.py</pre>
</blockquote>
<p>If the setenv LD_LIBRARY_PATH trick doesn&#8217;t solve the &#8220;undefined symbol&#8221; error, you can try patching, compiling, and installing SDL_mixer.  Here are the patch files for SDL_mixer-1.2.4:</p>
<ul>
<li><a href="http://stoicmonkey.com/wp/code/sdl_patch/mixer.c.diff">mixer.c.diff</a> (v1.2.4)
<li><a href="http://stoicmonkey.com/wp/code/sdl_patch/SDL_mixer.h.diff">SDL_mixer.h.diff</a> (v1.2.4)
</ul>
<p>For SDL_mixer-1.2.7 you&#8217;ll need these:</p>
<ul>
<li><a href="http://stoicmonkey.com/wp/code/sdl1.2.7patch/mixer.c.diff">mixer.c.diff</a> (v1.2.7)
<li><a href="http://stoicmonkey.com/wp/code/sdl1.2.7patch/SDL_mixer.h.diff">SDL_mixer.h.diff</a> (v1.2.7)
</ul>
<p>Enjoy.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoicmonkey.com/2007/01/gpl-vroom-for-linux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python CSound Drum Machine</title>
		<link>http://www.stoicmonkey.com/2007/01/python-csound-drum-machine/</link>
		<comments>http://www.stoicmonkey.com/2007/01/python-csound-drum-machine/#comments</comments>
		<pubDate>Mon, 15 Jan 2007 23:28:19 +0000</pubDate>
		<dc:creator>S. Monkey</dc:creator>
		
		<category>programming</category>

		<category>music</category>

		<category>python</category>

		<category>csound</category>

		<guid isPermaLink="false">http://www.stoicmonkey.com/2007/01/python-csound-drum-machine/</guid>
		<description><![CDATA[Here&#8217;s something I whipped up late one night.  It&#8217;s a simple drum machine in Python.  The script reads formatted text that describes drum patterns then invokes CSound to create the track.  Check out the script.
Below is the score to the first few measures of a Zigzags song called Icecream Sandwich.  (Full [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s something I whipped up late one night.  It&#8217;s a simple drum machine in Python.  The script reads formatted text that describes drum patterns then invokes CSound to create the track.  Check out the <a href="http://stoicmonkey.com/wp/code/drumMachine.py">script</a>.</p>
<p>Below is the score to the first few measures of a Zigzags song called <em>Icecream Sandwich</em>.  (Full score is <a href="http://stoicmonkey.com/wp/code/icecream.txt">here</a>.)  The first section defines the patterns named p0, p1, p2, and p3.  The second section puts the patterns together to form the song.  The numbers in the pattern tell the program to play a drum at a particular volume (1 softest to 0 loudest).  A period tells the program to sustain the note for a specific length of time (otherwise the note will sustain until the sample is finished).  The vertical &#8216;|&#8217; character is ignored and can be used as a visual aid to separate ticks into measures.  The character string &#8220;b222 t4&#8243; tells the program that the succeeding section is 222 beats per minute, with 4 ticks (i.e. dashes) per beat.</p>
<blockquote><pre>
p0
stick 8---|6---|4---|2---

p1
kick  9---|--8-|--7-|----
snare ----|6---|----|6---
chh   ----|7---|7---|7---
crash 7---|----|----|----

p2
kick  9---|--8-|--7-|----
snare ----|6---|----|6-4-
chh   7---|7---|7---|7---
crash ----|----|----|----

p3
kick  --8-|--8-|--8-|--8-
snare 6---|6---|6---|6---
ohh   6...|6...|6...|6... 

end
#####################
b222 t4 

p0
p1 p2 p1 p2
p1 p2 p1 p3
</pre>
</blockquote>
<p>Here&#8217;s a very lo-fi recording of <em>Icecream Sandwich</em> (minus the bass guitar) which uses a drum track created with this program:</p>
<ul>
<p><embed src="http://www.stoicmonkey.com/audio/xspf_player_slim2.swf?idx=IceCream&#038;" quality="high" name="xspf_player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" align="center" height="20" width="400"></embed></p>
</ul>
<p>(Don&#8217;t know why my computer mic squeals like that but my punk rock side doesn&#8217;t care.)</p>
<p>Since writing the drum machine code I&#8217;ve enhanced the sound code in VROOM and realized I could easily extend the drum machine code to use the Pygame mixer module instead of CSound.  One advantage to using CSound, though, is that it&#8217;s pretty straight forward to do additional processing.  For example, check out the file foo.orc, the CSound orchestra file that I used.</p>
<blockquote>
<pre>; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
kamp = 200*p5
; If you don't know the frequency of your audio file,
; set both the kcps and ibas parameters equal to 1.
kcps = 1
; ifn = 1
ifn = p4
ibas = 1

a1 loscil kamp, kcps, ifn, ibas
a2 lowres a1, 5*p5^1.5, 0.2
out a2
endin</pre>
</blockquote>
<p>It applies a low pass filter to the sampled waveforms, with a volume-dependent cutoff frequency.  This results in  a more realistic sound since drums have more high-end when struck harder.  Of course, nothing can replace real drums.  I wrote this code mostly for tempo practice and sketch recordings.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stoicmonkey.com/2007/01/python-csound-drum-machine/feed/</wfw:commentRss>
<enclosure url='http://stoicmonkey.com/audio/otherSingles/icecreamPractice.mp3' length='3323070' type='audio/mpeg'/>
		</item>
		<item>
		<title>VROOM!!!</title>
		<link>http://www.stoicmonkey.com/2007/01/vroom/</link>
		<comments>http://www.stoicmonkey.com/2007/01/vroom/#comments</comments>
		<pubDate>Mon, 15 Jan 2007 02:51:30 +0000</pubDate>
		<dc:creator>S. Monkey</dc:creator>
		
		<category>programming</category>

		<category>python</category>

		<category>game development</category>

		<category>vroom</category>

		<guid isPermaLink="false">http://www.stoicmonkey.com/blog/?p=5</guid>
		<description><![CDATA[
I wrote this game in my spare time in 2003 on a IBM T23 laptop running Linux. I used the Python language because it&#8217;s fun, and I wanted to see if it would perform well. It did, especially after enlisting the help of Psyco and Pyrex. 
Too often game developers emphasize visuals like texture maps [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.stoicmonkey.com/img/screenshotSm2.png" alt="" /><br />
I wrote this game in my spare time in 2003 on a IBM T23 laptop running Linux. I used the <a href="http://www.python.org">Python</a> language because it&#8217;s fun, and I wanted to see if it would perform well. It did, especially after enlisting the help of <a href="http://psyco.sourceforge.net/">Psyco</a> and <a href="http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/">Pyrex</a>. </p>
<p>Too often game developers emphasize visuals like texture maps and high polygon count at the expense of gameplay. I took the contrarian approach using the minimalist style of old school vector graphic games to let the gameplay stand on its own.</p>
<p>To approximate the effect of vector graphics I used the antialiased line drawing algorithm found on <a href="http://freespace.virgin.net/hugo.elias/">Hugo Elias&#8217;s website</a>. I fixed a minor bug that caused some uneveness to lines arranged head to tail and sent the code to the Pygame folks.  Writing this game was much easier thanks to the <a href="http://www.pygame.org">PyGame</a> library and the library upon which it is built, <a href="http://libsdl.org">SDL</a>.</p>
<p>Besides writing the antialiased line functions, challenges included designing code for compiling bi-space partitioning (BSP) trees from an SVG representation of the track, modeling car dynamics with physics routines, and figuring out how to package everything into a windows installer. For kicks I added a mode where you can play the game in 3D using red &#038; blue glasses. </p>
<ul>
<li><a href="http://www.stoicmonkey.com/vroom/VROOM_setup.exe">download VROOM!!!</a> (for Windows)</li>
</ul>
<p>These are actual user comments: </p>
<blockquote><p>&#8220;an addicting game&#8221; </p>
<p>&#8220;I like the track designs. Physics are very fun, power oversteer at will. Playing in Virtual Boy mode brought back some memories of&#8230;what was it&#8230; Red Alarm.&#8221; </p>
<p>&#8220;that game is awesome..but my fingers hurt now.&#8221; </p>
<p>&#8220;cool game. very addicting&#8230;and frustrating at the same time (when i hit a wall)&#8221; </p>
<p>&#8220;Damn that&#8217;s fun!&#8221; </p>
<p>&#8220;Simplicity at its finest!&#8221; </p>
<p>&#8220;OK&#8230;.I&#8217;m addicted&#8221; </p>
<p>&#8220;My eyes burn&#8221; </p>
<p>&#8220;Most addictive game&#8230;evar.&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.stoicmonkey.com/2007/01/vroom/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

