<?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; Lines</title>
	<atom:link href="http://matthewbrown.net.au/tag/lines/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>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>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>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>Walking Lines 3 &#8211; Processing</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-3-processing/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-3-processing/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 00:51:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-3-processing/</guid>
		<description><![CDATA[I received some feedback on my earlier versions of the walking lines in the form of a trackback from Alex. The feedback was part of a practice peer review, but he went into some detail on how i could fix up my current code so that the lines follow on from each other and how [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://matthewbrown.net.au/wp-content/uploads/2008/08/semi_random_line3.png' title='Walking Lines 3, joining lines.'><img src='http://matthewbrown.net.au/wp-content/uploads/2008/08/semi_random_line3.thumbnail.png' alt='Walking Lines 3, joining lines.' class="alignright" /></a>I received some feedback on my earlier versions of the walking lines in the form of <a href="http://alexkkb210.wordpress.com/2008/08/17/peer-review-1/" title="Walking Lines Feedback">a trackback from Alex</a>.</p>
<p>The feedback was part of a practice peer review, but he went into some detail on how i could fix up my current code so that the lines follow on from each other and how to reduce the load on the CPU per cycle with the same effect. The advice is greatly appreciated.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/semi_random_lines_3/index.html" title="Walking Lines 3">View the new version online here.</a></p>
<p>The changes and source code are after the jump.</p>
<p><span id="more-53"></span></p>
<p>Originally I had:</p>
<pre class="brush: java;">
float x = random(width);
float y = random(height);
float x2 = random(width);
float y2 = random(height);void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{
x += int(random(width*2)-width);
y += int(random(height*2)-height);
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
stroke(random(255));
line(x, y, x2, y2);
}
</pre>
<p>Now I have:</p>
<pre class="brush: java;">

float x = random(width);
float y = random(height);
float x2 = 0;
float y2 = 0;
float tempx = 0;
float tempy = 0;

void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{

x2 = random(-width, width);
y2 = random(-height, height);
stroke(random(255));
line(x, y, x2, y2);
x = x2;
y = y2;
}
</pre>
<p>The main changes are assigning the results of the random set of coordinates to the original coordinates with:</p>
<pre class="brush: java;">
x = x2;
y = y2;
</pre>
<p>These variables (x, y) were assigned 0 values initially and this is then replaced by the new coordinates at the end of every draw() cycle.</p>
<p>The other main change is the reduced load on the CPU with:</p>
<pre class="brush: java;">
x2 = random(-width, width);
y2 = random(-height, height);
</pre>
<p>This is in place of:</p>
<pre class="brush: java;">
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
</pre>
<p>Thats about it, ideally I should fix the colour changes as well so that they aren&#8217;t sharp changes with each line, but a gradual fade from one to another. I&#8217;ll see how I go experimenting with that and throw it up here as well when I get a chance.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-3-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fractals and Influences</title>
		<link>http://matthewbrown.net.au/misc/fractals-and-influences/</link>
		<comments>http://matthewbrown.net.au/misc/fractals-and-influences/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 12:31:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[misc]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[computational arts]]></category>
		<category><![CDATA[Fractals]]></category>
		<category><![CDATA[Influences]]></category>
		<category><![CDATA[kkb210]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[QUT]]></category>
		<category><![CDATA[Scott Draves]]></category>
		<category><![CDATA[Visuals]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/misc/fractals-and-influences/</guid>
		<description><![CDATA[Fractals have always particularly appealed to me. They seem chaotic and yet orderly. I actually focussed on this concept in year 12 for my major art work which was selected to be featured in 5 galleries across NSW. If you look at my Deviant Art account at all, you&#8217;ll notice that it is absolutely full [...]]]></description>
			<content:encoded><![CDATA[<p>Fractals have always particularly appealed to me. They seem chaotic and yet orderly. I actually focussed on this concept in year 12 for my major art work which was selected to be featured in 5 galleries across NSW.</p>
<p><a href="http://blog.stillaslife.com/wp-content/gallery/00-single/trisymmetryglow1280.jpg" title="One of my fractals"><img src="http://blog.stillaslife.com/wp-content/gallery/00-single/normal_trisymmetryglow1280.jpg" alt="One of my fractals" style="border: 0pt none ; margin-left: 10px" /></a></p>
<p>If you look at <a href="http://raolain.deviantart.com/" title="Matt's Deviant Art Account">my Deviant Art account</a> at all, you&#8217;ll notice that it is absolutely full of fractal stills. I also had some big A1 and A2 fractal prints on exhibition, as well as an animation, at a recent inter-university festival between QUT and UQ. So I can easily say that fractals are definitely where my love in art is at. Since I first began experimenting with fractals, there has been one particularly big influence in my work, and that has been the work of Scott Draves aka <a href="http://draves.org" title="Scott Draves aka Spot">Spot</a>.</p>
<p>Spot&#8217;s work has been of interest to me basically since I began working with fractals and it continues to do so.</p>
<p>He has done a lot of work in fractals and started the <a href="http://flam3.com/" title="Flam3">Flam3</a>, <a href="http://electricsheep.org/" title="Electric Sheep">Electric Sheep</a> and <a href="http://hifidreams.com/" title="Dreams in High Fidelity">Dreams in High Fidelity</a> projects, all of which are quite influential on my work, both in fractals and in other computational arts.</p>
<p>Not all of his work has been focused on fractals, but many of his idea&#8217;s share similarities with them. One example of this are his <a href="http://draves.org/dub/" title="Dub Visuals">Dub Visuals</a> which take chaotic still images and morph them, to form other still images in a flow similar to that of the evolution of his fractal animations.</p>
<p>I have previously done fractal animations where they are synced with music, both music performed by another artist and music that I have composed myself. However, this hasn&#8217;t been done in real time and has been a long process to setup each portion of the animation and sync it up with the music. Ultimately, I would love to develop a way of rendering fractals, even low quality or low resolution fractals in real-time based on audio input. Basically this would be combining the work I have done previously with the basic concepts of what I did for KKB210 where I did a series of <a href="http://matthewbrown.net.au/programming/audio-responsive-lines-2/" title="Audio Responsive Lines">lines</a> and <a href="http://matthewbrown.net.au/programming/audio-responsive-particles-3/" title="Audio Responsive Particles">boxes</a> that responded to audio input. The lines one was probably getting close, though ultimately no where near as detailed as I would like it to be, and definitely nowhere near as chaotic and fractal-like as I want.</p>
<p>That is my aim though and hopefully I will get to it sooner or later.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/misc/fractals-and-influences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Walking Lines 2</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-2/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-2/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 10:33:14 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-2/</guid>
		<description><![CDATA[Continuing on from the original walking lines I did in Processing, I went on to develop this version of it. This is done effectively the same way as the original, but the code is cleaner and it provides for more variation. It also runs slower. This version should allow further development to make the lines [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/wp-content/uploads/2008/08/semi-random-lines.png" title="Walking lines 2"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/08/semi-random-lines.thumbnail.png" class="alignright" alt="Walking lines 2" /></a>Continuing on from the original <a href="http://matthewbrown.net.au/programming/walking-lines-1/" title="The original walking lines.">walking lines</a> I did in Processing, I went on to develop this version of it. This is done effectively the same way as the original, but the code is cleaner and it provides for more variation. It also runs slower.</p>
<p>This version should allow further development to make the lines even more random by separating all the variables, where the original was more limited since the numbers were largely defined within the line parameters.</p>
<p>This version is also technically more stochastic then the first one as well as the lines are added to and built on using the += command to add the new line position to the previous line position. Unfortunately this still draws a new line every frame that is not necessarily joined to the line from the previous frame.</p>
<p><span id="more-51"></span>
<pre class="brush: java;">
float x = random(width);
float y = random(height);
float x2 = random(width);
float y2 = random(height);

void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(100);
frameRate(12);
}

void draw()
{
x += int(random(width*2)-width);
y += int(random(height*2)-height);
x2 += int(random(width*2)-width);
y2 += int(random(height*2)-height);
stroke(random(255));
line(x, y, x2, y2);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Walking Lines 1</title>
		<link>http://matthewbrown.net.au/programming/walking-lines-1/</link>
		<comments>http://matthewbrown.net.au/programming/walking-lines-1/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 01:26:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[computational arts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[kkb211]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Processing]]></category>
		<category><![CDATA[walking lines]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/walking-lines-1/</guid>
		<description><![CDATA[In the week 2 tutorial for KKB211 &#8211; Computational Arts 2, we are looking at doing walking lines in our chosen development tool. Walking lines are effectively randomly generated paths that the lines follow to create a random image. I have been using Processing for this particular focus. Thus far I have random lines, however [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://matthewbrown.net.au/wp-content/uploads/2008/07/semi-random-sketch.png" title="Semi-random lines sketch"><img src="http://matthewbrown.net.au/wp-content/uploads/2008/07/semi-random-sketch.thumbnail.png" class="alignright" alt="Semi-random lines sketch" /></a>In the week 2 tutorial for KKB211 &#8211; Computational Arts 2, we are looking at doing walking lines in our chosen development tool.</p>
<p>Walking lines are effectively randomly generated paths that the lines follow to create a random image.</p>
<p>I have been using Processing for this particular focus. Thus far I have random lines, however they don&#8217;t follow any particular path as of yet. This is effectively still walking lines as the position of the lines is added to and built on. Unfortunately this actually draws a new line every frame that is not necessarily joined to the line from the previous frame.</p>
<p><a href="http://matthewbrown.net.au/uploads/processing/semi_random_sketch/index.html" title="Walking Lines 1">Have a look at it online here.</a></p>
<p>The code used to do this is extremely simple and just involves a few random variables based on the width and height of the canvas. I don&#8217;t believe this is entirely stochastic because the randoms are tightly controlled, but it is random within its boundaries (unless you want to get into the nitty gritty of it, which I don&#8217;t).</p>
<p>The source code is available after the jump.</p>
<p><span id="more-48"></span></p>
<pre class="brush: java;">
void setup()
{
size(400, 400);
strokeWeight(10);
smooth();
background(0);
}

void draw()
{
float r = random(0, height);
float x = random(0, width);
stroke(r, 100);
line(random(r), random(width), random(x*2), random(height));
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/walking-lines-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Audio Responsive Lines 2</title>
		<link>http://matthewbrown.net.au/programming/audio-responsive-lines-2/</link>
		<comments>http://matthewbrown.net.au/programming/audio-responsive-lines-2/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 04:13:37 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[illusion]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Quartz Composer]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/audio-responsive-lines-2/</guid>
		<description><![CDATA[There were a few problems with the first responsive lines that I did. Mainly related to visibility. For the lines I decided to make their visibility based on the audio spectrum as well as the volume, so sometimes they vanish altogether when they shouldn&#8217;t. I have mostly fixed this now, it does still occasionally happen [...]]]></description>
			<content:encoded><![CDATA[<p>There were a few problems with <a href="http://matthewbrown.net.au/programming/audio-responsive-lines/" title="Audio Responsive Lines">the first responsive lines</a> that I did. Mainly related to visibility. For the lines I decided to make their visibility based on the audio spectrum as well as the volume, so sometimes they vanish altogether when they shouldn&#8217;t.</p>
<p>I have mostly fixed this now, it does still occasionally happen but not too often and in general it responds to all audio better than it did before. It is more sensitive overall.</p>
<p>There are some changes to the rotations as well so now there is more variation in how the lines appear, including the illusion of a horizon, so there is a lot more randomness to it.</p>
<p>I have also gone through and added in notes to make it easier to figure out what does what later on, also so anyone looking at it can figure it out relatively easily.</p>
<p>The Quartz Composer file, <a href="http://matthewbrown.net.au/uploads/quartz/audio_responsive/responsive_lines_2.qtz" title="Audio Responsive Lines">responsive_lines_2.qtz is available here</a>.</p>
<p>It requires input via the built in mic in Macbook&#8217;s or iMac&#8217;s. It can of course be changed to accept audio input from the microphone-in, or line-in on Mac Pro&#8217;s or Mac Mini&#8217;s. With the right plug-in, it can also accept input from iTunes.</p>
<p>The most ideal is via line-in or microphone in as this gives the most control over what exactly the graphics are being synchronised with. However, using the built-in microphone means that no extra accessories are required.</p>
<p>Note that this was done using  Quartz Composer in Leopard.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/audio-responsive-lines-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Audio Responsive Lines</title>
		<link>http://matthewbrown.net.au/programming/audio-responsive-lines/</link>
		<comments>http://matthewbrown.net.au/programming/audio-responsive-lines/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 03:12:47 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Lines]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Quartz Composer]]></category>

		<guid isPermaLink="false">http://matthewbrown.net.au/programming/audio-responsive-lines/</guid>
		<description><![CDATA[I decided to experiment a bit more with the patches I had been using for my responsive particles to try making some audio responsive lines. The lines turned out to be a bit harder to work with than the particles since there are quite a few more things to control, but they did produce an [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to experiment a bit more with the patches I had been using for my <a href="http://matthewbrown.net.au/programming/audio-responsive-particles-3/" title="Audio Responsive Particles">responsive particles</a> to try making some audio responsive lines.</p>
<p>The lines turned out to be a bit harder to work with than the particles since there are quite a few more things to control, but they did produce an interesting result.</p>
<p>The Quartz Composer file, <a href="http://matthewbrown.net.au/uploads/quartz/audio_responsive/responsive_lines.qtz" title="Audio Responsive Lines">responsive_lines.qtz is available online here</a>.</p>
<p>Note that this one involves a lot more flashing than the other&#8217;s, so if you are epileptic or just don&#8217;t handle rapid flashing colours very well, you are looking at it at your own risk.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewbrown.net.au/programming/audio-responsive-lines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

