<?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>Computational Artwork &#187; Audio</title>
	<atom:link href="http://matthewbrown.net.au/tag/audio/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewbrown.net.au</link>
	<description>by Matthew Brown</description>
	<lastBuildDate>Sun, 20 Jun 2010 02:37:57 +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>Iris</title>
		<link>http://matthewbrown.net.au/design/iris/</link>
		<comments>http://matthewbrown.net.au/design/iris/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 10:03:06 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[computational arts]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[microphone]]></category>
		<category><![CDATA[Quartz Composer]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/?p=91</guid>
		<description><![CDATA[I&#8217;ve been having a bit of a play with Quartz Composer since I haven&#8217;t had a chance to do much in the way of computational arts since uni finished last semester. In doing so, I came up with this, which as you can see became the background of the current website design! I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having a bit of a play with Quartz Composer since I haven&#8217;t had a chance to do much in the way of computational arts since uni finished last semester. In doing so, I came up with this, which as you can see became the background of the current website design!</p>
<p>I decided to start off with a halo generator to create a similar effect to a lens flare which I then built on with audio input from the MacBook Pro&#8217;s built-in microphone to make it a more interesting effect. Adding in a replicate in space which chances direction over 8 replications gives it the appearance of movement amongst itself, again making it a bit more interesting, but what I really like about this is that it turns it into a colourful iris, which I really quite like.</p>
<p>When the audio is fairly quiet, the iris is small and fades in and out. As the audio volume increases, the iris grows and changes colour.</p>
<p>It can be <a href="http://matthewbrown.net.au/uploads/quartz/audio_responsive/Iris.qtz">downloaded here</a>, you are welcome to have a look and play around with it as you like! Just remember, like everything else on this website, it is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/au/">Creative Commons Attribution-Noncommercial-Share Alike 2.5 Australia License</a>. So anything you do with it must attribute me as the original artist, me, be shared under a share alike license and cannot be used commercially.</p>
<p>This has been done in Quartz Composer for OS X 10.5 Leopard, so it may not work correctly on Tiger. I don&#8217;t think I&#8217;ve used anything that was new in Leopard, but I&#8217;m not sure. So if you are using Tiger, good luck!</p>
<p>I&#8217;ve rendered a video which is now up on <a href="http://www.youtube.com/watch?v=3S6cwYefNC4">YouTube</a> to give you an idea of how it looks.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/3S6cwYefNC4&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/3S6cwYefNC4&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The screen recording here has taken the mic input and used it for the animation. The song used in this recording is “Deflated &amp; Alone (GE Abondoned mix)” by <span> <a href="http://ccmixter.org/people/George_Ellinas">George_Ellinas</a></span> from <a title="http://ccmixter.org/files/George_Ellinas/19174" dir="ltr" rel="nofollow" href="http://ccmixter.org/files/George_Ellinas/19174" target="_blank">http://ccmixter.org/files/George_Ellinas/19174</a> under a Creative Commons <a title="Creative Commons Attribution License" href="http://creativecommons.org/licenses/by/3.0/">Attribution</a> 3.0 License.</p>
<p>At the moment, it is great for a little while, but unless the music is constantly changing, the interest is lost as it begins to show similar patterns repeating themselves. If you have a look at the Quartz Composition, it&#8217;s a pretty simple one really, so I&#8217;m sure there is plenty more I can do with it yet to make it that bit more interesting for a bit longer!</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/design/iris/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The New Design</title>
		<link>http://matthewbrown.net.au/misc/the-new-design/</link>
		<comments>http://matthewbrown.net.au/misc/the-new-design/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 04:46:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[visualisation]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/?p=83</guid>
		<description><![CDATA[You may have noticed things in the design gradually changing around here over the past couple of weeks. The design itself is now finished. Unfortunately though, since I&#8217;ve widened the main content section a fair bit, it&#8217;s put some of the individual posts out, such as images behind code sections. Actually, mainly images behind code [...]]]></description>
			<content:encoded><![CDATA[<p>You may have noticed things in the design gradually changing around here over the past couple of weeks.</p>
<p>The design itself is now finished. Unfortunately though, since I&#8217;ve widened the main content section a fair bit, it&#8217;s put some of the individual posts out, such as images behind code sections. Actually, mainly images behind code sections. I&#8217;ve gone through and cleaned up all of the ones I&#8217;ve found so far. If you happen across any that are still out, it would be greatly appreciated if you could leave a comment on the post to let me know.</p>
<p>Something new I have incorporated with this theme is <a title="Matthew Brown on Twitter" href="http://twitter.com/darksbane">my Twitter stream</a>, running down the bottom right of the page. I&#8217;ve had it running on my other blog, Still as Life, for a while now, figured it&#8217;s about time to put it it on here too. My tweets are more web design oriented than computational arts, and even more so just what I&#8217;m up to in general. So when I am working on something, I&#8217;ll usually be tweeting about it, be it web design, computational arts or something else. <a title="Matthew Brown on Twitter" href="http://twitter.com/darksbane">Follow me</a> if you are on Twitter and want to keep up to date on what I&#8217;m doing and my latest projects.</p>
<p>The background image I have used is a still from the output of one of my recent Quartz Composer audio visualisations. I&#8217;ll be putting it up here when I get a chance, along with a couple of variations on it.</p>
<p>Have a great one!</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/misc/the-new-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year Everyone</title>
		<link>http://matthewbrown.net.au/misc/happy-new-year-everyone/</link>
		<comments>http://matthewbrown.net.au/misc/happy-new-year-everyone/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 07:55:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[visualisation]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/?p=76</guid>
		<description><![CDATA[Happy new year to everyone out there! Best wishes to you all and a prosperous 2009 for everyone! I&#8217;ve been pretty quiet on here the past few months unfortunately as I have been pretty busy, though if you follow me on Twitter, I am relatively alive. Hopefully you&#8217;ll be seeing a few more blog posts [...]]]></description>
			<content:encoded><![CDATA[<p>Happy new year to everyone out there! Best wishes to you all and a prosperous 2009 for everyone!</p>
<p>I&#8217;ve been pretty quiet on here the past few months unfortunately as I have been pretty busy, though if you <a title="Matthew Brown on Twitter" href="http://twitter.com/darksbane">follow me on Twitter</a>, I am relatively alive. Hopefully you&#8217;ll be seeing a few more blog posts from me soon as I&#8217;ve got a number of things on the go, and a few things finished that just need to be written up.</p>
<p>I&#8217;ve been playing with Quartz Composer a fair bit and have a few new audio visualisers for you coming fairly soon, along with a new design for this blog based on one of these visualisations, so keep an eye out for it soon! The graphic design is almost finished, so hopefully I&#8217;ll get it all done up and live in the next week or two.</p>
<p>For a bit of a look at what I&#8217;ve been up to for Christmas and new years, have a look at my other blog, <a title="What I've been up to for Christmas and new years eve." href="http://blog.stillaslife.com/other/happy-new-year-everyone/">Still As Life</a> and leave your comments about what you&#8217;ve been doing too.</p>
<p>Have a fun and safe holiday everyone, and enjoy 2009!</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/misc/happy-new-year-everyone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fractalesque</title>
		<link>http://matthewbrown.net.au/design/fractalesque/</link>
		<comments>http://matthewbrown.net.au/design/fractalesque/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 10:16:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[audio spectrum]]></category>
		<category><![CDATA[computational arts]]></category>
		<category><![CDATA[Fractal]]></category>
		<category><![CDATA[LFO]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[Scott Draves]]></category>
		<category><![CDATA[visualisation]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/design/fractalesque/</guid>
		<description><![CDATA[Done with Quartz Composer with the intention of replicating the appearance of a Fractal Flame rendered through Scott Draves&#8217; Flam3, except live rendered based on audio input. This isn&#8217;t a fractal, but I think it does re-create the appearance quite well. The video quality isn&#8217;t even close to the live render quality, but it gives [...]]]></description>
			<content:encoded><![CDATA[<p>Done with Quartz Composer with the intention of replicating the appearance of a Fractal Flame rendered through Scott Draves&#8217; Flam3, except live rendered based on audio input.</p>
<p>This isn&#8217;t a fractal, but I think it does re-create the appearance quite well.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/0I6zAmiyCTc&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0I6zAmiyCTc&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The video quality isn&#8217;t even close to the live render quality, but it gives you a good idea of it.</p>
<p>The screen recording here has taken the mic input and used it for the animation. The song used in this recording is &#8220;August (Reggae Rework)&#8221; by el-B from <a href="http://ccmixter.org/files/elB/16075" target="_blank" title="http://ccmixter.org/files/elB/16075" rel="nofollow" dir="ltr">http://ccmixter.org/files/elB/16075</a> under a Creative Commons Attribution Noncommercial 3.0 License.</p>
<p>You can <a href="http://matthewbrown.net.au/uploads/quartz/fractalesque/fractalesque.qtz" title="Fractalesque" >download the Quartz file here</a>, note though that while this will open in Tiger, it will not render correctly, OS X 10.5 Leopard is required for it to run correctly.</p>
<p>It should also be noted that the video above was rendered on a Macbook Pro with an Intel Core 2 Duo 2.4ghz with 2gb of RAM and an 8600m GT and it averages 5 frames per second, so to really experience the full potential of this, it needs to run on a Mac with a fairly powerful video card like a Mac Pro, the iMac&#8217;s and new Macbook Pro&#8217;s should also render it quite nicely.</p>
<p>The reason it is so intensive is because there are a number of iterator and replicate in space patches along with LFO&#8217;s and interpolator&#8217;s that are affected by both the audio volume peak and the audio spectrum, so depending on the volume and the type of music, the visualisation develops more variation.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/design/fractalesque/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mandelbrot Player</title>
		<link>http://matthewbrown.net.au/programming/mandelbrot-player/</link>
		<comments>http://matthewbrown.net.au/programming/mandelbrot-player/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 09:01:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Fractal]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[mandelbrot]]></category>
		<category><![CDATA[Minim]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/mandelbrot-player/</guid>
		<description><![CDATA[I&#8217;ve built on my previous Frequency Mandelbrot to add basic audio playback controls to it. It no longer starts automatically upon loading, you now have to press &#8216;P&#8216; on your keyboard to begin playback and there are a number of other hot keys for different playback options. An audio file can be played, paused, rewound, [...]]]></description>
			<content:encoded><![CDATA[<p><a title="The mandelbrot before audio playback commences" href="http://matthewbrown.net.au/wp-content/uploads/2008/11/unplayed-mandelbrot.png"><img class="alignright" src="http://matthewbrown.net.au/wp-content/uploads/2008/11/unplayed-mandelbrot.thumbnail.png" alt="The mandelbrot before audio playback commences" /></a>I&#8217;ve built on my previous <a title="Frequency Mandelbrot" href="http://matthewbrown.net.au/programming/frequency-mandelbrot/">Frequency Mandelbrot</a> to add basic audio playback controls to it. It no longer starts automatically upon loading, you now have to press &#8216;<strong>P</strong>&#8216; on your keyboard to begin playback and there are a number of other hot keys for different playback options.</p>
<p>An audio file can be played, paused, rewound, and fast-forwarded. The left and right audio channels as well as beats and the overall volume are taken and used to colour a mandelbrot fractal. The left and right audio channels generate a series of lines that change speed and direction based on the audio peaks. The centre of the fractal has a constraint on it based on the beats, so as the amount of beats increase, it will freeze and stay still while the outer area of the fractal, which appears as a background continues to animate around it. And yes, it is meant to have the lines through it.</p>
<p>The keyboard controls for playback are:</p>
<p><strong>Play:</strong> P<br />
<strong>Pause:</strong> S<br />
<strong>Fast-Forward:</strong> F<br />
<strong>Rewind:</strong> R<br />
<strong>Restart:</strong> H<br />
<strong>Stop:</strong> Q</p>
<p><a title="Mandelbrot during audio playback" href="http://matthewbrown.net.au/wp-content/uploads/2008/11/playing-mandelbrot.png"><img class="alignright" src="http://matthewbrown.net.au/wp-content/uploads/2008/11/playing-mandelbrot.thumbnail.png" alt="Mandelbrot during audio playback" /></a>A note on these playback options, at the moment, &#8216;<strong>Q</strong>&#8216; will actually close the link to the song file, so this should not be used unless it is needed. Attempting to start the song again with &#8216;<strong>P</strong>&#8216; after &#8216;<strong>Q</strong>&#8216; has been used will cause Processing to error. I haven&#8217;t gotten around this as of yet unfortunately.</p>
<p>To replay a song from the start, press &#8216;<strong>H</strong>&#8216; and this will return the play head to the start of the file.</p>
<p>Rewind &#8216;<strong>R</strong>&#8216; and fast forward &#8216;<strong>F</strong>&#8216; skip the track back and forward by 500 milliseconds, so &#8216;<strong>R</strong>&#8216; should be used in place of &#8216;<strong>H</strong>&#8216; if you don&#8217;t want to return to the start of the song.</p>
<p>The source code is a little bit different to previous versions as I have added a class for keyPressed to determine what to do if the control keys are pressed:</p>
<pre class="brush: java;">

// Create the controls.
void keyPressed()
{
if ( key == 'p' ) song.play(); // Press P to play the song.
if ( key == 's' ) song.pause(); // Press S to pause playing.
if ( key == 'h' ) song.rewind(); // Press H to reset to the start.
if ( key == 'f' ) song.skip(500); // Press F to fast forward.
if ( key == 'r' ) song.skip(-500); // Press R to rewind.
if ( key == 'q' ) song.close(); // Press Q to quit playing.
}
</pre>
<p>It&#8217;s all fairly straight forward, the <a title="Minim Audio Library for Processing" href="http://code.compartmental.net/tools/minim/">Minim library</a> is very simple to use and there are some great tools in it that you can play with. I highly recommend it if you are working with audio in <a title="Processing Development Environment" href="http://www.processing.org">Processing</a>.</p>
<p>You can have a look at it <a title="Frequency Mandelbrot" href="http://matthewbrown.net.au/uploads/processing/radio_mandelbrot">in action here</a>. The song used in this piece is <a href="http://ccmixter.org/files/vo1k1/16253">“Freedom (Waking Mix)”</a> by <a href="http://ccmixter.org/people/vo1k1">vo1k1</a> 2008 &#8211; Licensed under Creative Commons <a href="http://creativecommons.org/licenses/by-nc/3.0/">Attribution Noncommercial (3.0)</a>.</p>
<p>This is fairly CPU intensive, so many computers will have trouble running this, it is also about 9mb to load so you probably don’t want to try it on a low speed connection.</p>
<p>The full source code is available from the same page as the applet, or you can see it after the jump:</p>
<p><span id="more-71"></span></p>
<pre class="brush: java;">

import ddf.minim.*;
import ddf.minim.analysis.*;

FFT fft;

AudioPlayer song;
BeatDetect beat;

float fSize;

void setup()
{
size(300, 300);

// Start Minim
Minim.start(this);

// Set the length of the sample buffers.
song = Minim.loadFile(&quot;freedom.mp3&quot;, 512);
// Uncomment song.play() to play the song as soon as the environment loads
//  song.play();
beat = new BeatDetect();

float fSize = 20;
// Tell the FFT the buffer size and sample rate.
fft = new FFT(song.bufferSize(), song.sampleRate());
}

// Create the controls.
void keyPressed()
{
if ( key == 'p' ) song.play(); // Press P to play the song.
if ( key == 's' ) song.pause(); // Press S to pause playing.
if ( key == 'h' ) song.rewind(); // Press H to reset to the start.
if ( key == 'f' ) song.skip(500); // Press F to fast forward.
if ( key == 'r' ) song.skip(-500); // Press R to rewind.
if ( key == 'q' ) song.close(); // Press Q to quit playing.
}

void draw()
{
background(0);
// Run a mix FFT
fft.forward(song.mix);
fill(255);

loadPixels();

// Maximum number of iterations for each point.
float maxiterations = 200; // Lower renders quicker
float xmin = -2.5;
float ymin = -2;
float wh = 2;

// Detect the beats in the song mix
beat.detect(song.mix);
// Iterate fSize based on beats.
if ( beat.isOnset() ) fSize += 0.1;

// Restrict fSize to create variation when the beat count gets too high.
fSize = constrain(fSize, -10, 10);

ymin = -1;
xmin = -1.5;

maxiterations = maxiterations + fSize;

// x goes from xmin to xmax
float xmax = xmin + wh;
// y goes from ymin to ymax
float ymax = ymin + wh;

// Calculate amount we increment x,y for each pixel
float dx = (xmax - xmin) / (width);
float dy = (ymax - ymin) / (height);

// Start y
float y = ymin;
for(int j = 0; j &lt; height; j++) {
// Start x
float x = xmin;
for(int i = 0;  i &lt; width; i++) {

float a = x;
float b = y;
int n = 0;

while (n &lt; maxiterations) {
float aa = a * a;
float bb = b * b;
float twoab = 2.0 * a * b;
a = aa - bb + x;
b = twoab + y;
if(aa + bb &gt; 16.0f) {
break;
}
n++;
}

// Colouring pixels using the left and right audio channels - song.right.get(i) etc.
if (n == maxiterations) pixels[i+j*width] = 0;
else pixels[i+j*width] = color(n*(song.right.get(i)*50) % 255, n*(song.left.get(i)*50) % 200, n*(song.right.get(i)*30));
x += dx;
}
y += dy;
}
updatePixels();
}

// End Minim after the song finishes playing.
void stop()
{
song.close();
super.stop();
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/mandelbrot-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plasma Box &#8211; Quartz Composer</title>
		<link>http://matthewbrown.net.au/design/plasma-box-quartz-composer/</link>
		<comments>http://matthewbrown.net.au/design/plasma-box-quartz-composer/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 01:34:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[LFO]]></category>
		<category><![CDATA[microphone]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Plasma]]></category>
		<category><![CDATA[Quartz Composer]]></category>
		<category><![CDATA[visualisation]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/design/plasma-box-quartz-composer/</guid>
		<description><![CDATA[This is a fairly simple Quartz Composer visualisation that I developed to be a screensaver or to run in the background of an environment to help develop an atmosphere. The idea originally came from when I was walking past the Chalk Hotel in Woolloongabba in winter and noticed that they had big LCD&#8217;s on a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/wp-content/uploads/2008/11/plasma-box.png" title="Plasma Box - Quartz Composer"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/11/plasma-box.thumbnail.png" class="alignright" alt="Plasma Box - Quartz Composer" /></a>This is a fairly simple Quartz Composer visualisation that I developed to be a screensaver or to run in the background of an environment to help develop an atmosphere. The idea originally came from when I was walking past the Chalk Hotel in Woolloongabba in winter and noticed that they had big LCD&#8217;s on a couple of walls playing a video loop of a fire to help create the sense of warmth and a warm atmosphere, even though there was almost no heat actually being produced by the LCD&#8217;s.</p>
<p>What I have created here is floating plasma that slowly floats from the bottom to the top of the screen and accumulates at the top. Audio input is taken from the microphone and combined with an LFO so that it is constantly varying between the base colours that the LFO covers and then other colours dependent on audio spikes. The audio input is also used to make the plasma &#8220;shy&#8221;, that is, as the input volume increases, the plasma starts to get smaller and disappear until the volume starts to subside again, then it comes back.</p>
<p>The basis of this is created with a Quartz Flame Image patch, ideally, I would have liked to redo this with a more controllable particle system, but that is for another time.</p>
<p><a href="/uploads/quartz/floating_plasma/plasma7.qtz" title="Plasma Box">Download the Quartz Composer file here</a>. Note that this requires OS X 10.5 Leopard. It will not work in Tiger as I have used patches that were not available in Tiger.</p>
<p>Check out the video below which shows the visualisation running with the song &#8220;<a href="http://ccmixter.org/files/duckett/17456" title="Wired but Disconnected by duckett">Wired but Disconnected</a>&#8221; by <a href="http://ccmixter.org/people/duckett" title="duckett">duckett</a>.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/BX5heolZ80U&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/BX5heolZ80U&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/design/plasma-box-quartz-composer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frequency Mandelbrot</title>
		<link>http://matthewbrown.net.au/programming/frequency-mandelbrot/</link>
		<comments>http://matthewbrown.net.au/programming/frequency-mandelbrot/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 08:52:35 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[beat detection]]></category>
		<category><![CDATA[Fractal]]></category>
		<category><![CDATA[frequency energy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Minim]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/frequency-mandelbrot/</guid>
		<description><![CDATA[Where I had been experimenting with just the outsides of the mandelbrot before, I&#8217;ve started having a look at modifying the inside of the fractal as well. I&#8217;ve continued to use the frequency spectrum for the effects simply because it goes with the frequency spectrum used in the background. import ddf.minim.*; import ddf.minim.analysis.*; FFT fft; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/uploads/processing/radio_mandelbrot" title="Frequency Mandelbrot"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/radio_mandelbrot_1.thumbnail.png" class="alignright" alt="Frequency Mandelbrot 1" /></a>Where I had been experimenting with just the outsides of the mandelbrot <a href="http://matthewbrown.net.au/programming/using-the-output-of-minim-in-processing/" title="Manipulating Minim Output">before</a>, I&#8217;ve started having a look at modifying the inside of the fractal as well. I&#8217;ve continued to use the frequency spectrum for the effects simply because it goes with the frequency spectrum used in the background.</p>
<pre class="brush: java;">
import ddf.minim.*;
import ddf.minim.analysis.*;

FFT fft;

AudioPlayer song;
BeatDetect beat;

float fSize;

void setup()
{
size(300, 300);

// always start Minim first!
Minim.start(this);

// specify 512 for the length of the sample buffers
// the default buffer size is 1024
song = Minim.loadFile(&quot;freedom.mp3&quot;, 512);
song.play();
beat = new BeatDetect();

float fSize = 20;
// an FFT needs to know how
// long the audio buffers it will be analyzing are
// and also needs to know
// the sample rate of the audio it is analyzing is
fft = new FFT(song.bufferSize(), song.sampleRate());
}

void draw()
{
background(0);
// first perform a forward fft on one of song's buffers
// I'm using the mix buffer
//  but you can use any one you like
fft.forward(song.mix);
fill(255);

loadPixels();

// Maximum number of iterations for each point on the complex plane
float maxiterations = 200;
float xmin = -2.5;
float ymin = -2;
float wh = 2;

beat.detect(song.mix);
if ( beat.isOnset() ) fSize += 0.1;

fSize = constrain(fSize, -10, 10);

ymin = -1;
xmin = -1.5;

maxiterations = maxiterations + fSize;

// x goes from xmin to xmax
float xmax = xmin + wh;
// y goes from ymin to ymax
float ymax = ymin + wh;

// Calculate amount we increment x,y for each pixel
float dx = (xmax - xmin) / (width);
float dy = (ymax - ymin) / (height);

// Start y
float y = ymin;
for(int j = 0; j &lt; height; j++) {
// Start x
float x = xmin;
for(int i = 0;  i &lt; width; i++) {

// Now we test, as we iterate z = z^2 + cm does z tend towards infinity?
float a = x;
float b = y;
int n = 0;
while (n &lt; maxiterations) {
float aa = a * a;
float bb = b * b;
float twoab = 2.0 * a * b;
a = aa - bb + x;
b = twoab + y;
// Infinty in our finite world is simple, let's just consider it 16
if(aa + bb &gt; 16.0f) {
break;         }
n++;
}

// We color each pixel based on how long it takes to get to infinity
// If we never got there, let's pick the color black
if (n == maxiterations) pixels[i+j*width] = 0;
else pixels[i+j*width] = color(n*(song.right.get(i)*50) % 255, n*(song.left.get(i)*50) % 200, n*(song.right.get(i)*30));
x += dx;
}
y += dy;
}
updatePixels();
}

void stop()
{
song.close();
super.stop();
}
</pre>
<p><a href="http://matthewbrown.net.au/uploads/processing/radio_mandelbrot" title="Frequency Mandelbrot"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/radio_mandelbrot_2.thumbnail.png" class="alignright" alt="Frequency Mandelbrot 2" /></a>In this version I have used the BeatDetect class and another variable, fSize with a constraint on it and then added to the maximum iterations. This allows the frequency spectrum to spread through the mandelbrot fractal, or appear to anyway. It is actually just using the frequency spectrum to colour the fractal, and this makes it appear like spectrum is forming the fractal.</p>
<p>You can have a look at it <a href="http://matthewbrown.net.au/uploads/processing/radio_mandelbrot" title="Frequency Mandelbrot">in action here</a>. The song used in this piece is <a href="http://ccmixter.org/files/vo1k1/16253">“Freedom (Waking Mix)”</a> by <a href="http://ccmixter.org/people/vo1k1">vo1k1</a> 2008 &#8211; Licensed under Creative Commons <a href="http://creativecommons.org/licenses/by-nc/3.0/">Attribution Noncommercial (3.0)</a>.</p>
<p>This is fairly CPU intensive, so many computers will have trouble running this, it is also about 13mb to load so you probably don&#8217;t want to try it on a low speed connection.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/frequency-mandelbrot/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Minim and Beat Detection</title>
		<link>http://matthewbrown.net.au/programming/minim-and-beat-detection/</link>
		<comments>http://matthewbrown.net.au/programming/minim-and-beat-detection/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 12:04:29 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[beat detection]]></category>
		<category><![CDATA[frequency energy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Minim]]></category>
		<category><![CDATA[sound energy]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/minim-and-beat-detection/</guid>
		<description><![CDATA[While I was looking through the Minim documentation, I came across the built in BeatDetect class that analyses the audio input for beats. My understanding is that it looks for patterns in the rhythm to determine individual beats of a particular type, be it the bass drum, snare, cymbals etc. It has a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>While I was looking through the Minim documentation, I came across the built in <a href="http://code.compartmental.net/tools/minim/manual-beatdetect/" title="The Minim BeatDetect Class">BeatDetect class</a> that analyses the audio input for beats. My understanding is that it looks for patterns in the rhythm to determine individual beats of a particular type, be it the bass drum, snare, cymbals etc. It has a couple of modes for detecting beats, one is sound energy mode and the other is frequency energy mode.</p>
<p>Sound energy mode just looks for spikes in the audio mix levels and returns a boolean response of true when a spike occurs.</p>
<p>Frequency energy mode allows you to look at particular frequency bands and use their output the same way you would the output of sound energy mode.</p>
<p>I decided to have a play with the sample code using frequency energy mode that is provided in the documentation to figure out how to control it and so on.</p>
<p>The sample code checks the frequency bands for the snare, kick/bass drum and high hats and then has text for each one that responds to the audio input for their particular band.</p>
<p>I didn&#8217;t do anything overly complex with this as of yet, just changed the objects that are manipulated to boxes rather than text so I could get an idea of of what does what.</p>
<p>Here is the code that I ended up with after my changes:</p>
<pre class="brush: java;">
import ddf.minim.*;
import ddf.minim.analysis.*;

class BeatListener implements AudioListener
{
private BeatDetect beat;
private AudioPlayer source;

BeatListener(BeatDetect beat, AudioPlayer source)
{
this.source = source;
this.source.addListener(this);
this.beat = beat;
}

void samples(float[] samps)
{
beat.detect(source.mix);
}

void samples(float[] sampsL, float[] sampsR)
{
beat.detect(source.mix);
}
}

AudioPlayer song;
BeatDetect beat;
BeatListener bl;

float kickSize, snareSize, hatSize;

void setup()
{
size(512, 200);
smooth();
Minim.start(this);
song = Minim.loadFile(&quot;song.mp3&quot;, 1024);
song.play();
// a beat detection object that is FREQ_ENERGY mode that
// expects buffers the length of song's buffer size
// and samples captured at songs's sample rate
beat = new BeatDetect(song.bufferSize(), song.sampleRate());
beat.setSensitivity(300);
kickSize = snareSize = hatSize = 16;
// make a new beat listener, so that we won't miss any buffers for the analysis
bl = new BeatListener(beat, song);
}

void draw()
{
background(0);
fill(255);
if ( beat.isKick() ) kickSize = 32;
if ( beat.isSnare() ) snareSize = 32;
if ( beat.isHat() ) hatSize = 32;
stroke(255);
strokeWeight(kickSize);
rect(width/4, height/2, 20, 20);
stroke(255);
strokeWeight(snareSize);
rect(width/2, height/2, 20, 20);
stroke(255);
strokeWeight(hatSize);
rect(3*width/4, height/2, 20, 20);
kickSize = constrain(kickSize * 0.95, 16, 32);
snareSize = constrain(snareSize * 0.95, 16, 32);
hatSize = constrain(hatSize * 0.95, 16, 32);
}

void stop()
{
// always close Minim audio classes when you are finished with them
song.close();
// always stop Minim before exiting
Minim.stop();

// this closes the sketch
super.stop();
}
</pre>
<p>For this to work, make sure you have an MP3 or Wav file in a data folder within the sketch directory for this sketch and change song.mp3 to the filename of your song.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/minim-and-beat-detection/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using The Output of Minim in Processing</title>
		<link>http://matthewbrown.net.au/programming/using-the-output-of-minim-in-processing/</link>
		<comments>http://matthewbrown.net.au/programming/using-the-output-of-minim-in-processing/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 11:01:53 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Fractal]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[mandelbrot]]></category>
		<category><![CDATA[Minim]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/misc/using-the-output-of-minim-in-processing/</guid>
		<description><![CDATA[After following the quick start guide on the Minim website, I put together a little waveform generator that produces a waveform for the left and right channels based on the input of an audio file along with a frequency spectrum running over the top of it. The instructions are pretty easy to follow, and the [...]]]></description>
			<content:encoded><![CDATA[<p>After following <a href="http://code.compartmental.net/tools/minim/quickstart/" title="Minim Quick Start Guide">the quick start guide</a> on the Minim website, I put together a little waveform generator that produces a waveform for the left and right channels based on the input of an audio file along with a frequency spectrum running over the top of it. The instructions are pretty easy to follow, and the additional functionality of Minim seems fairly simply to harness to do something useful with.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/minim4/" title="Minim Output 4"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim4.thumbnail.png" class="alignright" alt="Minim Output 4" /></a>I&#8217;ve since taken the code from that guide and combined it with a mandelbrot fractal from <a href="http://www.processing.org/learning/topics/mandelbrot.html" title="Mandelbrot in Processing">the Processing tutorials and references</a>. At the moment, the mandelbrot doesn&#8217;t really do anything near like what I want it to do, but I am making some progress in figuring out what I can do with Minim and how I can use it for what I want to do.</p>
<p>Initially I took the frequency spectrum and used it to colour parts of the mandelbrot.  To start with I only manipulated the red colouring of the fractal to see what would happen which gave me this (you may need to scroll to the right in some places sorry):</p>
<pre class="brush: java;">
import ddf.minim.*;
import ddf.minim.analysis.*;

AudioPlayer song;
FFT fft;

float xmin = -2.5;
float ymin = -2;
float wh = 4;

void setup()
{
size(300, 300);

// always start Minim first!
Minim.start(this);

// specify 512 for the length of the sample buffers
// the default buffer size is 1024
song = Minim.loadFile(&quot;song.mp3&quot;, 512);
song.play();

// an FFT needs to know how
// long the audio buffers it will be analyzing are
// and also needs to know
// the sample rate of the audio it is analyzing is
fft = new FFT(song.bufferSize(), song.sampleRate());
}

void draw()
{
background(0);
// first perform a forward fft on one of song's buffers
// I'm using the mix buffer
//  but you can use any one you like
fft.forward(song.mix);

loadPixels();

// Maximum number of iterations for each point on the complex plane
int maxiterations = 200;

// x goes from xmin to xmax
float xmax = xmin + wh;
// y goes from ymin to ymax
float ymax = ymin + wh;

// Calculate amount we increment x,y for each pixel
float dx = (xmax - xmin) / (width);
float dy = (ymax - ymin) / (height);

// Start y
float y = ymin;
for(int j = 0; j &lt; height; j++) {
// Start x
float x = xmin;
for(int i = 0;  i &lt; width; i++) {

// Now we test, as we iterate z = z^2 + cm does z tend towards infinity?
float a = x;
float b = y;
int n = 0;
while (n &lt; maxiterations) {
float aa = a * a;
float bb = b * b;
float twoab = 2.0 * a * b;
a = aa - bb + x;
b = twoab + y;
// Infinty in our finite world is simple, let's just consider it 16
if(aa + bb &gt; 16.0f) {
break;  // Bail
}
n++;
}

// We color each pixel based on how long it takes to get to infinity
// If we never got there, let's pick the color black
if (n == maxiterations) pixels[i+j*width] = 0;
else pixels[i+j*width] =
color(n*(song.right.get(i)*50) % 255, n*16 % 200, n*16 % 100);
x += dx;
}
y += dy;
}
updatePixels();
}

void stop()
{
song.close();
super.stop();
}
</pre>
<p>To make the above work, you&#8217;ll need to put an MP3 or Wav audio file in a &#8220;data&#8221; directory within the sketch folder for this sketch and change song.mp3 to the name of your audio file. You can <a href="http://matthewbrown.net.au/uploads/processing/minim4/" title="Minim Output 4">see it in action here</a>. The song used in this piece is <a href="http://ccmixter.org/files/vo1k1/16253">&#8220;Freedom (Waking Mix)&#8221;</a> by <a href="http://ccmixter.org/people/vo1k1">vo1k1</a> 2008 &#8211; Licensed under Creative Commons <a href="http://creativecommons.org/licenses/by-nc/3.0/">Attribution Noncommercial (3.0)</a>.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/minim5/" title="Minim Output 5a"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim5b.thumbnail.png" class="alignright" alt="Minim Output 5a" /></a>It will run a series of lines of various lengths and thicknesses at varying speeds based on the input of the audio file.</p>
<p>Considering how cool this was looking, I decided to add the left audio channel for the green colouring to see what would happened, so I modified the colouring to the following:</p>
<pre class="brush: java;">
if (n == maxiterations) pixels[i+j*width] = 0;
else pixels[i+j*width] = color(n*(song.right.get(i)*50) % 255, n*(song.left.get(i)*50) % 200, n*16 % 100);
</pre>
<p><a href="http://matthewbrown.net.au/uploads/processing/minim5/" title="Minim Output 5c"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim5c.thumbnail.png" class="alignright" alt="Minim Output 5c" /></a>This is actually really cool, if you run an audio track through it that has a distinctively different left and right channel you get much more variation in the colouring and it appears to be synced more with the music.</p>
<p>If you try the above, you&#8217;ll get reds coming through for the right channel, greens coming through for the left and yellows where they overlap. Since you have two different sets of lines, you can see them change with each channel, rather than only with one channel, this is why it seems to be synced up better, and the colour changes help with this since the colours match the left and right mix. You can <a href="http://matthewbrown.net.au/uploads/processing/minim5/" title="Minim Output 5">see it in action here</a>. The song used in this piece is <a href="http://ccmixter.org/files/vo1k1/16253">&#8220;Freedom (Waking Mix)&#8221;</a> by <a href="http://ccmixter.org/people/vo1k1">vo1k1</a> 2008 &#8211; Licensed under Creative Commons <a href="http://creativecommons.org/licenses/by-nc/3.0/">Attribution Noncommercial (3.0)</a>.</p>
<p>Adding the second colouring control in also makes colour variations immediately around the main parts of the mandelbrot more prominent, and as they change it makes the fractal appear to be behaving like it is encircled with flames.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/minim7/" title="Minim Output 7a"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim7a.thumbnail.png" class="alignright" alt="Minim Output 7a" /></a>This does make the background blue though rather than grey which I don&#8217;t like too much since the fractal doesn&#8217;t stand out as much with the blue background as it did grey.</p>
<p>I decided to change the colouring again slightly, this time using the audio mix to control the blue colouring. I used the right audio channel again, no particular reason really. So this is what my colouring looks like now:</p>
<pre class="brush: java;">
if (n == maxiterations) pixels[i+j*width] = 0;
else pixels[i+j*width] = color(n*(song.right.get(i)*50) % 255, n*(song.left.get(i)*50) % 200, n*(song.right.get(i)*30));
</pre>
<p class="alignright"> <a href="http://matthewbrown.net.au/uploads/processing/minim7/" title="Minim Output 7e"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim7c.thumbnail.png" alt="Minim Output 7e" /></a><br />
<a href="http://matthewbrown.net.au/uploads/processing/minim7/" title="Minim Output 7c"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/09/minim7e.thumbnail.png" alt="Minim Output 7c" /></a></p>
<p>You can <a href="http://matthewbrown.net.au/uploads/processing/minim4/" title="Minim Output 4">see it in action here</a>. The song used in this piece is <a href="http://ccmixter.org/files/vo1k1/16253">&#8220;Freedom (Waking Mix)&#8221;</a> by <a href="http://ccmixter.org/people/vo1k1">vo1k1</a> 2008 &#8211; Licensed under Creative Commons <a href="http://creativecommons.org/licenses/by-nc/3.0/">Attribution Noncommercial (3.0)</a>.</p>
<p>This has the same left and right channel variation and effects as the previous version, but it changes the colours slightly, the lines are now variations or predominately green and purple with a black background. This makes the mandelbrot stand out much more than before, but it also makes the appearance of flames around the fractal much more prominent as they are now blue closest to the fractal and shades of purple the further out you go. This looks really cool and makes the flames even more realistic (except for the colouring of course) and the flames now appear to reach out further making them stand and their variations stand out more.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/using-the-output-of-minim-in-processing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Playing Audio in Processing</title>
		<link>http://matthewbrown.net.au/programming/playing-audio-in-processing/</link>
		<comments>http://matthewbrown.net.au/programming/playing-audio-in-processing/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 08:25:16 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[audio spectrum]]></category>
		<category><![CDATA[Minim]]></category>
		<category><![CDATA[Processing]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/playing-audio-in-processing/</guid>
		<description><![CDATA[I&#8217;ve been looking at how to import an audio source into Processing so that it can be used to manipulate a visual output. Using the Minim sound library I should be able to manipulate things based on either an audio file or an audio input through the line-in or mic-in. I have been going through [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking at how to import an audio source into Processing so that it can be used to manipulate a visual output. Using the Minim sound library I should be able to manipulate things based on either an audio file or an audio input through the line-in or mic-in.</p>
<p>I have been going through the <a href="http://code.compartmental.net/tools/minim/quickstart/" title="Minim Quick Start Guide">Quick Start Guide</a> which is very useful and having finished it, I have a Processing sketch that will playback a file and display the audio spectrum and waveforms which is pretty cool. I can see how I should be able to use the audio controls to manipulate an image, so I think I&#8217;m going to start having an experiment with applying the similar concepts to other images.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/playing-audio-in-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

