<?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; OSX</title>
	<atom:link href="http://www.musicalgeometry.com/archives/category/osx/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>Change Your Company Name In XCode</title>
		<link>http://www.musicalgeometry.com/archives/766</link>
		<comments>http://www.musicalgeometry.com/archives/766#comments</comments>
		<pubDate>Sun, 25 Oct 2009 06:46:39 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[command line]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=766</guid>
		<description><![CDATA[If you want your own company name to be automatically included in your XCode source files instead of this: // // helloworld.m // helloworld // // Created by John Smith on 24/10/09. // Copyright __MyCompanyName__ 2009. All rights reserved. // &#8230; <a href="http://www.musicalgeometry.com/archives/766">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you want your own company name to be automatically included in your XCode source files instead of this:</p>
<pre><code>//
//  helloworld.m
//  helloworld
//
//  Created by John Smith on 24/10/09.
//  Copyright __MyCompanyName__ 2009. All rights reserved.
//</code></pre>
<p>then it is time to open up your Terminal app.</p>
<div id="attachment_778" class="wp-caption alignnone" style="width: 310px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2009/10/Terminal-2.png"><img class="size-medium wp-image-778" style="border: 1px solid black;" title="Terminal 2" src="http://www.musicalgeometry.com/wp-content/uploads/2009/10/Terminal-2-300x212.png" alt="Terminal 2" width="300" height="212" /></a><p class="wp-caption-text">OSX Terminal app</p></div>
<p>You will find it at ~/Applications/Utilities/Terminal.app.</p>
<p>Enter the following in the open terminal (replacing the company name with yours):</p>
<pre><code>defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{"ORGANIZATIONNAME" = "Smith Incorporated";}'</code></pre>
<p>Now when you create new source files in XCode you will see this:</p>
<pre><code>//
//  helloworld.m
//  helloworld
//
//  Created by John Smith on 24/10/09.
//  Copyright Smith Incorporated 2009. All rights reserved.
//</code></pre>
<p>Much better.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/766/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create An Ad-Hoc Network For TouchOSC On Your Mac</title>
		<link>http://www.musicalgeometry.com/archives/361</link>
		<comments>http://www.musicalgeometry.com/archives/361#comments</comments>
		<pubDate>Wed, 25 Mar 2009 06:38:48 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[MIDI]]></category>
		<category><![CDATA[OSC]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=361</guid>
		<description><![CDATA[After coding for iPhone for the last month and a half, I figured it was time I finally got one of the coveted devices for myself. This week I have been having fun setting it up, checking my email, and browsing the &#8230; <a href="http://www.musicalgeometry.com/archives/361">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After coding for iPhone for the last month and a half, I figured it was time I finally got one of the coveted devices for myself. This week I have been having fun setting it up, checking my email, and browsing the app store. They really are a marvel of technology and raise my expectaions in terms of elegance and functionality for all devices.</p>
<div id="attachment_413" class="wp-caption alignnone" style="width: 170px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2009/03/screenshot-20090406-230341.png"><img class="size-medium wp-image-413 " title="TouchOSC" src="http://www.musicalgeometry.com/wp-content/uploads/2009/03/screenshot-20090406-230341-200x300.png" alt="iPhone running TouchOSC" width="160" height="240" /></a><p class="wp-caption-text">iPhone running TouchOSC</p></div>
<p>Today, in addition to working hard on my upcoming app release (which I am very excited about) I have been playing with the TouchOSC app from <a href="http://hexler.net/">hexler.net</a>. TouchOSC, available from the <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=288120394&amp;mt=8">Apple App Store</a>, provides several touchable interfaces including virtual faders, cross-faders, knobs, pads, keys, buttons, grids and x-y pads; all of which send OSC data over Wi-Fi using UDP. It is kind of  like a mini <a href="http://www.jazzmutant.com/lemur_overview.php">JazzMutant Lemur</a> in your pocket.</p>
<p>The OSC data from TouchOSC can be used in software capable of receiving OSC messages, such as <a href="http://www.cycling74.com/products/max5http://www.cycling74.com/products/max5">MaxMSP</a> or <a href="http://processing.org/">Processing</a>, or you can parse the OSC data to MIDI and then on to any MIDI controllable software such as <a href="http://www.ableton.com/">Ableton Live</a>. To translate the OSC to MIDI on a Mac I highly recommend you check out <a href="http://www.osculator.net/wp/">OSCulator</a>. If you own Max you could build yourself a maxpat to do the same thing but OSCulator is prebuilt and there are some excellent presets available on the <a href="http://hexler.net/">hexler.net</a> website. Mac users will find instructions on using TouchOSC with Osculator and Ableton Live <a href="http://www.osculator.net/wp/2009/01/27/use-your-iphone-or-ipod-with-ableton-live/?n=Main/IPhoneOSCulatorAndAbletonLiveTutorial">here</a>. Windows users will find instructions to do something similar using a combination of Pure Data and MIDI Yoke <a href="http://www.shipiboconibo.com/2009/02/how-to-iphone-touchosc-pure-data-ableton-live/">here</a>.</p>
<p>Setting up TouchOSC on your home wi-fi network is a piece of cake. All you have to do is open the TouchOSC Network settings and set the host and the  outgoing and incoming ports. The ports can be whatever you want to use; I use 8000 for outgoing and 9000 for the incoming port. The host should just be YOURCOMPUTENAME.local. This worked flawlessly for me the first time I tried it.</p>
<p>If however you are not at home, or are somewhere without wi-fi, and you want to use TouchOSC with your MacBook or MacBookPro, you need to create an ad-hoc wireless network. All an ad-hoc network is is a wireless network where the communciation between devices is direct, rather than through an access point or a router. Here are the steps to create an ad-hoc network and set up TouchOSC to communicate with your Mac:</p>
<p>1. Open up System Preferences-&gt;Network.</p>
<p>2. Click on the Network Name drop down and select  Create Network.</p>
<p>3. Give your network a name. A password is optional though probably a good idea.</p>
<p>4. Click on Advanced<em>.</em></p>
<p>5. Click on the TCP/IP tab.</p>
<p>6. Click the Configure IPv4 drop down and select Manual.</p>
<p>7. Enter an IP and NetMask for your computer. I use 192.168.2.1 and 255.255.255.0.</p>
<p>8. Click OK and then Apply and close System Preferences.</p>
<p>9. On your iPhone open Settings-&gt;Wi-Fi and select the network you just created.</p>
<p>10. Click the arrow to the right of the network name.</p>
<p>11. Select Static for your IP type and enter your IP and NetMask for the iPhone. I use 192.168.2.2 for the IP. The NetMask must be the same as for the network which is 255.255.255.0.</p>
<p>12. Exit your iPhone settings and open TouchOSC.</p>
<p>13. Touch the field under the heading Network.</p>
<p>14. Enter the IP address you created for your Mac. In my case this is 192.168.2.1.</p>
<p>15. Make sure your ports are as you want them. Remember, the ports can be whatever you want to use, just make sure that they agree with whatever you are communicating with, ie OSCulator, MaxMSP, Processing etc. I use 8000 for the outgoing port and 9000 for the incoming port.</p>
<p>16. Touch the done button and then once you are at the mainscreen of TouchOSC, select your Layout and touch done again.</p>
<p>It sometimes takes a few seconds to connect to the network and open the TouchOSC Layout but once it opens you should be able to communicate with your Mac over the ad-hoc wireless network. To test out the ad-hoc network try using OSCulator or one of the Max patches provided on <a href="http://hexler.net/">hexler.net</a>. This is what worked for me; hopefully you will find that these instructions get you up and running TouchOSC over an ad-hoc network too. If you have any problems please leave a comment and I will do my best to help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/361/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Getting Started With iPhone Development</title>
		<link>http://www.musicalgeometry.com/archives/329</link>
		<comments>http://www.musicalgeometry.com/archives/329#comments</comments>
		<pubDate>Fri, 13 Mar 2009 22:56:49 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=329</guid>
		<description><![CDATA[I was recently inspired to write some apps for Apple&#8217;s iPhone. It is just way too fun a platform to resist. Having never done any development for Mac I had a lot to learn. Fortunately, as they do everything, Apple &#8230; <a href="http://www.musicalgeometry.com/archives/329">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently inspired to write some apps for Apple&#8217;s iPhone. It is just way too fun a platform to resist. Having never done any development for Mac I had a lot to learn. Fortunately, as they do everything, Apple provides excellent documentation. The getting started documents at the <a href="http://developer.apple.com/iphone/">iPhone Dev Center</a>  are a good read and the guides found in the iPhone Reference Library provide more in depth information. Apple also has guides to using XCode and Interface Builder as well as other aspects of Mac development. If you are new to Objective-C like I was, then I would suggest looking at the <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html">Introduction to The Objective-C 2.0 Programming Language</a> guide. If you are new to object oriented programming languages then the <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/OOP_ObjC/Introduction/Introduction.html">Object Oriented Programming with Objective-C</a> document will be helpful to you as well.</p>
<p>Though Apple&#8217;s documentation is great, I find that getting several different takes on the same topic helps me to learn quickly. I also find that books with examples are useful learning tools. This led me to purchase two introductory offerings on iPhone development: <a href="http://www.manning.com/callen/"><em>iPhone in Action</em></a> published by Manning and written by Christopher Allen and Shannon Appelcline and <a href="http://www.apress.com/book/view/1430216263"><em>Beginning iPhone Development</em></a> published by APress and written by Dave Mark and Jeff LaMarche.</p>
<div id="attachment_331" class="wp-caption alignnone" style="width: 224px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2009/03/iphoneinaction.jpg"><img class="size-medium wp-image-331      " style="margin-top: 8px; margin-bottom: 8px; border: black 1px solid;" title="iphoneinaction" src="http://www.musicalgeometry.com/wp-content/uploads/2009/03/iphoneinaction-238x300.jpg" alt="iPhone in Action" width="214" height="270" /></a><p class="wp-caption-text">iPhone in Action</p></div>
<p>The great thing about <em>iPhone in Action</em> is that it covers both native and web programming for the iPhone (about a third of the book). It does not assume pre-knowledge of Objective-C and even has a very brief overview of the C programming language that may be useful for someone coming from a non-C background. This is certainly not the book for someone who has no programming experience In fact, neither of these two books are aimed at people completely new to programming, but it does provide an adequate intro for Objective-C is you already know C.</p>
<p><em>iPhone in Action</em> contains many helpful examples and covers topics not found in the APress book such as customizing web pages to be viewed on the iPhone and how to POST to a web server. On the downside I sometimes found the explanations for creating the examples in the book to be unclear. For some example apps the authors&#8217; have included lists of steps to accomplish a task but they are inconsistant about flushing those steps out. In some places I needed to sift through the text to find the one tidbit that I was missing; something that could easily have been included in the step-by-step lists. Overall though it is a useful book to have in your library and will probably serve as a good reference for your iPhone projects for some time to come.</p>
<div id="attachment_330" class="wp-caption alignnone" style="width: 215px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2009/03/iphonedevelopment.jpg"><img class="size-medium wp-image-330   " style="margin-top: 8px; margin-bottom: 8px; border: black 1px solid;" title="iphonedevelopment" src="http://www.musicalgeometry.com/wp-content/uploads/2009/03/iphonedevelopment-228x300.jpg" alt="Beginning iPhone Development" width="205" height="270" /></a><p class="wp-caption-text">Beginning iPhone Development</p></div>
<p><em>Beginning iPhone Development</em> provides a great introduction to native iPhone development. Though this book does not cover web programming for the iPhone, and though it assumes knowledge of Objective-C programming, it does cover native development in greater depth than the Manning title. The explanations of the example apps that you build in this book are very clearly written. My personal preference in an introductory programming book is for a fun read that holds your hand a bit through the examples. <em>Beginning iPhone Development</em> definitely does this better than <em>iPhone in Action</em>, and does so without being patronizing.</p>
<p>At the end of the day either book will give you a good start developing apps for the iPhone. Whereas <em>iPhone in Action</em> gives a little broader treatment by including web programming and an introduction to Objective-C, <em>Beginning iPhone Development</em> covers more of the iPhone SDK and in greater depth. I personally think that these two books work great as companions, both filling in the missing bits in the other.</p>
<p>Finally I will reccomend the forums at <a href="http://www.iphonedevsdk.com/forum/">iPhone Dev SDK</a> as a great place to have your questions answered as you start developing your first apps. Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/329/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>Simple Max Serial To MIDI Patch</title>
		<link>http://www.musicalgeometry.com/archives/80</link>
		<comments>http://www.musicalgeometry.com/archives/80#comments</comments>
		<pubDate>Mon, 13 Oct 2008 05:28:05 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[MIDI]]></category>
		<category><![CDATA[MaxMSP]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[make]]></category>
		<category><![CDATA[prototyping]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=80</guid>
		<description><![CDATA[I have programmed an Arduino to output serial MIDI CC messages when I adjust potentiometers connected to it. To control my MIDI capable applications I could just send this data to a MIDI cable and then to a commercial USB-MIDI &#8230; <a href="http://www.musicalgeometry.com/archives/80">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have programmed an Arduino to output serial MIDI CC messages when I adjust potentiometers connected to it. To control my MIDI capable applications I could just send this data to a MIDI cable and then to a commercial USB-MIDI interface, but that would still require another cord to power the controller. Instead I have written a Max patch that uses the OSX IAC Driver.</p>
<p>This driver is a virtual midi device that you can use to route MIDI to, through and from. My Max patch parses the serial data from the Arduino to the IAC Driver. By choosing the IAC Driver as a MIDI input in Live (or any other MIDI capable app) you can then use the serial MIDI CC data sent from the Arduino to control your software.</p>
<p>The MIDI data that the Max patch expects at the serial input is in the standard MIDI format for a CC message; a status byte, a control number and a value. This simple patch just listens for a status byte of 176 which is a control change on channel 1. The baud rate I chose for this patch was 57600. Note that you do not have to use the standard MIDI data rate of 31250 baud.</p>
<div id="attachment_198" class="wp-caption alignnone" style="width: 310px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/09/iac-driver.jpg"><img class="size-medium wp-image-198  " style="margin-top: 8px; margin-bottom: 8px;" title="iac-driver" src="http://www.musicalgeometry.com/wp-content/uploads/2008/09/iac-driver-300x181.jpg" alt="MIDI Devices" width="300" height="181" /></a><p class="wp-caption-text">MIDI Devices</p></div>
<p>To enable the IAC Driver go to Applications-&gt;Utilities-&gt;Audio MIDI Setup, click on the MIDI Devices tab and then double click the IAC Driver icon make sure that the <em>Device is online</em> check box is checked.</p>
<p>To use this patch you need the <a href="http://www.cycling74.com/downloads/max5" target="_blank">MaxMSP Runtime.</a> Once you have that installed open it up and then open the patch with it. Double click on the <em>midiout</em> object and select the IAC Driver. Then click the button at the top of the chain to start reading the serial port and parsing the data. You should now be able to use  midi learn to map your controllers and start tweaking stuff in realtime with your potentiometers.</p>
<p>Here is what the patch looks like:</p>
<div id="attachment_83" class="wp-caption alignnone" style="width: 319px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/10/serial2midi.gif"><img class="size-full wp-image-83" title="serial2midi" src="http://www.musicalgeometry.com/wp-content/uploads/2008/10/serial2midi.gif" alt="" width="309" height="373" /></a><p class="wp-caption-text">Serial to MIDI Max patch</p></div>
<p>If you own Max just copy the following code and then paste it in a blank patcher.</p>
<p><code>----------begin_max5_patcher----------<br />
488.3ocuVsrahCCEccxWwUdclQ9QdTlcUpa5h9ETUMxPLTOJwFkXTof5+9X6<br />
.COFjvIjhDgHesu1m64dNIYabDZpdsnEA+BdEhh1FGE4C4BDsabDpludVEu0<br />
uLjR7gd5ePIcSYDqM9vapf4xJinAHE46mUspVppDFelzCA0qLmGctVYT7Zge<br />
ydrQxq1uIK4lYuKUK9ciXloCozT7OwI.kl4tkOwOvFBdaWNcGf4ykhtDPnD6<br />
0+l1cXsxM9IITa1cgkk9S2Vd+ffbg9JN18WxsQMKajJC7xyO87E4ExE4E7P3<br />
ER1I7B6+3kqW3ECovM5EKpD8n5HWs2xv6A+0ZsVx8Pm8nJgMhsvZgoQCY8PW<br />
StAccgu8kQtdsOkqVzGYMcD4jVgqZ.NjUjiwvC.Av8PBbKFeRmtfPxCSdzSy<br />
OaLc+0xRoETe2VeZpWtvRSc2RmL.qOCOxk8bcSM+xUdwnaZnO3cMDbeejQ.t<br />
lIiIw3p.2KIAkx9a.OzbPNl77fYmd8dxrioFehnJo57OovCLW7S4qV8plY6O<br />
1caWBb.ZkhViTwMRs53EcxZdWVVJTG6arRukZaKdGFf2tXyKXHE.hrBDKod2<br />
fDKDLcFU9ciIZ.Phce6brP5b2WRZRHrD99puCwxUbCPxN3q3+JxEVKJ<br />
-----------end_max5_patcher-----------</code></p>
<p>If you don&#8217;t own Max then you can download the patch <a href="http://jasonjob.net/share/myserial2midi.maxpat.zip" target="_blank">here</a>.</p>
<p>I will try and put together a more complete patch with user selectable options sometime soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/80/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Serial Communication Tool For OSX</title>
		<link>http://www.musicalgeometry.com/archives/55</link>
		<comments>http://www.musicalgeometry.com/archives/55#comments</comments>
		<pubDate>Wed, 01 Oct 2008 13:51:14 +0000</pubDate>
		<dc:creator>Jason Job</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[prototyping]]></category>

		<guid isPermaLink="false">http://www.musicalgeometry.com/?p=55</guid>
		<description><![CDATA[Coming from a Windows background I previously used HyperTerminal as a serial communication tool. When I moved to a Mac I tried an app called zterm that is a sort of HyperTerminal equivalent, but found it to be a bit &#8230; <a href="http://www.musicalgeometry.com/archives/55">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Coming from a Windows background I previously used HyperTerminal as a serial communication tool. When I moved to a Mac I tried an app called zterm that is a sort of HyperTerminal equivalent, but found it to be a bit cumbersome. The best, and my favourite way that I have found to accomplish communication over the serial port in OSX, is with a Terminal app called screen.</p>
<div id="attachment_193" class="wp-caption alignnone" style="width: 310px"><a href="http://www.musicalgeometry.com/wp-content/uploads/2008/10/terminal.jpg"><img class="size-medium wp-image-193     " style="margin-top: 8px; margin-bottom: 8px;" title="terminal" src="http://www.musicalgeometry.com/wp-content/uploads/2008/10/terminal-300x218.jpg" alt="Don't Fear The Command Line!" width="300" height="218" /></a><p class="wp-caption-text">Don&#39;t fear the command line!</p></div>
<p>To use it you first need to open Terminal via Applications-&gt;Utilities-&gt;Terminal. Then you need to get a list of the serial ports available. These devices are listed in the <code>/dev</code> folder and all start with the prefix <code>tty.</code> To see a list of all the serial ports on your computer, type:</p>
<pre><code>ls /dev/tty.*</code></pre>
<p>The <code>ls</code> is the Unix <em>list</em> command and the <code>*</code> after <code>tty.</code> is a wild card so that you are returned a list of everything in the <code>/dev</code> folder that starts with <code>tty.</code>, namely all your serial ports. To connect to one of those serial ports you need to use <em>screen.</em> The format for calling screen is:</p>
<pre><code>screen portname datarate</code></pre>
<p>For example, to connect to a serial port called /dev/tty.usbserial-A3000Xg3 at 9600 bits per second, type:</p>
<pre><code>screen /dev/tty.usbserial-A3000Xg3 9600</code></pre>
<p>Now anything you type will be sent out the serial port (though there is no local echo of your typing) and anything the serial port receives will be displayed on the screen. The command to close the serial port is <code>Control-A</code> followed by <code>Control-\.</code></p>
<p>For more info on <em>screen</em> check the man pages by typing:</p>
<pre><code>man screen</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.musicalgeometry.com/archives/55/feed</wfw:commentRss>
		<slash:comments>2</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>
