<?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>musicalgeometry &#187; hack</title>
	<atom:link href="http://www.musicalgeometry.com/archives/category/hack/feed" rel="self" type="application/rss+xml" />
	<link>http://www.musicalgeometry.com</link>
	<description>sound, code, &#38; DIY tech</description>
	<lastBuildDate>Sat, 24 Jul 2010 16:32:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Xcode Script For Creating Properties From Instance Variables For UIViewController</title>
		<link>http://www.musicalgeometry.com/archives/904</link>
		<comments>http://www.musicalgeometry.com/archives/904#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:26:29 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=904</guid>
		<description><![CDATA[One of my favourite blogs on the net is Matt Gallagher&#8217;s Cocoa with Love. Today I was investigating ways to speed up my workflow in Xcode and I found a great mixed Perl and AppleScript script already written by Matt a &#8230; <a href="http://www.musicalgeometry.com/archives/904">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of my favourite blogs on the net is Matt Gallagher&#8217;s <a href="http://cocoawithlove.com/">Cocoa with Love</a>. Today I was investigating ways to speed up my workflow in Xcode and I found a great mixed Perl and AppleScript script already written by Matt a couple of years ago.</p>
<div id="attachment_905" class="wp-caption alignnone" style="width: 637px"><a href="http://cocoawithlove.com/"><img class="size-full wp-image-905 " style="border: 1px solid black;" title="cocoawithlove" src="http://www.musicalgeometry.com/wp-content/uploads/2010/02/cocoawithlove.png" alt="" width="627" height="139" /></a><p class="wp-caption-text">A fantastic resource for Cocoa, Objective-C and programming in general</p></div>
<p>The script called <a href="http://projectswithlove.com/projects/PropertyFromInstanceVariable.zip">PropertyFromInstanceVariable</a> had already been added to by a couple of other people, Yung-Luen Lan &amp; <a href="http://github.com/mschrag/xcode_property_from_ivar">Mike Schrag</a> and <a href="http://www.bernard-web.com/pierre/blog/">Pierre Bernard</a> and I have now shaped it for my own specific needs, and possibly yours too.</p>
<p>The tedium I was trying to eliminate was the process of creating Objective-C properties from instance variables and doing basic memory management on them. This is a repetitive process that seems more appropriate to hand off to the machine.</p>
<p>Matt&#8217;s script allows you to take an instance variable defined in your interface file and automatically create a property for it, synthesize the property in the implementation, add a release statement and set the property to NULL in the dealloc method.</p>
<p>For example, running the script on this:</p>
<pre><code>NSString *myString;</code></pre>
<p>would automatically create this in the interface:</p>
<pre><code>@property (nonatomic, retain) NSString *myString;</code></pre>
<p>this at the top of the implementation:</p>
<pre><code>@synthesize myString;</code></pre>
<p>and adds these two lines to the dealloc method:</p>
<pre><code>[myString release];
myString = NULL;</code></pre>
<p>Because this script was written before the viewDidUnload method had been added to the UIViewController class it didn&#8217;t make use of the viewDidUnload method. I wanted to update it to set the retaining references to subviews in the view hierarchy to nil. These reference properties may have been set through IBOutlets when loading a nib or programmatically in the loadView method.</p>
<p>I have now modified the script to reflect my own coding habits. It still creates the property, synthesizes it and adds a release to the dealloc method, but if the class is a subclass of UIViewController then this is placed in viewDidUnload like so:</p>
<pre><code>self.myString = nil;</code></pre>
<p>This script can be run on multiple instance variables at once and greatly cuts down on the time it takes to set up a new class. Instructions on installing the script can be found <a href="http://cocoawithlove.com/2008/12/instance-variable-to-synthesized.html">here</a>.</p>
<p>You can get my fork of the script on <a href="http://github.com/jj0b/xcode_property_from_ivar">github</a>.</p>
<p>NOTE: I have updated to script and edited this post to reflect those changes. All links are to the most recent version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/904/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pachube: The Internet Of Things</title>
		<link>http://www.musicalgeometry.com/archives/434</link>
		<comments>http://www.musicalgeometry.com/archives/434#comments</comments>
		<pubDate>Wed, 01 Jul 2009 06:39:21 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[energy]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[solar]]></category>
		<category><![CDATA[ubiComp]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=434</guid>
		<description><![CDATA[I just found out about Pachube over on the Make: Blog and am feeling really inspired. Pachube is just awesome! It is a service created by HAQUE design + research that &#8220;enables you to connect, tag and share real time &#8230; <a href="http://www.musicalgeometry.com/archives/434">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I just found out about <a href="http://www.pachube.com/">Pachube</a> over on the <a href="http://blog.makezine.com/">Make: Blog</a> and am feeling really inspired. Pachube is just awesome! It is a service created by <a href="http://www.haque.co.uk/">HAQUE design + research</a> that &#8220;enables you to connect, tag and share real time sensor data from objects, devices, buildings and environments around the world. The key aim is to facilitate interaction between remote environments, both physical and virtual.&#8221;  Here is a video outlining the service:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/6kzNKONUGQ8&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/6kzNKONUGQ8&amp;rel=0&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>I have already sent off a request for an invitation to the beta version and am watching my inbox with excitement. I can&#8217;t wait to use an arduino to start logging some data to share online. I would love to track the sun light in my garden or the energy usage in my house or use Pachube as part of a home automation system. Perhaps I will be able to monitor how much time I spend making music versus downsurfing on the interweb!</p>
<p>There is already a convenient way to <a href="http://apps.pachube.com/iphone/">follow peoples Pachube feeds on your iPhone</a> but it might also be interesting to explore the API and create a handy <a href="http://www.musicalgeometry.com/pachubemon">Pachube iPhone app of my own</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/434/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improved Arrow Key Key-bindings For OSX Terminal</title>
		<link>http://www.musicalgeometry.com/archives/305</link>
		<comments>http://www.musicalgeometry.com/archives/305#comments</comments>
		<pubDate>Thu, 26 Feb 2009 06:11:03 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=305</guid>
		<description><![CDATA[When using Terminal it is sometimes useful to have your Page-Up, Page-Down, Home and End keys (the four arrow keys on Mac keyboards) function as you would expect. This is especially useful when using more or less to view text &#8230; <a href="http://www.musicalgeometry.com/archives/305">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When using Terminal it is sometimes useful to have your Page-Up, Page-Down, Home and End keys (the four arrow keys on Mac keyboards) function as you would expect. This is especially useful when using <code>more</code> or <code>less</code> to view text files or man pages. Unfortunately the default key-bindings for Terminal do not provide this. Here is a quick fix that works for me on OSX 10.5.6.</p>
<div id="attachment_310" class="wp-caption alignnone" style="width: 309px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2009/02/keybind.jpeg"><img class="size-full wp-image-310  " style="margin-top: 8px; margin-bottom: 8px; border: 1px solid black;" title="key-bindings" src="http://www.musicalgeometry.com/wp-content/uploads/2009/02/keybind.jpeg" alt="Setting key-bindings for Terminal " width="299" height="218" /></a><p class="wp-caption-text">Setting the Page-Up key-binding in Terminal</p></div>
<p>Open Terminal then go to Terminal -&gt; Preferences -&gt; Settings -&gt; Keyboard. Scroll down to find the key that you want to change and highlight it. Click the edit button at the bottom of the window. A new window will open like the one pictured above. Set everything as shown and replace the string to send to the shell with the appropriate one from the following list:</p>
<pre><code>Key        Escape Sequence
End        \033[4~
Home       \033[1~
Page-Down  \033[6~
Page-Up    \033[5~</code></pre>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/305/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Genre From List View In iTunes 8.0</title>
		<link>http://www.musicalgeometry.com/archives/168</link>
		<comments>http://www.musicalgeometry.com/archives/168#comments</comments>
		<pubDate>Fri, 12 Dec 2008 06:40:32 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=168</guid>
		<description><![CDATA[I personally don&#8217;t use genre to browse my music collection. I find it too difficult to pin a label on a lot of music these days; I would just end up stringing adjectives. iTunes 8.0 defaults to showing genre in &#8230; <a href="http://www.musicalgeometry.com/archives/168">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I personally don&#8217;t use genre to browse my music collection. I find it too difficult to pin a label on a lot of music these days; I would just end up stringing adjectives. iTunes 8.0 defaults to showing genre in the list view and does not allow you to change this from within the app itself. Here is a quick fix for this:</p>
<p>Open Terminal and type:</p>
<pre><code>defaults write com.apple.itunes show-genre-when-browsing -bool FALSE</code></pre>
<p>Then close and reopen iTunes and voila, genre is gone form the list view.</p>
<p>To put genres back, type:</p>
<pre><code>defaults write com.apple.itunes show-genre-when-browsing -bool TRUE</code></pre>
<p>Your iTunes browser will now look like this:</p>
<div id="attachment_299" class="wp-caption alignnone" style="width: 310px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/12/itunes.jpg"><img class="size-medium wp-image-299 " style="margin-top: 8px; margin-bottom: 8px; border: 1px solid black;" title="itunes" src="http://www.musicalgeometry.com/wp-content/uploads/2008/12/itunes-300x172.jpg" alt="iTunes with browse by genre removed" width="300" height="172" /></a><p class="wp-caption-text">iTunes with browse by genre removed</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/168/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oxygen 49 FWD/REV Transport Buttons In Live</title>
		<link>http://www.musicalgeometry.com/archives/158</link>
		<comments>http://www.musicalgeometry.com/archives/158#comments</comments>
		<pubDate>Thu, 13 Nov 2008 19:30:05 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[MIDI]]></category>
		<category><![CDATA[ableton]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=158</guid>
		<description><![CDATA[If you have ever tried to use the Forward or Reverse transport buttons on an M-Audio Oxygen MIDI controller in Ableton Live, you will have had the unpleasant experience of losing control of the play-head. When this happens, the play-head &#8230; <a href="http://www.musicalgeometry.com/archives/158">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have ever tried to use the Forward or Reverse transport buttons on an M-Audio Oxygen MIDI controller in Ableton Live, you will have had the unpleasant experience of losing control of the play-head. When this happens, the play-head continuously jumps forward and back in an uncontrolled and unstoppable manner. The only way to get back to normal is to quit Live and restart. Below I describe the setup of an Oxygen 49 so that Forward and Reverse can take on a more useful and logical function. This also applies for the Oxygen 8 v2 and the Oxygen 61.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/musicalgeometry/3763766751/"><img class=" " style="border: 1px solid black;" title="Oxygen 49 transport controls" src="http://farm3.static.flickr.com/2511/3763766751_443f492431.jpg" alt="Oxygen 49 transport controls" width="500" height="375" /></a><p class="wp-caption-text">Oxygen 49 transport controls</p></div>
<p>The Oxygen 49 is a natively supported control surface in Ableton Live. To setup the controller go to Preferences-&gt;MIDI/Sync and select your device from the Control Surface dropdown list at the top left. Then select your MIDI input and output ports from the next two adjacent dropdown lists. If you are using an Oxygen 49 via USB then the ports will be something like “USB Oxygen 49”. You should now be able to use all of the transport buttons on the controller except for Forward and Reverse which will cause the crazy play-head problem.</p>
<p>A common use of Forward and Reverse transport buttons is to move the play-head through an arrangement window, usually by some user defined length; 1-bar, 8<sup>th</sup> notes, 16<sup>th</sup> notes etc, and sometimes to navigate through user defined locators. As far as I know the former is not possible in Ableton Live as of version 7, at least not with an Oxygen controller. What we can do though is setup locator navigation by assigning the Forward and Reverse keys to the Previous and Next Locator buttons using MIDI Map Mode. Settings in MIDI Map Mode override control surface defaults.</p>
<p>To enter MIDI Map Mode click the MIDI button at the top right of the Live window. Click on the Previous Locator arrow and press the Reverse button on your controller. Click on the Next Locator arrow and press the Forward button on your controller. Press the MIDI button to exit MIDI Map Mode. Now you can create locators in the arrangement window using the Set Locator button and move through them using the Forward and Reverse transport buttons.</p>
<p>It would be nice to be able to assign these buttons to increment or decrement the play head location by the global quantize amount. Hopefully this will be a MIDI assignable option in future versions of Live. In the meantime this is a much better use for the Forward and Reverse transport buttons than locking up the program.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/158/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar Powered Beam Bots</title>
		<link>http://www.musicalgeometry.com/archives/97</link>
		<comments>http://www.musicalgeometry.com/archives/97#comments</comments>
		<pubDate>Thu, 16 Oct 2008 13:47:55 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[bots]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[solar]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=97</guid>
		<description><![CDATA[My 2 year old daughter has recently become interested in a couple of solar powered robots that I built a few years ago so I thought I would share them here. Both bots were built from instructions in Make Magazine vol. 06. The &#8230; <a href="http://www.musicalgeometry.com/archives/97">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My 2 year old daughter has recently become interested in a couple of solar powered robots that I built a few years ago so I thought I would share them here. Both bots were built from instructions in Make Magazine vol. 06. The first one that I made was a &#8216;Trimet&#8217;. The Trimet uses a 1381-based solarengine with three 4700uF capacitors in parallel to power itself.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/musicalgeometry/3763760651/"><img class=" " style="border: 1px solid black;" title="Trimet" src="http://farm3.static.flickr.com/2500/3763760651_52c04f85b6.jpg" alt="Trimet" width="500" height="375" /></a><p class="wp-caption-text">Trimet</p></div>
<p>The second bot that I built was a &#8216;Solar Roller&#8217;. It uses the same 1381-based solarengine as the Trimet but this time with a single 0.33 Farad gold capacitor. The body and wheels were salvaged from a VCR and a cassette walkman.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/musicalgeometry/3763759993/"><img class=" " style="border: 1px solid black;" title="Solar Roller" src="http://farm4.static.flickr.com/3497/3763759993_d9e7cc8445.jpg" alt="Solar Roller" width="500" height="375" /></a><p class="wp-caption-text">Solar Roller</p></div>
<p>The 1381-based solarengine works like this: The solar cell charges the capacitor. As the capacitor gains more charge, the voltage across it increases. Eventually the voltage reaches the critical point for the 1381 and it supplies current to the base of the 3904 NPN transistor. This turns the 3904 on so that current is drawn through the motor and from the base of the 3906 PNP transistor. This current turns the motor and the 3906 on, effectively removing the 1381 from the circuit. The motor continues to run as the capacitor finishes discharging.</p>
<div id="attachment_209" class="wp-caption alignnone" style="width: 257px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/10/se_1381_basic.jpg"><img class="size-full wp-image-209" title="se_1381_basic" src="http://www.musicalgeometry.com/wp-content/uploads/2008/10/se_1381_basic.jpg" alt="se_1381_basic" width="247" height="139" /></a><p class="wp-caption-text">Solarengine schematic from www.solarbotics.net</p></div>
<p>To see some great solar bots go <a href="http://www.smfr.org/robots/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/97/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Built-In Audio Output As A Cue Channel In Live</title>
		<link>http://www.musicalgeometry.com/archives/41</link>
		<comments>http://www.musicalgeometry.com/archives/41#comments</comments>
		<pubDate>Mon, 29 Sep 2008 05:59:41 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[ableton]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=41</guid>
		<description><![CDATA[I have an Apogee Duet firewire audio interface that gives me one stereo channel in and out. It works great for single track recording and overdubbing but is not very functional for dj&#8217;ing. A great feature available in OSX is the &#8230; <a href="http://www.musicalgeometry.com/archives/41">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have an Apogee Duet firewire audio interface that gives me one stereo channel in and out. It works great for single track recording and overdubbing but is not very functional for dj&#8217;ing. A great feature available in OSX is the ability to create aggregate audio devices. What this means is that you can use both the external audio interface and the built-in audio device in your Mac at the same time. This allows you to cue on one channel (the built-in 1/8&#8243; mini-jack output) and send out to the main outputs on another (in this case the Duet).</p>
<div id="attachment_211" class="wp-caption alignnone" style="width: 310px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/09/aggregate.jpg"><img class="size-medium wp-image-211 " style="margin-top: 8px; margin-bottom: 8px;" title="aggregate" src="http://www.musicalgeometry.com/wp-content/uploads/2008/09/aggregate-300x270.jpg" alt="Aggregate Device Editor" width="300" height="270" /></a><p class="wp-caption-text">Aggregate Device Editor</p></div>
<p>To accomplish this, open Audio MIDI Setup under Applications-&gt;Utilities. In the Audio MIDI Setup menu bar, select Audio-&gt;Open Aggregate Device Editor. Click the + button to create a new aggregate device and then in the Structure window select which devices you want to include. As an example, I selected the Duet and the Built-In Output and made sure that the Duet was in charge of timing by clicking the radio button next to it. Now in a program such as Ableton Live you can use both the Duet and the Built-In Output at the same time allowing you to cue loops and tracks before you bring them into the main mix.</p>
<p>You could also create other aggregate devices to allow recording on both your Built-In Input and your external device inputs but be warned that the recording quality may vary between the two devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/41/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
