<?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>A Tasty Pixel » Blog &#187; Michael Tyson</title>
	<atom:link href="http://atastypixel.com/blog/author/Michael/feed/" rel="self" type="application/rss+xml" />
	<link>http://atastypixel.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 16 May 2012 11:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Compiling Image Resources into a Static Library</title>
		<link>http://atastypixel.com/blog/compiling-image-resources-into-a-static-library/</link>
		<comments>http://atastypixel.com/blog/compiling-image-resources-into-a-static-library/#comments</comments>
		<pubDate>Tue, 15 May 2012 20:12:23 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Interface]]></category>
		<category><![CDATA[Static Library]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2523</guid>
		<description><![CDATA[I&#8217;ve recently been working on a static library for distribution to other developers &#8212; Audiobus &#8212; and I need to include a couple of graphical resources with the distribution. The usual solution to this is to include the resources separately in a bundle, and require the user to drop them in to their project along [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been working on a static library for distribution to other developers &#8212; <a href="http://audiob.us">Audiobus</a> &#8212; and I need to include a couple of graphical resources with the distribution. The usual solution to this is to include the resources separately in a bundle, and require the user to drop them in to their project along with the static library.</p>

<p>I thought I&#8217;d see if I could make the process just a little neater, and successfully devised a way to compile the images straight into the library, so the distribution remains nice and clean &#8212; just the library itself and a few header files.</p>

<p>Now, I can pop image resources into a folder, and after compiling, access them within the static library with:</p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">UIImage <span style="color: #002200;">*</span>image <span style="color: #002200;">=</span> TPGetCompiledImage<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Button.png&quot;</span><span style="color: #002200;">&#41;</span>;</pre></div></div>


<p>It automatically handles &#8220;@2x&#8221; Retina images (although it doesn&#8217;t currently do &#8220;~ipad&#8221; versions).</p>

<p>Here&#8217;s how it&#8217;s done.</p>

<p>The magic is in a shell script which uses the <code>xxd</code> hex dump tool to create C code that represents the image data as a byte array, then creates around it a set of utilities to turn those arrays into UIImages on demand.</p>

<p>Along with it is a couple of template files &#8212; a header and implementation file &#8212; that describe the format of the derived code.</p>

<p>Finally, a little tweaking of the project in Xcode (with a brief foray into a text editor to work around some Xcode shortcomings) puts it all together.<span id="more-2523"></span></p>

<p></p>

<p><strong>Update:</strong> Fellow dev Cocoanetics pointed out that they&#8217;d solved a similar problem, and have a great write-up on <a href="http://www.cocoanetics.com/2012/02/xcode-build-rules/">how they create compiled resources using custom build rules</a> on their blog.</p>

<h2>The Image Resources</h2>

<p>…Just a bunch of <code>png</code> files within a folder inside your project directory. The script assumes there are normal and retina (<code>@2x</code>) versions of each.</p>

<h2>The Template</h2>

<p>These are the template source files from which the end result will be derived. It contains a few tags that the accompanying shell script will process. I created it in Xcode, placing it within the same folder as the source png images, but removed it from the target&#8217;s compile phase, as we&#8217;ll be adding the derived source instead.</p>

<p>First the header, <code>TPCompiledResources.h</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  TPCompiledResources.h</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  Created by Michael Tyson on 13/05/2012.</span>
<span style="color: #11740a; font-style: italic;">//  Copyright (c) 2012 A Tasty Pixel. All rights reserved.</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
<span style="color: #6e371a;">#import &lt;UIKit/UIKit.h&gt;</span>
&nbsp;
UIImage <span style="color: #002200;">*</span>TPGetCompiledImage<span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> name<span style="color: #002200;">&#41;</span>;</pre></div></div>


<p>And the implementation file, <code>TPCompiledResources.m</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  TPCompiledResources.m</span>
<span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  Created by Michael Tyson on 13/05/2012.</span>
<span style="color: #11740a; font-style: italic;">//  Copyright (c) 2012 A Tasty Pixel. All rights reserved.</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
<span style="color: #6e371a;">#import &quot;TPCompiledResources.h&quot;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">/*{%IMAGEDATA START%}*/</span>
<span style="color: #11740a; font-style: italic;">/*{%IMAGEDATA END%}*/</span>
&nbsp;
UIImage <span style="color: #002200;">*</span>TPGetCompiledImage<span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> name<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">/*{%LOAD_TEMPLATE%}
    if ( [name isEqualToString:@&quot;ORIGINAL_FILENAME&quot;] ) {
        static UIImage *_SANITISED_FILENAME_image = nil;
        if ( _SANITISED_FILENAME_image ) return _SANITISED_FILENAME_image;
&nbsp;
        if ( [[UIScreen mainScreen] scale] == 2.0 ) {
            _SANITISED_FILENAME_image = [[UIImage alloc] initWithCGImage:
                                                     [[UIImage imageWithData:[NSData dataWithBytesNoCopy:SANITISED_2X_FILENAME 
                                                                      length:SANITISED_2X_FILENAME_len freeWhenDone:NO]] CGImage] 
                                                                   scale:2.0 
                                                             orientation:UIImageOrientationUp];
        } else {
            _SANITISED_FILENAME_image = [[UIImage alloc] initWithData:[NSData dataWithBytesNoCopy:SANITISED_FILENAME 
                                                                                           length:SANITISED_FILENAME_len freeWhenDone:NO]];
        }
&nbsp;
        return _SANITISED_FILENAME_image;
    }
    {%LOAD_TEMPLATE END%}*/</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">/*{%IMAGELOADERS START%}*/</span>
    <span style="color: #11740a; font-style: italic;">/*{%IMAGELOADERS END%}*/</span>
    <span style="color: #a61390;">return</span> <span style="color: #a61390;">nil</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>


<h2>The Shell Script</h2>

<p>Here&#8217;s the script that does all the work. The script looks for all &#8220;png&#8221; images in the given folder, then creates C code representing each image along with wrapper code to give access to the image byte arrays, with help from the template.</p>

<p>This script goes into a &#8220;Run Script&#8221; phase, placed at the beginning of the library&#8217;s build process.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Where the images are (get this from the first &quot;Input Files&quot; entry)</span>
<span style="color: #007800;">RESOURCES_FOLDER</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SCRIPT_INPUT_FILE_0</span>&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The name of the source template, minus extension</span>
<span style="color: #007800;">SOURCE_NAME</span>=<span style="color: #ff0000;">&quot;TPCompiledResources&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create C arrays, representing each image</span>
<span style="color: #007800;">tmp</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$TEMP_FILES_DIR</span>/compile-images-$$.tmp&quot;</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RESOURCES_FOLDER</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">for</span> image <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.png; <span style="color: #000000; font-weight: bold;">do</span>
    xxd <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$image</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$tmp</span>.1
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Read the code template</span>
<span style="color: #007800;">TEMPLATE</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">'/{%LOAD_TEMPLATE%}/,/{%LOAD_TEMPLATE END%}/ p'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RESOURCES_FOLDER</span>/<span style="color: #007800;">$SOURCE_NAME</span>.m&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'1 d;$ d'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create loader code for each image</span>
<span style="color: #000000; font-weight: bold;">for</span> image <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*</span>.png; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$image</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-q</span> <span style="color: #ff0000;">&quot;@2x&quot;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #7a0874; font-weight: bold;">continue</span>; <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">ORIGINAL_FILENAME</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$image</span>&quot;</span>
    <span style="color: #007800;">SANITISED_FILENAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORIGINAL_FILENAME</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/[^a-zA-Z0-9]/_/g'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #007800;">SANITISED_2X_FILENAME</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SANITISED_FILENAME</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/_png/_2x_png/'</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TEMPLATE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s/ORIGINAL_FILENAME/<span style="color: #007800;">$ORIGINAL_FILENAME</span>/g;s/SANITISED_FILENAME/<span style="color: #007800;">$SANITISED_FILENAME</span>/g;s/SANITISED_2X_FILENAME/<span style="color: #007800;">$SANITISED_2X_FILENAME</span>/g&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$tmp</span>.2
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Create the source file from the template and our generated code</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;/{%IMAGEDATA START%}/ r <span style="color: #007800;">$tmp</span>.1
1,/{%IMAGEDATA START%}/!{/{%IMAGEDATA END%}/,/{%IMAGEDATA START%}/! d;}
/{%IMAGELOADERS START%}/ r <span style="color: #007800;">$tmp</span>.2
1,/{%IMAGELOADERS START%}/!{/{%IMAGELOADERS END%}/,/{%IMAGELOADERS START%]/! d;}&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RESOURCES_FOLDER</span>/<span style="color: #007800;">$SOURCE_NAME</span>.m&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DERIVED_FILE_DIR</span>/<span style="color: #007800;">$SOURCE_NAME</span>.m&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Copy the template header file in</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$RESOURCES_FOLDER</span>/<span style="color: #007800;">$SOURCE_NAME</span>.h&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DERIVED_FILE_DIR</span>/<span style="color: #007800;">$SOURCE_NAME</span>.h&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp</span>.1&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$tmp</span>.2&quot;</span></pre></div></div>


<p>The &#8220;Run Script&#8221; phase that hosts this script also needs a couple of additions, to tell Xcode what the inputs and outputs to the script are: In the &#8220;Input Files&#8221; section, the path to the image resource folder, with a &#8220;<em>&#42;.png</em>&#8221; wildcard at the end, and also the path to those template files, <code>TPCompiledResources.{h,m}</code>. Finally, the two output files go in the &#8220;Output Files&#8221; section:</p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/05/Screen-Shot-2012-05-15-at-20.42.46.png" alt="Screen Shot 2012 05 15 at 20 42 46" title="Screen Shot 2012-05-15 at 20.42.46.png" border="0" width="400" height="155" /></p>

<h2>Project Setup</h2>

<p>Now it was just a matter of setting up the project to include the derived source files in the build. This was a bit messy and took a little doing, but with guidance from this article by Ben Zado on <a href="http://www.benzado.com/blog/post/352/file-references-relative-to-derived_file_dir-in-xcode">file references relative to DERIVED_FILE_DIR</a>, it wasn&#8217;t too painful:</p>

<ol>
<li>Build, in order to generate the derived source files.</li>
<li>Navigate to the derived sources folder within the build products, and drag the <code>TPCompiledResources.{m,h}</code> into the project, placed within a new group (I called the group &#8220;Derived Sources&#8221;).</li>
<li>The path type for those files (accessible from the properties viewer &#8212; Cmd-I) should be &#8220;Relative to Enclosing Group&#8221;, and consequently the &#8220;Path&#8221; field should just show the filename, with no path component. This was a bit touch-and-go for me, and I had a hard time making this happen, so I left it as-is for now, fixing it manually later in step 8.</li>
<li>Under <em>Xcode Preferences &raquo; Locations &raquo; Source Trees</em>, add an entry with setting name &#8220;<code>DERIVED_FILE_DIR</code>&#8220;, display name &#8220;Derived Files&#8221; and path &#8220;<code>$(DERIVED_FILE_DIR)</code>&#8220;.</li>
<li>Set the path type for the group containing the two derived sources to &#8220;Relative to Derived Files&#8221;.</li>
<li>Quit Xcode, and open the <code>project.pbxproj</code> file from within your project&#8217;s bundle.</li>
<li>Find the &#8220;Derived Sources&#8221; group (or whatever it was named in step 2), and delete the &#8220;path&#8221; property from the list of attributes.</li>
<li>I had to also find the <code>TPCompiledResources.{m,h}</code> file sections and delete the &#8220;path&#8221; attribute for those, too.</li>
<li>Reopen Xcode, and build &#8212; it should be good to go (don&#8217;t worry that the derived sources are shown in red in the project group &#8212; Xcode&#8217;ll find them).</li>
</ol>

<p>Now that&#8217;s done, images can be accessed by <code>TPGetCompiledImage(@"ImageName.png")</code>. Yay!</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2523" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/compiling-image-resources-into-a-static-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I ♥ Alfred: Code execution extensions</title>
		<link>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/</link>
		<comments>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/#comments</comments>
		<pubDate>Wed, 02 May 2012 13:01:12 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Alfred]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2517</guid>
		<description><![CDATA[I&#8217;m a really big fan of Alfred, and lately I&#8217;ve found it really useful for running tiny little snippets of code &#8212; whether it&#8217;s to quickly URL decode a string, or remind myself of how C integer-to-float conversion behaves, I find myself using these little extensions I put together quite frequently. Here&#8217;re two extensions I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://atastypixel.com/blog/wp-content/uploads/2012/05/extension.png" alt="Extension" title="extension.png" border="0" width="256" height="256" style="float:right;" class="alignright" />I&#8217;m a really big fan of <a href="http://alfredapp.com/">Alfred</a>, and lately I&#8217;ve found it really useful for running tiny little snippets of code &#8212; whether it&#8217;s to quickly URL decode a string, or remind myself of how C integer-to-float conversion behaves, I find myself using these little extensions I put together quite frequently.</p>

<p>Here&#8217;re two extensions I use to run PHP code (one which just executes it and shows the result in Growl, and one which copies the result to the clipboard), and an extension that runs a snippet of C code. Of course, it wouldn&#8217;t take much to make extensions for many other languages, too.</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Execute-PHP-Code.alfredextension" title="Execute PHP Code.alfredextension" alt="Execute PHP Code">Execute PHP Code.alfredextension</a></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Execute-PHP-Code-Copy-Result1.alfredextension" title="Execute PHP Code, Copy Result.alfredextension" alt="Execute PHP Code Copy Result">Execute PHP Code, Copy Result.alfredextension</a></p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/05/Run-C-code.alfredextension" title="Run C code.alfredextension" alt="Run C code">Run C code.alfredextension</a></p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/05/Screen-Shot-2012-05-02-at-14.56.55.png" alt="Screen Shot 2012 05 02 at 14 56 55" title="Screen Shot 2012-05-02 at 14.56.55.png" border="0" width="400" height="117" /></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2517" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/i-%e2%99%a5-alfred-code-execution-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Avoiding duplicate symbol issues when using common utilities within a static library</title>
		<link>http://atastypixel.com/blog/avoiding-duplicate-symbol-issues-when-using-common-utilities-within-a-static-library/</link>
		<comments>http://atastypixel.com/blog/avoiding-duplicate-symbol-issues-when-using-common-utilities-within-a-static-library/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 12:04:44 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Static Libraries]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2503</guid>
		<description><![CDATA[I&#8217;m working on two projects right now that have static library products, to be given to other developers to use in their projects: Audiobus and The Amazing Audio Engine. In both cases, I&#8217;m making quite heavy use of my circular buffer code, TPCircularBuffer, which would result in duplicate symbol errors if the static library were [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://atastypixel.com/blog/wp-content/uploads/2012/04/Screen-Shot-2012-04-15-at-14.03.28.png" alt="Screen Shot 2012 04 15 at 14 03 28" title="Screen Shot 2012-04-15 at 14.03.28.png" border="0" width="355" height="215" style="float:right;" class="alignright" />I&#8217;m working on two projects right now that have static library products, to be given to other developers to use in their projects: <a href="http://audiob.us">Audiobus</a> and <a href="http://theamazingaudioengine.com">The Amazing Audio Engine</a>. In both cases, I&#8217;m making quite heavy use of my circular buffer code, <a href="http://github.com/michaeltyson/TPCircularBuffer">TPCircularBuffer</a>, which would result in duplicate symbol errors if the static library were linked with another project that used it.</p>

<p>In case the solution was useful to others, here&#8217;s how I worked around it: Use the preprocessor to rename the symbols automatically during the build phase.</p>

<p>This is done by adding a series of <code>-DOldSymbol=NewSymbol</code> flags to the &#8216;Other C Flags&#8217; build setting &#8211; like <code>-DTPCircularBuffer=ABCircularBuffer</code>, for instance.</p>

<p>No more symbol conflicts.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2503" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/avoiding-duplicate-symbol-issues-when-using-common-utilities-within-a-static-library/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>An Xcode 4 template to create universal static libraries</title>
		<link>http://atastypixel.com/blog/an-xcode-4-template-to-create-universal-static-libraries/</link>
		<comments>http://atastypixel.com/blog/an-xcode-4-template-to-create-universal-static-libraries/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 16:00:02 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Static Libraries]]></category>
		<category><![CDATA[Utility]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2497</guid>
		<description><![CDATA[I&#8217;ve created an Xcode 4 project template to create universal (armv6, armv7 and simulator) static libraries for iOS, based on Adam Martin&#8217;s script: iOS-Universal-Library-Template The existing static library template provided with Xcode only builds one architecture, which is not particularly suitable for distribution. A number of people have created scripts to create universal libraries, which [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created an Xcode 4 project template to create universal (armv6, armv7 and simulator) static libraries for iOS, based on <a href="http://red-glasses.com/index.php/tutorials/xcode4-make-a-library-in-one-file-that-works-on-both-device-and-simulator/comment-page-1/#comment-2226">Adam Martin&#8217;s script</a>:</p>

<p><a href="https://github.com/michaeltyson/iOS-Universal-Library-Template">iOS-Universal-Library-Template</a></p>

<p>The existing static library template provided with Xcode only builds one architecture, which is not particularly suitable for distribution. A number of people have created scripts to create universal libraries, which require some mucking around with Xcode target settings to use.</p>

<p>This template draws on this work to provide all that is required to produce universal libraries &#8211; just select the &#8216;Universal Static Library&#8217; type in the New Project/New Target dialog, and you&#8217;re all set.</p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/03/universal-static-library.jpg" alt="Universal static library" title="universal-static-library.jpg" border="0" width="450" height="305" /></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2497" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/an-xcode-4-template-to-create-universal-static-libraries/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Uploading to TestFlight with a few keystrokes, using Alfred</title>
		<link>http://atastypixel.com/blog/uploading-to-testflight-with-a-few-keystrokes-using-alfred/</link>
		<comments>http://atastypixel.com/blog/uploading-to-testflight-with-a-few-keystrokes-using-alfred/#comments</comments>
		<pubDate>Thu, 22 Mar 2012 21:11:02 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Alfred]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[TestFlight]]></category>
		<category><![CDATA[Utility]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2493</guid>
		<description><![CDATA[Here&#8217;s a cute little Alfred extension I put together today that uploads a file to a TestFlight team for you, after prompting for build notes. You&#8217;ll wanna edit the extension to put in your API key and Team ID, then just select a file in Alfred, type &#8216;testflight&#8217; (or an abbreviation thereof) and enter, then [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://atastypixel.com/blog/wp-content/uploads/2012/03/TestFlight-Icon.png" alt="TestFlight Icon" title="TestFlight Icon.png" border="0" width="100" height="100" style="float:right;" class="alignright" />Here&#8217;s a cute little Alfred extension I put together today that uploads a file to a TestFlight team for you, after prompting for build notes.</p>

<p>You&#8217;ll wanna edit the extension to put in your API key and Team ID, then just select a file in Alfred, type &#8216;testflight&#8217; (or an abbreviation thereof) and enter, then enter a build summary, and off it goes. Result will appear in Growl.</p>

<p><a href="http://atastypixel.com/blog/wp-content/uploads/2012/03/Upload-to-TestFlight.alfredextension.zip" title="Upload to TestFlight.alfredextension.zip" alt="Upload to TestFlight alfredextension">Upload to TestFlight.alfredextension.zip</a></p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/03/Screen-Shot-2012-03-22-at-22.10.00.png" alt="Screen Shot 2012 03 22 at 22 10 00" title="Screen Shot 2012-03-22 at 22.10.00.png" border="0" width="500" height="317" /></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2493" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/uploading-to-testflight-with-a-few-keystrokes-using-alfred/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Amazing Audio Engine: Funky Remote IO-based Core Audio Engine Coming Soon</title>
		<link>http://atastypixel.com/blog/the-amazing-audio-engine-funky-remote-io-based-core-audio-engine-coming-soon/</link>
		<comments>http://atastypixel.com/blog/the-amazing-audio-engine-funky-remote-io-based-core-audio-engine-coming-soon/#comments</comments>
		<pubDate>Sat, 17 Mar 2012 22:14:38 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2486</guid>
		<description><![CDATA[Huzzah! I&#8217;m announcing a new project which will be launching over the next couple of months. It&#8217;s called The Amazing Audio Engine, and it represents the product of years of experience with iOS audio. It&#8217;s a sophisticated iOS audio engine that lets developers skip the Core Audio learning curve, and get on with writing great [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://theamazingaudioengine.com"><img src="http://atastypixel.com/blog/wp-content/uploads/2012/03/amazingaudioengine.jpg" alt="The Amazing Audio Engine" title="amazingaudioengine.jpg" border="0" width="400" height="266" style="float:right; margin-left: 10px; margin-bottom: 10px;" class="alignright" /></a>Huzzah! I&#8217;m announcing a new project which will be launching over the next couple of months.</p>

<p>It&#8217;s called <a href="http://theamazingaudioengine.com">The Amazing Audio Engine</a>, and it represents the product of years of experience with iOS audio. It&#8217;s a sophisticated iOS audio engine that lets developers skip the Core Audio learning curve, and get on with writing great software.</p>

<p>The tech behind this is what drives <a href="http://loopyapp.com">Loopy and Loopy HD</a>, as well as the in-development <a href="http://audiob.us">Audiobus</a> app.</p>

<p><a href="http://theamazingaudioengine.com">Subscribe at theamazingaudioengine.com</a> to be kept in the loop as it approaches launch time.</p>

<p>Some of the features:</p>

<ul>
<li>Automatic mixing of multiple audio signals with per-channel volume and pan controls.</li>
<li>Built-in support for audio filtering and effects, including the ability to form complex filter chains, constructing channel groups, or even whole trees of groups, and filtering them as one composite signal.</li>
<li>Built-in support for audio input, including optional use of the Voice Processing IO unit, for automatic echo removal &#8211; great for VoIP.</li>
<li>Record or monitor the output of the whole audio system, for in-app session recording, or get the output of one channel, or any group of channels in the processing tree.</li>
<li>Support for any audio format (AudioStreamBasicDescription) that the hardware supports: Interleaved, non-interleaved, mono, stereo, 44.1kHz or any other supported sample rate, 16-bit, 8.24 fixed floating-point &#8211; whatever you need for your project.</li>
<li>Very light, efficient engine, designed from the ground up for speed. All Core Audio code is pure C; no Objective-   C or BSD calls, no locks, no memory allocation.</li>
<li>Efficient mixing of input signals, using Apple&#8217;s MultiChannelMixer.</li>
<li>Fast, lock-free synchronisation mechanism, enabling developers to send messages to the main thread from the Core Audio context, and vice versa, without
        locking or memory allocation from the Core Audio thread.  Message sending from the main thread is two-way, and can be asynchronous, with a response
        block, or synchronous.</li>
</ul>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2486" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/the-amazing-audio-engine-funky-remote-io-based-core-audio-engine-coming-soon/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Talking about Audiobus on a bicycle</title>
		<link>http://atastypixel.com/blog/talking-about-audiobus-on-a-bicycle/</link>
		<comments>http://atastypixel.com/blog/talking-about-audiobus-on-a-bicycle/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 16:00:37 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Audiobus]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2472</guid>
		<description><![CDATA[Lets have a chat about Audiobus, you and I. Here, you can sit on the handlebars.]]></description>
			<content:encoded><![CDATA[<p>Lets have a chat about Audiobus, you and I. Here, you can sit on the handlebars.</p>

<iframe width="560" height="315" src="http://www.youtube.com/embed/Ktp4A4z70Q4" frameborder="0" allowfullscreen></iframe>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2472" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/talking-about-audiobus-on-a-bicycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audiobus action on Tumblr</title>
		<link>http://atastypixel.com/blog/audiobus-action-on-tumblr/</link>
		<comments>http://atastypixel.com/blog/audiobus-action-on-tumblr/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 12:55:14 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Audiobus]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2468</guid>
		<description><![CDATA[I&#8217;m blogging about Audiobus&#8217;s development and other bits and pieces over on the Audiobus Tumblr blog. If you&#8217;re interested to see what I&#8217;m up to, do join me over there.]]></description>
			<content:encoded><![CDATA[<p><img src="http://atastypixel.com/blog/wp-content/uploads/2012/03/audiobus-tumblr.jpg" alt="Audiobus tumblr" title="audiobus-tumblr.jpg" border="0" width="250" height="197" style="float:right;" class="alignright" />I&#8217;m blogging about Audiobus&#8217;s development and other bits and pieces over on the <a href="http://audiobus.tumblr.com">Audiobus Tumblr blog</a>.</p>

<p>If you&#8217;re interested to see what I&#8217;m up to, do join me over there.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2468" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/audiobus-action-on-tumblr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some in-progress screenshots of my new project</title>
		<link>http://atastypixel.com/blog/some-in-progress-screenshots-of-my-new-project/</link>
		<comments>http://atastypixel.com/blog/some-in-progress-screenshots-of-my-new-project/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 17:29:17 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Audiobus]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Mockups]]></category>
		<category><![CDATA[Screenshots]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2456</guid>
		<description><![CDATA[It&#8217;s called &#8220;Audiobus&#8221;, and &#8212; yep, them&#8217;s big words &#8212; it&#8217;s going to change the way people create music on iOS. Here&#8217;re some mockups of the main interface… Subscribe here for more news about Audiobus as it happens.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s called &#8220;Audiobus&#8221;, and &#8212; yep, them&#8217;s big words &#8212; it&#8217;s going to change the way people create music on iOS.</p>

<p>Here&#8217;re some mockups of the main interface…</p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/02/a.png" alt="Audio Bus Mockup 1" title="a.png" border="0" width="260" height="209" /></p>

<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2012/02/b.jpg" alt="b" title="b.jpg" border="0" width="552" height="189" /></p>

<p><a href="http://audiob.us">Subscribe here</a> for more news about Audiobus as it happens.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2456" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/some-in-progress-screenshots-of-my-new-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some updates to TPCircularBuffer</title>
		<link>http://atastypixel.com/blog/some-updates-to-tpcircularbuffer/</link>
		<comments>http://atastypixel.com/blog/some-updates-to-tpcircularbuffer/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 10:28:09 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Optimisation]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2450</guid>
		<description><![CDATA[I&#8217;ve recently made some updates to TPCircularBuffer (on GitHub), my C circular/ring buffer implementation, which add a memory barrier on read and write, inline the main functions for a potential performance boost, and add support for use within C++ projects. If you&#8217;re using TPCircularBuffer at all, I recommend updating!]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently made some updates to <a href="http://atastypixel.com/blog/circular-ring-buffer-plus-neat-virtual-memory-mapping-trick/">TPCircularBuffer</a> (<a href="https://github.com/michaeltyson/TPCircularBuffer">on GitHub</a>), my C circular/ring buffer implementation, which add a memory barrier on read and write, inline the main functions for a potential performance boost, and add support for use within C++ projects.</p>

<p>If you&#8217;re using TPCircularBuffer at all, I recommend updating!</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2450" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/some-updates-to-tpcircularbuffer/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Twitter Image Host 2</title>
		<link>http://atastypixel.com/blog/wordpress/plugins/twitter-image-host-2/</link>
		<comments>http://atastypixel.com/blog/wordpress/plugins/twitter-image-host-2/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 12:35:38 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2415</guid>
		<description><![CDATA[Please email for details about Twitter Image Host 2]]></description>
			<content:encoded><![CDATA[<p><em>Please email for details about Twitter Image Host 2</em></p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2415" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/wordpress/plugins/twitter-image-host-2/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
		<item>
		<title>Loopy is on sale for the holidays!</title>
		<link>http://atastypixel.com/blog/loopy-is-on-sale-for-the-holidays/</link>
		<comments>http://atastypixel.com/blog/loopy-is-on-sale-for-the-holidays/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 13:03:27 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Products]]></category>
		<category><![CDATA[Loopy]]></category>
		<category><![CDATA[Loopy HD]]></category>
		<category><![CDATA[Sale]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2400</guid>
		<description><![CDATA[We&#8217;ve dropped Loopy&#8217;s price for the holiday period! Loopy HD, for iPad and iPhone, is 50% off at $3.99 (normally $7.99), and Loopy, for iPhone, is 30% off at $1.99 (normally $2.99). Happy holidays! Gift Loopy Gift Loopy HD]]></description>
			<content:encoded><![CDATA[<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2011/12/loopy-sale.jpg" alt="Loopy, the live looper for iOS, is on sale for the holidays" title="loopy-sale.jpg" border="0" width="570" height="364" /></p>

<p>We&#8217;ve dropped <a href="http://loopyapp.com">Loopy&#8217;s</a> price for the holiday period!</p>

<p><a href="http://loopyapp.com/download-hd">Loopy HD</a>, for iPad and iPhone, is 50% off at $3.99 (normally $7.99), and <a href="http://loopyapp.com/download">Loopy</a>, for iPhone, is 30% off at $1.99 (normally $2.99).</p>

<p>Happy holidays!</p>

<div style="margin-top: 50px; margin-left: 50px; display:block; width: 150px; float: left; text-align: center;">
<a style="text-decoration: none; font-size: 16px; font-weight: bold; color: #777;" href="https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/giftSongsWizard?gift=1&#038;salableAdamId=300257824&#038;productType=C&#038;pricingParameter=STDQ"><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2011/12/gift-loopy.jpg" alt="Gift loopy" title="gift-loopy.jpg" border="0" width="150" height="153" />Gift Loopy</a>
</div>

<div style="margin-top: 50px; margin-right: 50px; display:block; width: 150px; float: right; text-align: center;">
<a style="text-decoration: none; font-size: 16px; font-weight: bold; color: #777;" href="https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/giftSongsWizard?gift=1&#038;salableAdamId=467923185&#038;productType=C&#038;pricingParameter=STDQ"><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2011/12/gift-loopy-hd.jpg" alt="Gift loopy hd" title="gift-loopy-hd.jpg" border="0" width="150" height="153" />Gift Loopy HD</a>
</div>

<div style="clear: both;"></div>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2400" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/loopy-is-on-sale-for-the-holidays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circular (ring) buffer plus neat virtual memory mapping trick</title>
		<link>http://atastypixel.com/blog/circular-ring-buffer-plus-neat-virtual-memory-mapping-trick/</link>
		<comments>http://atastypixel.com/blog/circular-ring-buffer-plus-neat-virtual-memory-mapping-trick/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 13:13:20 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Optimisation]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2370</guid>
		<description><![CDATA[I&#8217;ve just updated my C circular buffer implementation, adopting the trick originally proposed by Philip Howard and adapted to Darwin by Kurt Revis: A virtual copy of the buffer is inserted directly after the end of the buffer, so that you can write past the end of the buffer, but have your writes automatically wrapped [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just updated my <a href="http://atastypixel.com/blog/a-simple-fast-circular-buffer-implementation-for-audio-processing/">C circular buffer implementation</a>, adopting the trick originally proposed by <a href="http://vrb.slashusr.org/">Philip Howard</a> and <a href="http://www.snoize.com/Code/PlayBufferedSoundFile.tar.gz">adapted to Darwin</a> by <a href="http://www.snoize.com">Kurt Revis</a>: A virtual copy of the buffer is inserted directly after the end of the buffer, so that you can write past the end of the buffer, but have your writes automatically wrapped around to the start &#8212; no need to manually implement buffer wrapping logic.</p>

<p>This dramatically simplifies the use of a circular buffer &#8212; you can use chunks of the buffer without any need to worry about where the wrap point is.</p>

<p>See the new implementation, which is thread-safe with one consumer and one producer, with no need for locks, making it perfect for use with high-priority Core Audio threads, on <a href="https://github.com/michaeltyson/TPCircularBuffer">GitHub: TPCircularBuffer</a>.</p>

<p>There&#8217;s a basic example of its use over on the <a href="http://atastypixel.com/blog/a-simple-fast-circular-buffer-implementation-for-audio-processing/">original post</a>.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2370" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/circular-ring-buffer-plus-neat-virtual-memory-mapping-trick/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Major Loopy update: Our iOS live looper just got MIDI!</title>
		<link>http://atastypixel.com/blog/major-loopy-and-loopy-hd-update-midi/</link>
		<comments>http://atastypixel.com/blog/major-loopy-and-loopy-hd-update-midi/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 18:43:05 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Products]]></category>
		<category><![CDATA[Loopy]]></category>
		<category><![CDATA[Loopy HD]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2364</guid>
		<description><![CDATA[I&#8217;m excited to announce the release of Loopy 2.2, and Loopy HD 1.1, which introduce features that the professional and semi-professional musicians are going to love: Trainable MIDI control, and MIDI clock sync! Loopy can now be entirely controlled via external MIDI devices, via the Camera Connection Kit for iPad, or any one of a [...]]]></description>
			<content:encoded><![CDATA[<p><img style="display:block; margin-left:auto; margin-right:auto;" class="aligncenter" src="http://atastypixel.com/blog/wp-content/uploads/2011/12/MIDI-Update.jpg" alt="MIDI Update" title="MIDI-Update.jpg" border="0" width="550" height="345" /></p>

<p>I&#8217;m excited to announce the release of Loopy 2.2, and Loopy HD 1.1, which introduce features that the professional and semi-professional musicians are going to love: Trainable MIDI control, and MIDI clock sync!</p>

<p>Loopy can now be entirely controlled via external MIDI devices, via the Camera Connection Kit for iPad, or any one of a number of third party adapters for the iPhone and iPod Touch.</p>

<p>With Loopy, musicians can now accomplish the kind of setup that would otherwise cost hundreds of dollars in expensive, bulky specialised equipment to achieve.</p>

<p>Controllable actions include record toggle, mute toggle, record then automatically select next track, record then overdub, toggle record with no count-in/out, clear, re-record, solo, volume, pan, tempo adjust or tempo tap, pause, double or halve clock length…</p>

<p>The update also introduces MIDI clock sync: The clock can be synchronised, in either direction, with external devices, other software (such as Ableton Live) over WiFi, software running on other iOS devices via WiFi or Bluetooth, and even other compatible apps running on the same iOS device, via virtual MIDI!</p>

<p>Oh, yeah – one more thing: Loopy on the iPhone or iPod Touch can now run up to 12 channels. Yep. Layer it up, baby.</p>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2364" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/major-loopy-and-loopy-hd-update-midi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Equipment: Busking with Loopy on a Budget</title>
		<link>http://atastypixel.com/blog/equipment-busking-with-loopy-on-a-budget/</link>
		<comments>http://atastypixel.com/blog/equipment-busking-with-loopy-on-a-budget/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 13:46:36 +0000</pubDate>
		<dc:creator>Michael Tyson</dc:creator>
				<category><![CDATA[Geekspeak]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Equipment]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Loopy]]></category>
		<category><![CDATA[Loopy HD]]></category>

		<guid isPermaLink="false">http://atastypixel.com/blog/?p=2345</guid>
		<description><![CDATA[Loopy user and forum member fonyo recently wrote an article on the Loopy forum about busking with low-budget equipment and Loopy. There was some great information in the article, so I&#8217;ve reproduced it here with some editorial modifications. I&#8217;ve been planning for a long time to do some busking. I&#8217;ve always been amazed by street [...]]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p>Loopy user and forum member <a href="http://forum.loopyapp.com/profile/44/fonyo">fonyo</a> recently wrote an article on the Loopy forum about <a href="http://forum.loopyapp.com/discussion/19/idea-of-busking-with-fairly-low-budget-equipment">busking with low-budget equipment and Loopy</a>.  There was some great information in the article, so I&#8217;ve reproduced it here with some editorial modifications.</p>
</blockquote>

<p>I&#8217;ve been planning for a long time to do some busking. I&#8217;ve always been amazed by street musicians, and can watch them for hours.  That&#8217;s why I&#8217;ve put together some thoughts on buying portable equipment.</p>

<p>In summary: For just a fraction more money than that saved by choosing Loopy instead of a single Boss RC-300 Loop Station, you can pick up a complete, high-quality busking setup, perfect for going out into the street and performing for the public.</p>

<h2>Boss RC-300 vs Loopy</h2>

<p>First, let me compare the new Boss RC-300 Loop Station with Loopy, not counting the iPhone&#8217;s/iPad&#8217;s price (because we love it and would buy it anyway!).  I chose the RC-300 as it gives you the closest number of individual loop tracks you can record/overdub</p>

<table style="margin-left: auto; margin-right: auto;">
<tr><th>Item</th><th>Cost</th><th>Number of tracks</th></tr>
<tr><th>Boss RC-300</th><td>£400 +</td><td>3 stereo</td></tr>
<tr><th>Loopy</th><td>£2</td><td>6 stereo</td></tr>
<tr><th>Loopy HD</th><td>£5</td><td>6, 9 or 12 stereo</td></tr>
</table>

<p>My point is this: let&#8217;s forget the RC-300 and save that 400 quid for other stuff to buy so we can go out and play!</p>

<h2>Equipment list</h2>

<p>Here&#8217;s my equipment list. I tried to find a balance between price and quality, while also keeping in mind portability.</p>

<table style="margin-left: auto; margin-right: auto;">
<tr><th>Item</th><th>Cost</th></tr>
<tr><td>Loopy</td><td>£2 / £5 HD</td></tr>
<tr><td>iRig G&#038;I interface</td><td>  ~£25</td></tr>
<tr><td>iRig MIDI</td><td>   ~£50</td></tr>
<tr><td>iKlip MINI</td><td>  ~£25</td></tr>
<tr><td>MOTU ZBOX</td><td>   ~£32</td></tr>
<tr><td>BEHRINGER FCB1010</td><td>   ~£95</td></tr>
<tr><td>BEHRINGER XENYX 1002 B</td><td>  ~£74</td></tr>
<tr><td>PylePro PWMA series</td><td>     ~£100-200</td></tr>
</table>

<p>Let&#8217;s see the details of each. Loopy is obvious, it&#8217;s the &#8220;core&#8221; in our iDevice and the iKlip is holding it (e.g. on a mic stand).</p>

<p>iRig guitar &amp; instrument interface is transferring the sound to the iDevice.</p>

<p>iRig MIDI to control Loopy through MIDI (I know it&#8217;s not capable of doing this yet but soon it will be!) and we connect a nice MIDI foot switch (cheap and smart) the Behringer FCB1010.  This is the only thing which needs a power supply but I&#8217;m listing it as I would go for it anyway.  I&#8217;m sure now that iRig MIDI and LINE6 Mobilizer II are released we will soon find many battery-operated or maybe even passive foot-switches for iDevices through MIDI.</p>

<p>I&#8217;m sorry to disappoint you, but an electric condenser mic like the iRig iMic just won&#8217;t give you a nice sound, and as the tests and reviews are showing it&#8217;s just not suited for professional use such as live quality street busking.</p>

<p>That&#8217;s why I came up with an idea of a small but powerful battery-operated mixer with enough inputs to handle your better quality microphones.  You can also plug in your instruments or any device with line out, such as an iPod as a music source.</p>

<p>The mixer device is the Behringer XENYX 1002B which runs on two (!) 9VDC batteries. The main output of the mixer (your gig) goes into the iRig&#8217;s TRS input. As a nice optional hardware for electric guitars with pickups, I recommend the MOTU ZBOX. It&#8217;s a miracle for guitar sound, and it&#8217;s passive so it doesn&#8217;t require any current. The Behringer 1002B has 5mic-line input OR 2mic-line/6stereo input with 3bandEQ, 2aux etc.</p>

<p>Finally, the Public Address (PA). I&#8217;ve found real luggage-like battery powered speakers made by PylePro and those are just wicked! Low-budget but nice stuff. They have wheels and handle for easy relocating, EQ, and many other cool things built-in. They give you enough power to blow away your own head with guitar riffs, beatbox, singing, so you can just use Loopy to amaze your audience! The iRig&#8217;s output goes in the PylePro&#8217;s input, and there we are.</p>

<p>You do need to buy a mic, but this way nearly anything will sound better than that electric condenser.</p>

<h2>Summary</h2>

<p>For the money you avoided spending on a Boss RC-300 LS for £400 (vs. Loopy 2 HD for £5), you can pick up nearly all this equipment &#8212; the sum is between 400-550 depending on where and what you buy or not.  Then, you&#8217;re good to go and show some real busking to the public and start a career like our Uncle Dub Fx!</p>

<blockquote>
  <p>You can discuss fonyo&#8217;s research at the <a href="http://forum.loopyapp.com/discussion/19/idea-of-busking-with-fairly-low-budget-equipment">Loopy forum</a>.</p>
</blockquote>
 <img src="http://atastypixel.com/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=2345" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://atastypixel.com/blog/equipment-busking-with-loopy-on-a-budget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

