<?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>Adam Parrish &#187; python</title>
	<atom:link href="http://www.decontextualize.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.decontextualize.com</link>
	<description>decontextualize.com</description>
	<lastBuildDate>Thu, 09 Sep 2010 00:00:31 +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>Crazy Animal Stories Keyboard</title>
		<link>http://www.decontextualize.com/2010/08/crazy-animal-stories-keyboard/</link>
		<comments>http://www.decontextualize.com/2010/08/crazy-animal-stories-keyboard/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 15:23:39 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[hackday]]></category>
		<category><![CDATA[keyboards]]></category>
		<category><![CDATA[poetics]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=672</guid>
		<description><![CDATA[Last Saturday, Socialbomb held its first Hack Day.
I had two goals for Hack Day: (1) get a PS/2 keyboard talking to an Arduino and (2) make something interesting with processing.py. Here&#8217;s the end result (make sure to click through to the full-screen version for maximum legibility):

Crazy Animal Stories Keyboard from Adam Parrish on Vimeo.
It&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[<p>Last Saturday, <a href="http://socialbomb.com/">Socialbomb</a> held its first Hack Day.</p>
<p>I had two goals for Hack Day: (1) get a PS/2 keyboard talking to an Arduino and (2) make something interesting with <a href="http://github.com/jdf/processing.py">processing.py</a>. Here&#8217;s the end result (make sure to click through to the full-screen version for maximum legibility):</p>
<p><iframe src="http://player.vimeo.com/video/14364224" width="500" height="300" frameborder="0"></iframe>
<p><a href="http://vimeo.com/14364224">Crazy Animal Stories Keyboard</a> from <a href="http://vimeo.com/user479798">Adam Parrish</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>It&#8217;s the Crazy Animal Stories Keyboard, a keyboard which intermittently replaces whatever you&#8217;re typing with a Crazy Animal Story.</p>
<p>It turns out that the part of this project that I thought would be difficult turned out to be easy: getting a PS/2 keyboard talking to an Arduino was a piece of cake. I already had a bunch of mini-din connectors; I just soldered one up to a breadboard, hooked it up to my trusty Arduino Diecimila, put the excellent <a href="http://code.google.com/p/ps2keypolled/">ps2keypolled</a> library in my libraries folder, plugged in the keyboard and voila: keystrokes gettin&#8217; read.</p>
<div id="attachment_674" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.decontextualize.com/wp-content/uploads/2010/08/the-setup.jpg"><img src="http://www.decontextualize.com/wp-content/uploads/2010/08/the-setup-300x225.jpg" alt="" title="the setup" width="300" height="225" class="size-medium wp-image-674" /></a><p class="wp-caption-text">Here's what the setup looks like</p></div>
<div id="attachment_673" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.decontextualize.com/wp-content/uploads/2010/08/globby-solders.jpg"><img src="http://www.decontextualize.com/wp-content/uploads/2010/08/globby-solders-300x225.jpg" alt="" title="globby solders" width="300" height="225" class="size-medium wp-image-673" /></a><p class="wp-caption-text">globbiest solders since middle school</p></div>
<p>I&#8217;ve got big plans for the PS/2-to-Arduino data chain, involving a data logging chip and shoes made of keyboards and sledgehammers and/or yogurt. But for Hack Day, I just wanted to whip up something fun. So the next step was to get the keystrokes from the Arduino to my computer, preferably into a processing.py sketch. Much to my surprise, Processing&#8217;s serial communication libraries worked with processing.py without a hitch*, which left me free to write the tiny little generative text toy that you see in the video above.</p>
<p>The biggest unforeseen timesink: I spent a few hours trying to figure out the best way to send ps2keypolled&#8217;s 16-bit key codes from the Arduino to the computer, eventually settling on the stupidest possible ad-hoc protocol that could work (and porting a big chunk of C code to Python to translate the key codes to ASCII). See the source code for more details.</p>
<p>Most surprising happy discovery: processing.py is amazing. Being able to quickly write the text-munging code in Python while still retaining Processing&#8217;s built-in functions and easy-to-use libraries is just… a revelation. For a project that&#8217;s just a few weeks old, it feels surprisingly polished. If you&#8217;ve got Python and Processing expertise, I recommend you give it a go.</p>
<p>Source code for the whole shebang: <a href="http://www.decontextualize.com/wp-content/uploads/2010/08/crazy_animal_keyboard_source.zip">crazy_animal_keyboard_source.zip</a></p>
<p>Here&#8217;s a picture of Mr. Brendan Berg enjoying his time with the device, while I appear to be leering lecherously:</p>
<p><a href="http://www.flickr.com/photos/bentobox/4920566663/" title="20100821-IMG_1981 by doryexmachina, on Flickr"><img src="http://farm5.static.flickr.com/4118/4920566663_ea2d8d1be0.jpg" width="500" height="333" alt="20100821-IMG_1981" /></a></p>
<p><small>* Okay, there was a single hitch. Apparently, the serial communication library included with Processing (and, therefore, processing.py) doesn&#8217;t support 64-bit Snow Leopard (as documented e.g. <a href="http://www.arduino.cc/en/Guide/Troubleshooting#toc3">here</a>). I was able to get around this without problems by using the <tt>-d32</tt> parameter to the java runner, i.e.<br />
<code><br />
  $ java -d32 -jar processing.py animal_keyboard.py<br />
</code></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2010/08/crazy-animal-stories-keyboard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Poetry in the Post-Now</title>
		<link>http://www.decontextualize.com/2010/05/poetry-in-the-post-now/</link>
		<comments>http://www.decontextualize.com/2010/05/poetry-in-the-post-now/#comments</comments>
		<pubDate>Sat, 01 May 2010 18:49:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[poetry]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rwet]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=655</guid>
		<description><![CDATA[
Poetry in the Post-Now
Bowery Poetry Club
308 Bowery, New York, NY
May 8th, 2010, 12pm-2pm
This is going to be an amazing event. There will be performances, demonstrations, installations and readings from two ITP classes this semester: my Reading and Writing Electronic Text class and Nancy Hechinger&#8217;s Writing and Reading Poetry in the Digital Age.
This event is intended [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.decontextualize.com/wp-content/uploads/2010/05/Poetry-in-the-Post-Now-Poster.jpg" alt="" title="Poetry-in-the-Post-Now-Poster" width="464" height="600" class="aligncenter size-full wp-image-656" /></p>
<p>Poetry in the Post-Now<br />
Bowery Poetry Club<br />
308 Bowery, New York, NY<br />
May 8th, 2010, 12pm-2pm</p>
<p>This is going to be an amazing event. There will be performances, demonstrations, installations and readings from two <a href="http://itp.nyu.edu/">ITP</a> classes this semester: my <a href="http://rwet.decontextualize.com/">Reading and Writing Electronic Text</a> class and Nancy Hechinger&#8217;s Writing and Reading Poetry in the Digital Age.</p>
<p>This event is intended to be a showcase for the many text-, language- and poetry-driven projects at ITP, which are sometimes unsuited to the noisy glamor of the regular ITP show (<a href="http://itp.nyu.edu/shows/spring2010/">which you should also attend!</a>). I have been overwhelmed by the quality of student projects in both classes, and I&#8217;m excited to see them presented and performed.</p>
<p>A sampling of projects from my class: Ramones lyrics interpreted as code, Semaphore Hero, &#8220;tagrostics&#8221; (procedurally generated acrostics built from word frequency analysis), reading the Ramayana with regular expressions, procedurally generated Vogon poetry, poems composed by weather conditions, self-conversation mangled by Markov chains, physical interfaces for remixing movie subtitles, and more! It may not actually be possible for there to be a better way for you to spend your Saturday afternoon.</p>
<p><a href='http://www.decontextualize.com/wp-content/uploads/2010/05/Poetry-in-the-Post-Now-Poster.pdf'>Here&#8217;s the poster in PDF format.</a> Promotional materials designed by Ted Hayes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2010/05/poetry-in-the-post-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Curveship anticipation</title>
		<link>http://www.decontextualize.com/2009/07/curveship-anticipation/</link>
		<comments>http://www.decontextualize.com/2009/07/curveship-anticipation/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 20:18:28 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[interactivefiction]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=302</guid>
		<description><![CDATA[Nick Montfort starts posting about Curveship, his new interactive fiction development system. I&#8217;m very eager to see what he&#8217;s come up with.
New information to me: Curveship takes the form of a Python framework. Even if this were Curveship&#8217;s only innovation, it would still be a huge step forward. Imagine how much easier it&#8217;ll be to [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://nickm.com/post/2009/07/introducing-curveship/'>Nick Montfort starts posting about Curveship, his new interactive fiction development system</a>. I&#8217;m very eager to see what he&#8217;s come up with.</p>
<p>New information to me: Curveship takes the form of a Python framework. Even if this were Curveship&#8217;s only innovation, it would still be a huge step forward. Imagine how much easier it&#8217;ll be to prototype and author interactive fiction in a well-known, extensible and powerful language like Python, rather than learning a domain-specific language (Inform 6/7, TADS, etc.).</p>
<p>It looks like the framework&#8217;s main innovation, though, is that it inserts a layer of indirection between things that happen in the world&#8212;&#8221;actions&#8221;?&#8212;and the way those actions are rendered as text.</p>
<p>I&#8217;m excited to get my hands on it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2009/07/curveship-anticipation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
