<?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>William C. Benton &#187; Mac</title>
	<atom:link href="http://web.willbenton.com/regarding/mac/feed" rel="self" type="application/rss+xml" />
	<link>http://web.willbenton.com</link>
	<description></description>
	<lastBuildDate>Fri, 09 Sep 2011 15:40:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>A blank Keynote theme</title>
		<link>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2008%2Fa-blank-keynote-theme&#038;seed_title=A+blank+Keynote+theme</link>
		<comments>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2008%2Fa-blank-keynote-theme&#038;seed_title=A+blank+Keynote+theme#comments</comments>
		<pubDate>Thu, 13 Mar 2008 13:26:53 +0000</pubDate>
		<dc:creator>wb</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[keynote]]></category>
		<category><![CDATA[slide]]></category>

		<guid isPermaLink="false">http://web.willbenton.com/writing/2008/a-blank-keynote-theme</guid>
		<description><![CDATA[I&#8217;ve designed a couple of Keynote themes, and the biggest pain is that you can&#8217;t start from scratch: you have to begin with an existing theme. The themes that come with Keynote are fine, but they have a lot of extra junk in them (e.g. wacky faux-granite image fills for shapes and charts, etc.) that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve designed a couple of <a href="http://www.apple.com/iwork">Keynote</a> themes, and the biggest pain is that you can&#8217;t start from scratch:  you have to begin with an existing theme.  The themes that come with Keynote are fine, but they have a lot of extra junk in them (e.g. wacky faux-granite image fills for shapes and charts, etc.) that will be tedious to remove before you can do anything useful.</p>
<p>The last time I made a new theme, I went looking for a &#8220;blank theme,&#8221; hoping that someone had made one available as a starting point for new themes.  No one had, and I was in a rush.  Recently, I decided to make one, and I&#8217;m now making it available.</p>
<p>
<a href="http://web.willbenton.com/wp-content/uploads/2008/03/blank.kth.zip" title="Blank.kth.zip">Blank.kth</a> works with Keynote &#8217;08, features tasteful blue fills in charts, includes no goofy images, and defaults all text to Helvetica Neue.  To install, unarchive the zip file and drag the .kth file to <code>~/Library/Application Support/iWork/Keynote/Themes/</code>.</p>
<p>You are free to use Blank.kth for any purpose.  Please let me know if you find it useful.  Finally, I would appreciate &#8212; but do not require &#8212; that you share any derived themes with me.</p>
]]></content:encoded>
			<wfw:commentRss>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2008%2Fa-blank-keynote-theme&#038;seed_title=A+blank+Keynote+theme/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing an Audio Unit effect</title>
		<link>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2004%2Fau-effect&#038;seed_title=Developing+an+Audio+Unit+effect</link>
		<comments>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2004%2Fau-effect&#038;seed_title=Developing+an+Audio+Unit+effect#comments</comments>
		<pubDate>Fri, 10 Dec 2004 20:00:45 +0000</pubDate>
		<dc:creator>wb</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://web.willbenton.com/writing/2004/au-effect</guid>
		<description><![CDATA[UPDATE (1/2008): Note that is much easier to get started coding up DSP effects now than it was in 2004, since Xcode 3 includes AU effect and synth templates. Introduction This fall, I set out to develop a DSP music effect using Apple’s Audio Unit API. This document describes my experiences and provides pointers for [...]]]></description>
			<content:encoded><![CDATA[<p class="important-info"><em>UPDATE (1/2008):  Note that is much easier to get started coding up DSP effects now than it was in 2004, since Xcode 3 includes AU effect and synth templates.</em></p>
<h2>Introduction</h2>
<p>This fall, I set out to develop a <span class="caps">DSP</span> music effect using Apple’s <a href="http://developer.apple.com/audio/coreaudio.html">Audio Unit</a> API.  This document describes my experiences and provides pointers for other programmers who are interested in developing software using Apple’s technology.</p>
<h2>Basics</h2>
<p>Audio Units are software components that implement Apple’s plug-in interface and provide digital signal procesing and/or sound synthesis capabilities to a host program (such as a sequencer or an audio editor).  An Audio Unit may operate either as a synthesizer, generating sound, or as an effect, processing sound.  The <span class="caps">API</span> provides for flexible sound routing capabilities, including <em>m</em> to <em>n</em> channel effects and multiple-out instruments.  Finally, effect audio units may operate either in real time or offline.</p>
<h4> “Pull” model</h4>
<p>Audio Units operate with a “pull” model.  This means that, instead of a program “pushing” some amount of audio data to a (virtual or physical) audio interface, the host program invokes a callback function on every plugin at fixed intervals, synchronously “pulling” a fixed number of frames from each.  I’ve read that the pull model provides better scalability and lower latency; it seems that most current audio APIs (i.e. <a href="http://www.cs.cmu.edu/~music/portmusic/">PortAudio</a>, <a href="http://jackit.sf.net"><span class="caps">JACK</span></a>, and <a href="http://www.alsa-project.org"><span class="caps">ALSA</span></a>) require a pull model.</p>
<h4> Implementing an Audio Unit plugin</h4>
<p>To implement an Audio Unit plugin, one must write a C++ class that extends one of the Audio Unit component classes; I list some notable ones here:</p>
<ol>
<li><strong>AUEffectBase</strong> A basic audio effect</li>
<li><strong><span class="caps">AUMIDI</span>EffectBase</strong> An audio effect that can receive <span class="caps">MIDI</span> data</li>
<li><strong>MusicDeviceBase</strong> A software synthesizer that responds to <span class="caps">MIDI</span> note and continuous controller messages</li>
</ol>
<h2> Extending AUEffectBase</h2>
<p>The easiest way to start developing a subclass of AUEffectBase is to copy the SampleEffectUnit code from the developer tools.  SampleEffectUnit presents a simple effect that passes its input to its output; as such, the simple pass-through mechanism can be replaced with any custom processing code.  SampleEffectUnit assumes an <em>n</em>-in, <em>n</em>-out effect with no interactions between channels and uses a subclass of AUKernelBase to do the bulk of the <span class="caps">DSP</span> work.</p>
<h4> Using AUKernelBase</h4>
<p>The class AUKernelBase provides the interface for a monophonic processing unit; it is provided as a convenience for cases in which, like SampleEffectUnit, <em>n</em> inputs are processed independently to produce <em>n</em> outputs.  For an effect processing <em>n</em> channels, <em>n</em> objects extending AUKernelBase will be instantiated.  Therefore, each channel can have independent audio state.To build an Audio Unit effect based on AUKernelBase, subclass AUEffectBase and AUKernelBase.  You will then modify your AUEffectBase subclass.   Override the AUEffectBase::NewKernel() method to return a newly-allocated instance of your AUKernelBase subclass.  The NewKernel() method is invoked once for each channel in the AUEffectBase::MaintainKernels() method.  (This is in contrast to the documentation for NewKernel(), which is ambiguous.)The AUKernelBase subclass does all of the audio processing in the AUKernelBase::Process() method.  (Although the documentation for this method claims that it receives a stream of interleaved samples, this is not the case.)  Simply read the input samples (as 32-bit floating point values) and write the output samples.  Channel state can be stored in data members of an AUKernelBase subclass.</p>
<h4> Overriding AUEffectBase::Render()</h4>
<p>The AUKernelBase approach is convenient for common cases.  However, it is insufficiently flexible to develop an effect that does not process equal numbers of independent input and output channels.  (We’ll call the simpler effects <em>one to one</em> effects.)  When developing an effect that either has</p>
<ol>
<li>different numbers of input and output channels, or</li>
<li>interactions between channel states,</li>
</ol>
<p>one must use a more flexible method.AUEffectBase::Render() is the callback method invoked by host applications.  In its default implementation, it calls AUEffectBase::ProcessBufferLists(); in turn, the default implementation of ProcessBufferLists invokes the Process() method for each channel’s effect kernel on that channel’s input.  For non-one to one effects, you must override ProcessBufferLists to perform an appropriate mapping from input channels to output channels.</p>
<h2> Appendix:  Developing effects with state</h2>
<p>It’s pretty straightforward to develop a stateless effect—that is, one in which the value of each output sample depends solely on the value of exactly one corresponding input sample.  (Of course, there are many useful distortion-type effects that fit into this category, like waveshapers, clippers, bit-depth reducers, and so on.)  However, the “pull” model makes it a little more difficult to develop effects that require maintaining state, like filters, reverbs, and frequency-domain effects—even though some of these are straightforward to develop without the “pull” model.For example, if you were doing frequency-domain manipulation offline on an audio file, it would be as simple as reading in a chunk of audio data, performing windowing operations, performing the <span class="caps">FFT</span>, manipulating the <span class="caps">FFT</span> results, and outputting the <span class="caps">FFT</span> to an output buffer.  After doing this for all of the samples in the file, you could write the output buffer to a file.In a synchronous, “pull” environment, it’s harder.  You can’t choose which samples you get or when you get them.  Rather, you get each sample in order, exactly once, and in fixed-size buffers.  Making matters worse, you’ll have to output a fixed number of samples at the same time.  Therefore, if you want to develop an effect that relies on state, you’ll have to do some buffering yourself.  The figure below indicates the input-to-output relationship for an <span class="caps">FFT</span>-based effect with 1x overlap (click to download a printable <span class="caps">PDF</span>):</p>
<p align="center"><a href="http://willbenton.com/wb-images/mono-overlap-process.pdf"><span class="caps"><img src="http://willbenton.com/wb-images/mono-overlap-process.png" /></span></a></p>
<h2> Appendix:  References</h2>
<ol>
<li><a href="file:///Developer/Examples/CoreAudio/Documentation/AudioUnits/SDK/Classes/index.html">Audio Unit <span class="caps">SDK </span>Documentation.</a> (this is a local link and only works on a Mac with developer tools installed)</li>
<li><a href="http://www.lists.apple.com/mailman/listinfo/coreaudio-api">CoreAudio-API mailing list.</a>  A useful source for information.</li>
<li><a href="http://www.mat.ucsb.edu:8000/CoreAudio/">CoreAudio Wiki at <span class="caps">UCSB</span>.</a>  A collaborative web site with comments on several topics relating to Audio Units.</li>
<li><a href="http://www.osxaudio.com"><span class="caps">OSX</span>Audio.com.</a>  Check the “Developer forum” for some helpful tips.</li>
<li><a href="http://www.u-he.com/caugui/">Urs Heckmann’s <span class="caps">CAUGUI</span> toolkit</a> for custom interfaces</li>
<li><a href="http://augui.sourceforge.net/">Airy Andr’s <span class="caps">AUGUI</span> framework</a> also for custom interfaces</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://willbenton.com/feeder/?FeederAction=clicked&#038;feed=web.wb+&#038;seed=http%3A%2F%2Fweb.willbenton.com%2Fwriting%2F2004%2Fau-effect&#038;seed_title=Developing+an+Audio+Unit+effect/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

