<?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>Stefan Goodchild &#187; Launchpad</title>
	<atom:link href="http://stefangoodchild.com/tag/launchpad/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefangoodchild.com</link>
	<description>Old Enough To Know Better</description>
	<lastBuildDate>Wed, 18 Aug 2010 10:43:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Novation Launchpad &#8211; Note number to XY Coordinates and back again.</title>
		<link>http://stefangoodchild.com/journal/2009/11/novation-launchpad-note-number-to-xy-coordinates-and-back-again/</link>
		<comments>http://stefangoodchild.com/journal/2009/11/novation-launchpad-note-number-to-xy-coordinates-and-back-again/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:17:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Interactive]]></category>
		<category><![CDATA[Launchpad]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://stefangoodchild.com/?p=354</guid>
		<description><![CDATA[First thing I did with my new Launchpad? Nope, I didn&#8217;t hook it up to Live and jam. I hooked it up, fired up Processing and worked out how to light up the pads and recieve the notes so I could hack it to do anything I wanted&#160;to. One thing I noticed straight off the [...]]]></description>
			<content:encoded><![CDATA[<p>First thing I did with my new <a href="http://www.novationmusic.com/products/midi_controller/launchpad">Launchpad</a>?  Nope, I didn&#8217;t hook it up to Live and jam.  I hooked it up, fired up <a href="http://processing.org/">Processing</a> and worked out how to light up the pads and recieve the notes so I could hack it to do anything I wanted&nbsp;to.</p>
<p>One thing I noticed straight off the bat is the note numbers are not incremental.  Each row starts 16 higher than the last - I assume to allow for the same firmware to work in a 16 x 16 layout model - and there is a very simple way that reminds me of the technique of <a href="http://en.wikipedia.org/wiki/Bitwise_operation">bitshifting</a> I used back in the bad old days of DVD authoring to convert from one to the&nbsp;other.</p>
<pre class="brush: java">
// To go from XY to the note number
noteNumber = y * 16 + x;

// To go from the note number to the XY
x = noteNumber % 16;
y = (noteNumber - x) / 16;
</pre>
<p>Hopefully that will save someone ten minutes of head&nbsp;scratching.</p>
]]></content:encoded>
			<wfw:commentRss>http://stefangoodchild.com/journal/2009/11/novation-launchpad-note-number-to-xy-coordinates-and-back-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
