<?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>C i b o M a h t o . c o m</title>
	<atom:link href="http://www.cibomahto.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cibomahto.com</link>
	<description>Making Hacking Programming Building Designing Dreaming</description>
	<lastBuildDate>Mon, 01 Mar 2010 22:54:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visiting the Phipps Conservatory</title>
		<link>http://www.cibomahto.com/2010/03/visiting-the-phipps-conservatory/</link>
		<comments>http://www.cibomahto.com/2010/03/visiting-the-phipps-conservatory/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 22:54:03 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=797</guid>
		<description><![CDATA[
To escape the plastic world for a bit this weekend, I headed out to the Phipps Conservatory for some organic scenery.  Though I was a big fan of the Desert Botanical Garden in Phoenix, I&#8217;ve only been to Phipps a few times since I moved to Pittsburgh.  The desert room here saddens me. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cibomahto/4396889240/" title="Canopy by cibomahto, on Flickr"><img src="http://farm5.static.flickr.com/4007/4396889240_5394728dea.jpg" width="500" height="333" alt="Canopy" /></a></p>
<p>To escape the plastic world for a bit this weekend, I headed out to the <a href="http://phipps.conservatory.org/">Phipps Conservatory</a> for some organic scenery.  Though I was a big fan of the <a href="http://www.flickr.com/photos/cibomahto/tags/DesertBotanicalGarden">Desert Botanical Garden</a> in Phoenix, I&#8217;ve only been to Phipps a few times since I moved to Pittsburgh.  The desert room here saddens me.  Though it is laid out well, I miss the smell of creosote bush, and have to fight the urge to put on my hiking boots and head west.  Turns out I miss Arizona!</p>
<p>Anyway, this is a pleasant place overall, wonderful smells, colors, and sounds (even the pre-recorded bird calls- either a nice touch or an extreme annoyance).  I took <a href="http://www.flickr.com/photos/cibomahto/tags/phippsconservatory/">a couple of photos</a>, but mostly just sat and observed.  The sheer variety of shapes and colors produced by our floral friends can be quite overwhelming.</p>
<p>I did pick up a membership, so if&#8217;n you ever want to make a visit there, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/03/visiting-the-phipps-conservatory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a MidiVox</title>
		<link>http://www.cibomahto.com/2010/02/building-a-midivox/</link>
		<comments>http://www.cibomahto.com/2010/02/building-a-midivox/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 09:24:22 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Ridiculous]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=791</guid>
		<description><![CDATA[
Collin sent me a pre-release sample of his MidiVox kit to try out, so I dutifully soldered it up, and then proceeded to have some fun with  .  It&#8217;s a cool little add-on shield for the Arduino, consisting of a MIDI input jack, DAC and audio output jack, allowing the Arduino to act [...]]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Ja1TKOtXv2w&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Ja1TKOtXv2w&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p><a href="http://narbotic.com/">Collin</a> sent me a pre-release sample of his <a href="http://narbotic.com/kits/midivox/">MidiVox</a> kit to try out, so I dutifully soldered it up, and then proceeded to have some fun with <img src='http://www.cibomahto.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  It&#8217;s a cool little add-on shield for the Arduino, consisting of a MIDI input jack, DAC and audio output jack, allowing the Arduino to act as a MIDI synthesizer.  The board and components are beautiful, with cool curvy traces (which I suggest you consider from an aesthetic standpoint, not an engineering one) and solid connectors, and I had little trouble assembling it.  The kit included 5-banded resistors, which I didn&#8217;t remember how to decode, (it turns out they are <a href="http://samengstrom.com/nxl/10116/5_band_resistor_color_code_page.en.html">higher precision</a> then their 4-banded cousins), but a multimeter did the job just fine.</p>
<p>Once it was all put together, I grabbed the pre-release version of the software, and after working through some issues to get it to compile on my Linux system (filename case sensitivity, we make everything difficult!), and uncovering (and fixing) <a href="http://code.google.com/p/arduino/issues/detail?id=209&#038;q=hidden">a bug</a> in the Arduino environment that prevented a supporting library from compiling, the sketch uploaded fine.  I plugged in a MIDI patch cable and was busting out melodies from my MIDI keyboard in no time.  </p>
<p>Then, OCD mode kicked in, and strange things were made to happen&#8230;  Becasue my keyboard only has one adjustment knob, I wasn&#8217;t able to use it to tweak all of the synth parameters, so I wrote a <a href="http://puredata.info/">PD</a> sketch to expose all of the knobs:</p>
<p><a href="http://www.cibomahto.com/wp-content/uploads/2010/02/midivox_control_panel.jpg"><img src="http://www.cibomahto.com/wp-content/uploads/2010/02/midivox_control_panel-300x159.jpg" alt="" title="midivox_control_panel" width="300" height="159" class="alignnone size-medium wp-image-792" /></a><br />
(<a href="http://files.cibomahto.com/midivox_control.pd">get the sketch</a>)</p>
<p>Then, I decided that I really wanted to use a sequencer to feed the MidiVox, so I fired up <a href="http://www.filter24.org/seq24/">Seq24</a> and made some patterns, throwing in a drum track generated by <a href="http://qsynth.sourceforge.net/qsynth-index.html">QSynth</a>.  This was all working great using the MIDI out through my keyboard, but I realized it would be much more convenient if I could control it directly through the USB connection.  Well, Steven Hobley recently <a href="http://blog.makezine.com/archive/2010/02/midi_without_the_adaptor.html">made a program to achieve this in Windows</a>, but I couldn&#8217;t find anything like it for Linux.  Instead, I hacked up a copy of <a href="http://www.varal.org/ttymidi/">ttymidi</a> to work backwards.  It&#8217;s a pretty incomplete implementation of a serial->MIDI bridge (ideally, it would support bidirectional messages of all kinds, not just note on/note off/control), but it seems to do the job.  If you are interested, the hacked-up mess is <a href="http://files.cibomahto.com/ttymidi_output_only.tar.gz">here</a>, and be sure to set your Arduino to 38400 baud.</p>
<p>At the end of it all, I was able to relax on my couch and control the MidiVox directly from my laptop, without a MIDI cable in sight&#8230;  quite a bit of fun!  If I get inspired sometime soon, I&#8217;ll try to clean up the hack job I did to ttymidi, and release it properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/02/building-a-midivox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stepping stylishly</title>
		<link>http://www.cibomahto.com/2010/02/stepping-stylishly/</link>
		<comments>http://www.cibomahto.com/2010/02/stepping-stylishly/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 07:11:51 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=784</guid>
		<description><![CDATA[
Extended the controller to handle all three drive axis, so now we can draw some things. Here is what came out:

Props to Matt S. for gently reminding me that this doesn&#8217;t require a super complex system, and that some tape and open loop controls are probably good enough  .
Project code is now on github!
]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/9X40tbf4HeY&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9X40tbf4HeY&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>Extended the controller to handle all three drive axis, so now we can draw some things. Here is what came out:</p>
<p><a href="http://www.cibomahto.com/wp-content/uploads/2010/02/drawing_pattern.jpg"><img src="http://www.cibomahto.com/wp-content/uploads/2010/02/drawing_pattern.jpg" alt="" title="drawing_pattern" width="600" height="404" class="alignnone size-full wp-image-785" /></a></p>
<p>Props to Matt S. for gently reminding me that this doesn&#8217;t require a super complex system, and that some tape and open loop controls are probably good enough <img src='http://www.cibomahto.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>Project code is <a href="http://github.com/cibomahto/stepper_controller/blob/master/unistepper.pde">now on github</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/02/stepping-stylishly/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Stepping quickly</title>
		<link>http://www.cibomahto.com/2010/02/stepping-quickly/</link>
		<comments>http://www.cibomahto.com/2010/02/stepping-quickly/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 08:18:44 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=780</guid>
		<description><![CDATA[

Finally getting around to designing up a stepper motor controller for this chemical mixing robot that I picked up this summer.  So, here is a super simple controller to drive one axis!  Right now it&#8217;s using Arduino on an Atmega168, but I think i&#8217;ll switch to something lighter, give each module it&#8217;s own [...]]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/8BXipVLuNCs&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/8BXipVLuNCs&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p><a href="http://www.flickr.com/photos/cibomahto/4366746765/" title="Stepper controller prototype by cibomahto, on Flickr"><img src="http://farm5.static.flickr.com/4004/4366746765_6849401fb3.jpg" width="500" height="374" alt="Stepper controller prototype" /></a></p>
<p>Finally getting around to designing up a stepper motor controller for this chemical mixing robot that I picked up this summer.  So, here is a super simple controller to drive one axis!  Right now it&#8217;s using Arduino on an Atmega168, but I think i&#8217;ll switch to something lighter, give each module it&#8217;s own micro (with limit switch and encoder support), and talk to them from a master controller using some serial bus.  Or just talk to them all using a parallel port on a PC <img src='http://www.cibomahto.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .  Sample code for this guy after the break.<br />
<span id="more-780"></span></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">// _Simple_ half-stepping driver for a unipolar stepper motor</span>
<span style="color: #666666; font-style: italic;">// </span>
<span style="color: #666666; font-style: italic;">// Written by Matt Mets in 2010</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Generates a waveform that looks like this:</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//    ______</span>
<span style="color: #666666; font-style: italic;">// A |      |_____________</span>
<span style="color: #666666; font-style: italic;">//   </span>
<span style="color: #666666; font-style: italic;">//         ______</span>
<span style="color: #666666; font-style: italic;">// B _____|      |________</span>
<span style="color: #666666; font-style: italic;">//   </span>
<span style="color: #666666; font-style: italic;">//              ______  </span>
<span style="color: #666666; font-style: italic;">// C __________|      |___</span>
<span style="color: #666666; font-style: italic;">//   </span>
<span style="color: #666666; font-style: italic;">//   _               _____  </span>
<span style="color: #666666; font-style: italic;">// D  |_____________|     </span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Digital I/O pins to which the n-channel FET drivers are connected</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> motorPins<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">5</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">3</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// Set all the pins to outputs, and turn them off.  </span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    pinMode<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    digitalWrite<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// number of times the complete cycle is repeated</span>
<span style="color: #339933;">#define rotations 50</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// microsecond delay between half-steps</span>
<span style="color: #339933;">#define delayLength 2000</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// walk forward in half-steps</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> rotations<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      digitalWrite<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span><span style="color:#800080;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      delayMicroseconds<span style="color: #009900;">&#40;</span>delayLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      digitalWrite<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      delayMicroseconds<span style="color: #009900;">&#40;</span>delayLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// then backward</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> j <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&lt;</span> rotations<span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      digitalWrite<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span><span style="color:#800080;">4</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      delayMicroseconds<span style="color: #009900;">&#40;</span>delayLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      digitalWrite<span style="color: #009900;">&#40;</span>motorPins<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">3</span><span style="color: #339933;">-</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      delayMicroseconds<span style="color: #009900;">&#40;</span>delayLength<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  delay<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/02/stepping-quickly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whole wheat French bread</title>
		<link>http://www.cibomahto.com/2010/02/whole-wheat-french-bread/</link>
		<comments>http://www.cibomahto.com/2010/02/whole-wheat-french-bread/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 19:24:56 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=773</guid>
		<description><![CDATA[
I&#8217;ve been on a bit of a baking kick lately.  I&#8217;d been making a country loaf recipe, but decided to try out a French bread recipe this time.  I like the taste of it, however purists might argue that it isn&#8217;t quite right stylistically- the crust is crunchy but not exactly hard, and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cibomahto/4366051042/" title="Whole wheat french bread by cibomahto, on Flickr"><img src="http://farm5.static.flickr.com/4056/4366051042_a942e49ffc.jpg" width="500" height="346" alt="Whole wheat french bread" /></a></p>
<p>I&#8217;ve been on a bit of a baking kick lately.  I&#8217;d been making a <a href="http://www.cibomahto.com/2010/01/here-is-bread-i-cooked-it/">country loaf</a> recipe, but decided to try out a French bread recipe this time.  I like the taste of it, however purists might argue that it isn&#8217;t quite right stylistically- the crust is crunchy but not exactly hard, and the insides are warm and i think a bit denser than might be expected.  Which is actually my favorite texture for bread, so I&#8217;m not complaining <img src='http://www.cibomahto.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<p>Following <a href="http://www.recipezaar.com/Whole-Wheat-French-Bread-102132">this recipe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/02/whole-wheat-french-bread/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Documentation lighting workshop at Hack Pittsburgh</title>
		<link>http://www.cibomahto.com/2010/02/documentation-lighting-workshop-at-hack-pittsburgh/</link>
		<comments>http://www.cibomahto.com/2010/02/documentation-lighting-workshop-at-hack-pittsburgh/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 06:42:55 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=765</guid>
		<description><![CDATA[UPDATE: The Documentation Lighting event is canceled due to the impending inclement weather.  Stay tuned, it will be rescheduled!

Want to present your projects online in the best light?  Frustrated with the way your documentation photos come out?  Need a warm place to be on a Friday night?  Then you should definitely [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:</strong> The Documentation Lighting event is canceled due to the impending inclement weather.  Stay tuned, it will be rescheduled!</p>
<p><a href="http://www.cibomahto.com/wp-content/uploads/2010/02/photo_night_2.jpg"><img src="http://www.cibomahto.com/wp-content/uploads/2010/02/photo_night_2.jpg" alt="" title="photo_night_2" class="alignnone size-full wp-image-766" /></a><br />
Want to present your projects online in the best light?  Frustrated with the way your documentation photos come out?  Need a warm place to be on a Friday night?  Then you should definitely come out to <a href="http://www.hackpittsburgh.org/about">Hack Pittsburgh</a> this <a href="http://en.wikipedia.org/wiki/Friday">Friday</a> for our <a href="http://www.hackpittsburgh.org/friday-doc-lighting">Documentation Lighting</a> workshop.  Bonnie Bogovitch and I will cover the basics of documentation photography, using the equipment you already have.  After we yammer on for a bit, we&#8217;ll get down to the business of taking photos, so be sure to bring your camera and something cool that you want to take a picture of.  It&#8217;s guaranteed* to be a good time!</p>
<p><strong>Documentation Lighting Workshop</strong><br />
Friday, Feb 5th, 2010, 7pm &#8211; 9pm<br />
Hack Pittsburgh<br />
1936 5th Ave. Pittsburgh, PA 15219<br />
Cost: Freeeeeeeee</p>
<p>*There is no such guarantee, It turns out I&#8217;m a terrible liar!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/02/documentation-lighting-workshop-at-hack-pittsburgh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a wall for a workshop</title>
		<link>http://www.cibomahto.com/2010/01/building-a-wall-for-a-workshop/</link>
		<comments>http://www.cibomahto.com/2010/01/building-a-wall-for-a-workshop/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 06:01:01 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=761</guid>
		<description><![CDATA[
We spent the greater part of the day building out a wall to section off the workshop area at Hack Pittsburgh.  This is how it went!
]]></description>
			<content:encoded><![CDATA[<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/HvkU28-IRFI&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HvkU28-IRFI&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>We spent the greater part of the day building out a wall to section off the workshop area at <a href="http://hackpittsburgh.org/">Hack Pittsburgh</a>.  This is how it went!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/01/building-a-wall-for-a-workshop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Design idea: Parrot wire strippers</title>
		<link>http://www.cibomahto.com/2010/01/design-idea-parrot-wire-strippers/</link>
		<comments>http://www.cibomahto.com/2010/01/design-idea-parrot-wire-strippers/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 07:27:59 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Photo]]></category>
		<category><![CDATA[Ridiculous]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=758</guid>
		<description><![CDATA[
Seriously, is anyone marketing tools like this?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/cibomahto/4315418592/" title="My favorite tool ever by cibomahto, on Flickr"><img src="http://farm3.static.flickr.com/2749/4315418592_fc741f3f6d.jpg" width="333" height="500" alt="My favorite tool ever" /></a></p>
<p>Seriously, is anyone marketing tools like this?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/01/design-idea-parrot-wire-strippers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Converting an old organ to MIDI</title>
		<link>http://www.cibomahto.com/2010/01/converting-an-old-organ-to-midi/</link>
		<comments>http://www.cibomahto.com/2010/01/converting-an-old-organ-to-midi/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:00:48 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=737</guid>
		<description><![CDATA[
You might remember that some years ago, I found a discarded organ and brought it home.  Well, it sat around for a year, then I converted it to MIDI, then I moved across the country and only brought the keyboards, and finally I re-built it as the proper single-row unit featured in the above [...]]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/4Q3APTV6idk&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4Q3APTV6idk&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>You might remember that some years ago, I <a href="http://www.cibomahto.com/2008/06/lucky-find/">found a discarded organ</a> and brought it home.  Well, it sat around for a year, then I <a href="http://www.youtube.com/watch?v=IoBeOZTkpnE">converted it to MIDI</a>, then I moved across the country and only brought the keyboards, and finally I re-built it as the proper single-row unit featured in the above video.</p>
<p>The keys are laid out as a generic <a href="http://en.wikipedia.org/wiki/Keyboard_matrix_%28music%29">matrix-style keyboard</a>, with a column for every note in an octave (12 in total), and a row for each octave bank (up to ten, although only 8 are in use).  Using a <a href="http://www.moderndevice.com/products/bbb-kit">Barebones</a> Arduino clone and a couple of I/O expander chips (PCF854AN) for extra digital pins, I was able to convert the old keyboard into a MIDI device.  This version works fine, however the circuit is a bit extravagant- If I ever re-build it, I will use a 3-to-8 line decoder for the select lines, which should free up enough digital pins on the Arduino to be able to get rid of the I/O expander chips.  Really, though, I would prefer to convert it into a velocity sensitive keyboard, so any further effort will be in that direction.  Rough schematic and source code after the break.</p>
<p><span id="more-737"></span><br />
<a href="http://www.cibomahto.com/wp-content/uploads/2010/01/keyboard_schematic.jpg"><img src="http://www.cibomahto.com/wp-content/uploads/2010/01/keyboard_schematic.jpg" alt="" title="keyboard_schematic" class="alignnone size-full wp-image-746" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Sketch to convert an older electric organ (Eminent S20) into a MIDI instrument.</span>
<span style="color: #666666; font-style: italic;">// By Matt Mets, completed in 2009</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// This code is released into the public domain.  Attribution is appreciated.</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// MIDI source code from the ITP website:</span>
<span style="color: #666666; font-style: italic;">// http://itp.nyu.edu/physcomp/Labs/MIDIOutput</span>
&nbsp;
<span style="color: #339933;">#include &lt;Wire.h&gt;</span>
&nbsp;
&nbsp;
<span style="color: #339933;">#define LEDpin 13                  // Just the standard output LED</span>
<span style="color: #339933;">#define volumePedal 1              // The analog input for the volume control</span>
&nbsp;
<span style="color: #993333;">char</span> velocity<span style="color: #339933;">;</span>                     <span style="color: #666666; font-style: italic;">// Use the foot pedal to determine this</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Define the MIDI channels that each instrument transmits on</span>
<span style="color: #339933;">#define keyboardChannel 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Number of key banks to scan.  There are eight 'normal' key banks, and 2 special ones.</span>
<span style="color: #339933;">#define numKeyBanks 8</span>
<span style="color: #339933;">#define numKeysPerBank 12</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Lookup table, used to determine the select line to turn on to read the keys in that key bank.</span>
<span style="color: #993333;">static</span> <span style="color: #993333;">char</span> keyBankSelectLines<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #0000dd;">2</span><span style="color: #339933;">,</span><span style="color: #0000dd;">3</span><span style="color: #339933;">,</span><span style="color: #0000dd;">4</span><span style="color: #339933;">,</span><span style="color: #0000dd;">5</span><span style="color: #339933;">,</span><span style="color: #0000dd;">6</span><span style="color: #339933;">,</span><span style="color: #0000dd;">7</span><span style="color: #339933;">,</span><span style="color: #0000dd;">8</span><span style="color: #339933;">,</span><span style="color: #0000dd;">11</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Storage for the previous value of each bank of keys.  There are 10 access lines, with a maximum of 12 inputs per line.</span>
<span style="color: #666666; font-style: italic;">// The 12 bits of data on each line are split into low and high banks.</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> noteStatesL<span style="color: #009900;">&#91;</span>numKeyBanks<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> noteStatesH<span style="color: #009900;">&#91;</span>numKeyBanks<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Storage for the instrument data associated with each key.  Must be filled in at startup.</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> noteChannels<span style="color: #009900;">&#91;</span>numKeyBanks<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>numKeysPerBank<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> noteValues<span style="color: #009900;">&#91;</span>numKeyBanks<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>numKeysPerBank<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Initialize IO ports</span>
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// Setup the I2C bus (analog pins 4&amp;5) in master mode.  This bus is used to talk to the IO expander chips.</span>
  Wire.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">//  Set the serial port to the correct baud rate for MIDI</span>
  Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">31250</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set all initial note bank vales to 0</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> numKeyBanks<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    noteStatesL<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    noteStatesH<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  pinMode<span style="color: #009900;">&#40;</span>LEDpin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// Status LED</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set all of the bank select lines to outputs</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> bankNo <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> bankNo <span style="color: #339933;">&lt;</span> numKeyBanks<span style="color: #339933;">;</span> bankNo<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    pinMode<span style="color: #009900;">&#40;</span>keyBankSelectLines<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Set up the instrument data for the keys</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// first off, clear everything.</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> bank <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> bank <span style="color: #339933;">&lt;</span> numKeyBanks<span style="color: #339933;">;</span> bank <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> key <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> key <span style="color: #339933;">&lt;</span> numKeysPerBank<span style="color: #339933;">;</span> key<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      noteChannels<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
      noteValues<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// The bottom half of the keyboard comprised of banks 4-6, starting at F</span>
  <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> noteValue <span style="color: #339933;">=</span> <span style="color: #0000dd;">24</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// Octave 2, C note</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> bank <span style="color: #339933;">=</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> bank <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">7</span><span style="color: #339933;">;</span> bank <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> key <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> key <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">12</span><span style="color: #339933;">;</span> key<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      noteChannels<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> keyboardChannel<span style="color: #339933;">;</span>
      noteValues<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> noteValue<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// The top keyboard row is comprised of banks 0-3, starting at F</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> bank <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> bank <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">4</span><span style="color: #339933;">;</span> bank <span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> key <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> key <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">12</span><span style="color: #339933;">;</span> key<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      noteChannels<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> keyboardChannel<span style="color: #339933;">;</span>
      noteValues<span style="color: #009900;">&#91;</span>bank<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>key<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> noteValue<span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">// And one extra one on bank 9 note 1</span>
  noteChannels<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">7</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> keyboardChannel<span style="color: #339933;">;</span>
  noteValues<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">7</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> noteValue<span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  Send a MIDI command.</span>
<span style="color: #666666; font-style: italic;">//  cmd is the command and channel (0x90 for channel 1 note on)</span>
<span style="color: #666666; font-style: italic;">//  data1 is the note</span>
<span style="color: #666666; font-style: italic;">//  data2 is the velocity</span>
<span style="color: #993333;">void</span> midiCommand<span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> cmd<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> data1<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> data2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>cmd<span style="color: #339933;">,</span> BYTE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>data1<span style="color: #339933;">,</span> BYTE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Serial.<span style="color: #202020;">print</span><span style="color: #009900;">&#40;</span>data2<span style="color: #339933;">,</span> BYTE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Map an integer into a charater given a set range</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> mapInteger<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> input<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> min<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> max<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>input <span style="color: #339933;">-</span> min<span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #0000dd;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span><span style="color: #009900;">&#40;</span>max<span style="color: #339933;">-</span>min<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">// Main loop</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> newNoteStateL<span style="color: #339933;">;</span>
<span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> newNoteStateH<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span> 
  <span style="color: #666666; font-style: italic;">// Read the velocity in</span>
<span style="color: #666666; font-style: italic;">//  velocity = mapInteger(analogRead(volumePedal),400,900);</span>
  velocity <span style="color: #339933;">=</span> <span style="color: #0000dd;">90</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> bankNo <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> bankNo <span style="color: #339933;">&lt;</span> numKeyBanks<span style="color: #339933;">;</span> bankNo<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    digitalWrite<span style="color: #009900;">&#40;</span>keyBankSelectLines<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// Select the key bank</span>
&nbsp;
    Wire.<span style="color: #202020;">requestFrom</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0x38</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                      <span style="color: #666666; font-style: italic;">// Read the low data</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>Wire.<span style="color: #202020;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      newNoteStateL <span style="color: #339933;">=</span> Wire.<span style="color: #202020;">receive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    Wire.<span style="color: #202020;">requestFrom</span><span style="color: #009900;">&#40;</span><span style="color: #208080;">0x39</span><span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                      <span style="color: #666666; font-style: italic;">// Read the high data</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>Wire.<span style="color: #202020;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      newNoteStateH <span style="color: #339933;">=</span> Wire.<span style="color: #202020;">receive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    digitalWrite<span style="color: #009900;">&#40;</span>keyBankSelectLines<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> LOW<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>     <span style="color: #666666; font-style: italic;">// Deselect the key bank</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>newNoteStateL <span style="color: #339933;">!=</span> noteStatesL<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>      <span style="color: #666666; font-style: italic;">// Check if any notes in this bank are different</span>
      <span style="color: #993333;">char</span> stateDelta <span style="color: #339933;">=</span> newNoteStateL <span style="color: #339933;">^</span> noteStatesL<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>stateDelta <span style="color: #339933;">&gt;&gt;</span> i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>newNoteStateL <span style="color: #339933;">&gt;&gt;</span> i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Send a MIDI on message</span>
            midiCommand<span style="color: #009900;">&#40;</span><span style="color: #208080;">0x90</span> <span style="color: #339933;">+</span> noteChannels<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> noteValues<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> velocity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Send a MIDI off message</span>
            midiCommand<span style="color: #009900;">&#40;</span><span style="color: #208080;">0x80</span> <span style="color: #339933;">+</span> noteChannels<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> noteValues<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> velocity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>newNoteStateH <span style="color: #339933;">!=</span> noteStatesH<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>      <span style="color: #666666; font-style: italic;">// Check if any notes in this bank are different</span>
      digitalWrite<span style="color: #009900;">&#40;</span>LEDpin<span style="color: #339933;">,</span> HIGH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #993333;">char</span> stateDelta <span style="color: #339933;">=</span> newNoteStateH <span style="color: #339933;">^</span> noteStatesH<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">8</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>stateDelta <span style="color: #339933;">&gt;&gt;</span> i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>newNoteStateH <span style="color: #339933;">&gt;&gt;</span> i<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Send a MIDI on message</span>
            midiCommand<span style="color: #009900;">&#40;</span><span style="color: #208080;">0x90</span> <span style="color: #339933;">+</span> noteChannels<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> noteValues<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> velocity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
          <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Send a MIDI off message</span>
            midiCommand<span style="color: #009900;">&#40;</span><span style="color: #208080;">0x80</span> <span style="color: #339933;">+</span> noteChannels<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> noteValues<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>i<span style="color: #339933;">+</span><span style="color: #0000dd;">8</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> velocity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    noteStatesL<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> newNoteStateL<span style="color: #339933;">;</span>
    noteStatesH<span style="color: #009900;">&#91;</span>bankNo<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> newNoteStateH<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/01/converting-an-old-organ-to-midi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building an Atari Punk Console kit</title>
		<link>http://www.cibomahto.com/2010/01/building-an-atari-punk-console-kit/</link>
		<comments>http://www.cibomahto.com/2010/01/building-an-atari-punk-console-kit/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 08:24:50 +0000</pubDate>
		<dc:creator>mahto</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.cibomahto.com/?p=741</guid>
		<description><![CDATA[
Matt, Andy and I built our Atari Punk Console kits tonight, so that we are ready for Synth Night 2 at Hack Pittsburgh.  Hope to see you there!  Video encoding deets after the break.

Video encoding notes:
I used my cameras built-in intervalometer to take a photo every 3 seconds.  Photos were taken at [...]]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/WOR2-i1udOg&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WOR2-i1udOg&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Matt, Andy and I built our <a href="http://jimmieprodgers.com/kits/apc/">Atari Punk Console</a> kits tonight, so that we are ready for <a href="http://www.hackpittsburgh.org/synth-night-2">Synth Night 2</a> at Hack Pittsburgh.  Hope to see you there!  Video encoding deets after the break.<br />
<span id="more-741"></span><br />
<strong>Video encoding notes:</strong><br />
I used my cameras built-in intervalometer to take a photo every 3 seconds.  Photos were taken at the lowest resolution/quality available, because it is still much higher than HD video <img src='http://www.cibomahto.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .  I used my Nikon D700 with a 40mm lens at ISO 1600, f/8, and 1/500.</p>
<p>To convert the series of stills into a time lapse movie, I used mogrify (<a href="http://www.imagemagick.org/script/install-source.php#unix">the latest version</a>) and mencoder (stock Ubuntu version):</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">mogrify <span style="color: #339933;">-</span>resize 1920x1278 <span style="color: #339933;">-</span>crop 1920x1080<span style="color: #339933;">+</span><span style="color: #0000dd;">0</span><span style="color: #339933;">+</span><span style="color: #0000dd;">50</span> <span style="color: #339933;">-</span>rotate <span style="color: #0000dd;">180</span> <span style="color: #339933;">-</span>brightness<span style="color: #339933;">-</span>contrast 18x27 <span style="color: #339933;">*</span>.<span style="color: #202020;">JPG</span>
mencoder <span style="color: #339933;">-</span>ovc xvid <span style="color: #339933;">-</span>xvidencopts pass<span style="color: #339933;">=</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">-</span>o <span style="color: #339933;">/</span>dev<span style="color: #339933;">/</span><span style="color: #000000; font-weight: bold;">null</span> <span style="color: #339933;">-</span>mf w<span style="color: #339933;">=</span><span style="color: #0000dd;">1920</span><span style="color: #339933;">:</span>h<span style="color: #339933;">=</span><span style="color: #0000dd;">1080</span><span style="color: #339933;">:</span>fps<span style="color: #339933;">=</span><span style="color: #0000dd;">20</span><span style="color: #339933;">:</span>type<span style="color: #339933;">=</span>jpg <span style="color: #ff0000;">'mf://*.JPG'</span>
mencoder <span style="color: #339933;">-</span>ovc xvid <span style="color: #339933;">-</span>xvidencopts pass<span style="color: #339933;">=</span><span style="color: #0000dd;">2</span><span style="color: #339933;">:</span>bitrate<span style="color: #339933;">=</span><span style="color: #0000dd;">8000</span> <span style="color: #339933;">-</span>o apc.<span style="color: #202020;">avi</span> <span style="color: #339933;">-</span>mf w<span style="color: #339933;">=</span><span style="color: #0000dd;">1920</span><span style="color: #339933;">:</span>h<span style="color: #339933;">=</span><span style="color: #0000dd;">1080</span><span style="color: #339933;">:</span>fps<span style="color: #339933;">=</span><span style="color: #0000dd;">20</span><span style="color: #339933;">:</span>type<span style="color: #339933;">=</span>jpg <span style="color: #ff0000;">'mf://*.JPG'</span></pre></div></div>

<p>I was pleasantly surprised to note that mogrify automatically used both of my CPU cores for encoding.  Mencoder didn&#8217;t by default, and I didn&#8217;t see any performance gain by adding the option threads=2 to -xvidencops&#8230; bummer!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cibomahto.com/2010/01/building-an-atari-punk-console-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
