<?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>Matthew Yee-King</title>
	<atom:link href="http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://igor.gold.ac.uk/~mas01mjy/wp</link>
	<description>Collection of code written by me and various students</description>
	<lastBuildDate>Sat, 23 Mar 2013 04:44:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>frequency domain filters parameterised</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=530</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=530#comments</comments>
		<pubDate>Sat, 23 Mar 2013 04:44:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=530</guid>
		<description><![CDATA[import ddf.minim.analysis.*; import ddf.minim.*; import ddf.minim.signals.*; int comb_width = 1; AudioThread audioThread; // we&#039;ll use this to store the audio data we read from the audio file float[] audioData; // we&#039;ll use this to remember our position in the audio data array int readHead; FFT fft; //SineWave sine; float[] buffer; float[] out_buff; int bsize =&#8230; <a href="http://igor.gold.ac.uk/~mas01mjy/wp/?p=530">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<pre class="wp-code-highlight prettyprint">


import ddf.minim.analysis.*;
import ddf.minim.*;
import ddf.minim.signals.*;

int comb_width = 1;

AudioThread audioThread;
// we&#039;ll use this to store the audio data we read from the audio file
float[] audioData;
// we&#039;ll use this to remember our position in the audio data array
int readHead;

FFT fft;
//SineWave sine;
float[] buffer;
float[] out_buff;
int bsize = 4096;

void setup() {
  size(512, 500);
  // the audio file we want to play, which should be in the data dir
  String audioFilename = &quot;amenloop.wav&quot;;
  // read the audio data into a float array using the AudioFileIn class
  audioData = new AudioFileIn(audioFilename, this).getSampleData();
  // print how many samples we read
  println(&quot;Read &quot;+audioData.length+&quot; samples&quot;);
  // set the read head to zero, the first sample
  readHead = 0;
  // start up the audio thread
  audioThread = new AudioThread();
  // fft code
  fft = new FFT(bsize, 44100);
  //fft.window(FFT.HAMMING);
  buffer = new float[bsize];
  // fill the buffer with a sine wave
  //sine.generate(buffer);

  audioThread.start();
}

void draw() {
  background(0);
  stroke(255);
  for (int i = 0; i &lt; fft.specSize(); i++)
  {
    // draw the line for frequency band i, scaling it by 4 so we can see it a bit better
    line(i, height, i, height - fft.getBand(i)*4);
  }
}

// this function gets called when you press the escape key in the sketch
void stop() {
  // tell the audio to stop
  audioThread.quit();
  // call the version of stop defined in our parent class, in case it does anything vital
  super.stop();
}


// this gets called by the audio thread when it wants some audio
// we should fill the sent buffer with the audio we want to send to the 
// audio output
void generateAudioOut(float[] output) {


  for (int i=0;i&lt;output.length; i++) {
    // copy data from the audio we read from the file (audioData)
    // into the buffer that gets sent to the sound card
    output[i] =audioData[readHead];
    readHead = (readHead + 1) % audioData.length;

    //readHead = (readHead + 1) % audioData.length;
  }
  // now do forward fft on the buffer
  fft.forward(output);
  // mess with the spectrum
  //for (int i=mouseX*2;i&lt;fft.specSize(); i++){
  //  fft.setBand(i,0);
  // }
  threshold(fft, (float) comb_width / 10);
  comb(fft, comb_width);
  comb_width ++;
  //comb_width = comb_width + 1;
  // inverse it back into the buffer
  fft.inverse(output);
}



void threshold(FFT fft, float threshold) {  
  for (int i=0; i &lt; fft.specSize(); i++) {
    // filtering out quiet components
    if (fft.getBand(i) &lt; threshold) {
      fft.setBand(i, 0);
    }
  }
}

void comb(FFT fft, int comb_width) {
  for (int i=0; i &lt; fft.specSize(); i+=(comb_width * 2)) {
    // filtering out quiet components
    for (int j=0;j&lt;comb_width &amp;&amp; i+j &lt; fft.specSize(); j++, i++) {
      fft.setBand(i, 0);
    }
  }
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=530</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frequency domain effects</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=528</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=528#comments</comments>
		<pubDate>Sat, 23 Mar 2013 03:39:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=528</guid>
		<description><![CDATA[import ddf.minim.analysis.*; import ddf.minim.*; import ddf.minim.signals.*; AudioThread audioThread; // we&#039;ll use this to store the audio data we read from the audio file float[] audioData; // we&#039;ll use this to remember our position in the audio data array int readHead; FFT fft; //SineWave sine; float[] buffer; float[] out_buff; int bsize = 4096; void setup() {&#8230; <a href="http://igor.gold.ac.uk/~mas01mjy/wp/?p=528">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<pre class="wp-code-highlight prettyprint">

import ddf.minim.analysis.*;
import ddf.minim.*;
import ddf.minim.signals.*;

AudioThread audioThread;
// we&#039;ll use this to store the audio data we read from the audio file
float[] audioData;
// we&#039;ll use this to remember our position in the audio data array
int readHead;

FFT fft;
//SineWave sine;
float[] buffer;
float[] out_buff;
int bsize = 4096;

void setup() {
  size(512, 500);
  // the audio file we want to play, which should be in the data dir
  String audioFilename = &quot;myk_hats_dub1.wav&quot;;
  // read the audio data into a float array using the AudioFileIn class
  audioData = new AudioFileIn(audioFilename, this).getSampleData();
  // print how many samples we read
  println(&quot;Read &quot;+audioData.length+&quot; samples&quot;);
  // set the read head to zero, the first sample
  readHead = 0;
  // start up the audio thread
  audioThread = new AudioThread();
  // fft code
  fft = new FFT(bsize, 44100);
  //fft.window(FFT.HAMMING);
  buffer = new float[bsize];
  // fill the buffer with a sine wave
  //sine.generate(buffer);

  audioThread.start();
}

void draw() {
  background(0);
  stroke(255);
  for (int i = 0; i &lt; fft.specSize(); i++)
  {
    // draw the line for frequency band i, scaling it by 4 so we can see it a bit better
    line(i, height, i, height - fft.getBand(i)*4);
  }
}

// this function gets called when you press the escape key in the sketch
void stop() {
  // tell the audio to stop
  audioThread.quit();
  // call the version of stop defined in our parent class, in case it does anything vital
  super.stop();
}


// this gets called by the audio thread when it wants some audio
// we should fill the sent buffer with the audio we want to send to the 
// audio output
void generateAudioOut(float[] output) {


  for (int i=0;i&lt;output.length; i++) {
    // copy data from the audio we read from the file (audioData)
    // into the buffer that gets sent to the sound card
    output[i] =audioData[readHead];
    readHead = (readHead + 1) % audioData.length;

    //readHead = (readHead + 1) % audioData.length;
  }
  // now do forward fft on the buffer
  fft.forward(output);
  // mess with the spectrum
  //for (int i=mouseX*2;i&lt;fft.specSize(); i++){
  //  fft.setBand(i,0);
 // }
  for (int i=0; i &lt; fft.specSize(); i++){
    //println(fft.getBand(i));
    if (fft.getBand(i) &lt; mouseY / 10){
      fft.setBand(i, 0);
    }  
    //i+=100;
    
  }
  
  
  // inverse it back into the buffer
  fft.inverse(output);
}



</pre>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=528</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spectral plotter</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=526</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=526#comments</comments>
		<pubDate>Sat, 23 Mar 2013 02:49:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=526</guid>
		<description><![CDATA[import ddf.minim.analysis.*; import ddf.minim.*; import ddf.minim.signals.*; AudioThread audioThread; // we&#039;ll use this to store the audio data we read from the audio file float[] audioData; // we&#039;ll use this to remember our position in the audio data array int readHead; float speed = 1; FFT fft; //SineWave sine; float[] buffer; float[] out_buff; int bsize =&#8230; <a href="http://igor.gold.ac.uk/~mas01mjy/wp/?p=526">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<pre class="wp-code-highlight prettyprint">

import ddf.minim.analysis.*;
import ddf.minim.*;
import ddf.minim.signals.*;

AudioThread audioThread;
// we&#039;ll use this to store the audio data we read from the audio file
float[] audioData;
// we&#039;ll use this to remember our position in the audio data array
int readHead;
float speed = 1;

FFT fft;
//SineWave sine;
float[] buffer;
float[] out_buff;
int bsize = 4096;
boolean paused = false;
float[][] spectrum;


void setup() {
  size(500, 500);
  // the audio file we want to play, which should be in the data dir
  String audioFilename = &quot;amenloop.wav&quot;;
  // read the audio data into a float array using the AudioFileIn class
  audioData = new AudioFileIn(audioFilename, this).getSampleData();
  // print how many samples we read
  println(&quot;Read &quot;+audioData.length+&quot; samples&quot;);
  // set the read head to zero, the first sample
  readHead = 0;
  // start up the audio thread
  audioThread = new AudioThread();
  // fft code
  fft = new FFT(bsize, 44100);
  buffer = new float[bsize];
  // fill the buffer with a sine wave
  //sine.generate(buffer);
  spectrum = fft(audioData);
  audioThread.start();
}

float[][] fft(float[] signal){
  int size = 1024;
   FFT fft = new FFT(size, 44100);

  float[] buffer = new float[1024];
  float[][] spectrum = new float[signal.length/buffer.length][buffer.length];
  for (int frame = 0; frame &lt; spectrum.length; frame++){
    // copy some samples into the buffer
    arraycopy(signal, frame*buffer.length,
    buffer, 0, buffer.length);
    
    // calculate the power spectrum
    fft.forward(buffer);
    // store the results to the spectrum array
    for (int bin = 0; bin &lt; fft.specSize()-1; bin++){
      println(&quot;gett frame &quot;+frame+&quot; bin &quot;+bin+&quot; of &quot;+fft.specSize());
      spectrum[frame][bin] = fft.getBand(bin);
    }
  }
  return spectrum;
}

void draw() {
  background(0);
  stroke(255);
  speed = mouseX / 10;
  for (int frame = 0; frame &lt; spectrum.length; frame++){
    float x = frame;
    for (int bin = 0; bin &lt; spectrum[frame].length; bin++){
      float y = height - bin;
      float val = spectrum[frame][bin];
      stroke(val * 255);
      point(x, y);
    }
  }
}

void mousePressed() {
  paused = !paused;
}

// this function gets called when you press the escape key in the sketch
void stop() {
  // tell the audio to stop
  audioThread.quit();
  // call the version of stop defined in our parent class, in case it does anything vital
  super.stop();
}


// this gets called by the audio thread when it wants some audio
// we should fill the sent buffer with the audio we want to send to the 
// audio output
void generateAudioOut(float[] output) {
if (true){
  return;
}

  for (int i=0;i&lt;output.length; i++) {
    // copy data from the audio we read from the file (audioData)
    // into the buffer that gets sent to the sound card
    output[i] =audioData[readHead];
    if (!paused) {
      readHead = (readHead + (int)speed) % audioData.length;
    }
    //readHead = (readHead + 1) % audioData.length;
  }
  out_buff = output;
}

</pre>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=526</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classic DFT Java tutorial</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=519</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=519#comments</comments>
		<pubDate>Fri, 22 Mar 2013 15:03:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=519</guid>
		<description><![CDATA[You will not regret reading and understanding this tutorial]]></description>
				<content:encoded><![CDATA[<p><a title="classic DFT java tutorial" href="http://www.developer.com/java/other/article.php/3374611/Fun-with-Java-How-and-Why-Spectral-Analysis-Works.htm">You will not regret reading and understanding this tutorial</a></p>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=519</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated convolution code</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=516</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=516#comments</comments>
		<pubDate>Fri, 22 Mar 2013 06:53:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=516</guid>
		<description><![CDATA[AudioThread audioThread; // we&#039;ll use this to store the audio data we read from the audio file float[] signal; float[] impulse; float[] conv; // we&#039;ll use this to remember our position in the audio data array int readHead; void setup() { size(50,50, P2D); String audioFilename = &#34;909snr_tail.wav&#34;; signal = new AudioFileIn(audioFilename, this).getSampleData(); impulse = new&#8230; <a href="http://igor.gold.ac.uk/~mas01mjy/wp/?p=516">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<pre class="wp-code-highlight prettyprint">


AudioThread audioThread;
// we&#039;ll use this to store the audio data we read from the audio file
float[] signal;
float[] impulse;
float[] conv;
// we&#039;ll use this to remember our position in the audio data array
int readHead;


void setup() {
  size(50,50, P2D);
  String audioFilename = &quot;909snr_tail.wav&quot;;
  signal = new AudioFileIn(audioFilename, this).getSampleData();
  impulse = new AudioFileIn(&quot;conv1441.wav&quot;, this).getSampleData();
  println(&quot;Read &quot;+signal.length+&quot; signal samples&quot;);
  println(&quot;Read &quot;+impulse.length+&quot; impulse samples &quot;);
  // convolve for 10 seconds
// .... increase the number at the end to calc a longer output
  conv = convolve(signal, impulse, 44100 * 1);
  //conv = signal;
  readHead = 0;
  audioThread = new AudioThread();
  audioThread.start();
  
}
 
float[] convolve(float[] sig, float[] system, int length){
  float[] output = new float[length];
  // iterate over the input signal
  for (int sig_ind = 0; sig_ind &lt; sig.length; sig_ind ++){
     println(&quot;calcing step &quot;+sig_ind+&quot; of &quot;+sig.length+&quot; : &quot;+floor(((float) sig_ind/ (float) sig.length * 100))+&quot; percent&quot;); 
    for (int sys_ind = 0; (sys_ind+sig_ind) &lt; length; sys_ind++){
      output[sys_ind+sig_ind] += sig[sig_ind] * 
      system[sys_ind % system.length];
    }
  }
  return output;
} 

void draw() {
  background(0); 
  
}

// this function gets called when you press the escape key in the sketch
void stop(){
  // tell the audio to stop
  audioThread.quit();
  // call the version of stop defined in our parent class, in case it does anything vital
  super.stop();
}


// this gets called by the audio thread when it wants some audio
// we should fill the sent buffer with the audio we want to send to the 
// audio output
void generateAudioOut(float[] buffer){
  for (int i=0;i&lt;buffer.length; i++){
    // copy data from the audio we read from the file (audioData)
    // into the buffer that gets sent to the sound card
    buffer[i] =conv[readHead] * 0.1; //scale it down to reduce clipping
    readHead = (readHead + 1) % conv.length;

  }
}




</pre>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=516</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wheat Field</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=514</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=514#comments</comments>
		<pubDate>Fri, 22 Mar 2013 06:16:07 +0000</pubDate>
		<dc:creator>simstudent</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=514</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><script type="application/processing">
//Info: http://processingjs.org/reference
void setup(){
  size(500,500);

}


  void draw(){
    float x =0;
    for (float phase =0; x<height; phase += TWO_PI/width*mouseX){
      float red,blue, green;
      red = sin(phase);
      blue = (cos(phase)+1)*0.5*255;
      green = (tan(phase)+1)*0.5*255;
      red+=1;
      red *=0.5;
      red *=255;
    //  noFill();
      stroke(mouseX*red,blue,green);
    line(mouseX*red,mouseY*green,x,height);
      x++;
    }
  }</script></p>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=514</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hypnotic circle</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=502</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=502#comments</comments>
		<pubDate>Fri, 22 Mar 2013 06:11:51 +0000</pubDate>
		<dc:creator>simstudent</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=502</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><script type="application/processing">
void setup(){
 size(500, 500); 
}

void draw(){
  float x = 0;
  translate(width/2, height/2);
  noFill();
  for (float phase = 0; x < height; phase+=TWO_PI/width * mouseX){
    float red, green, blue;
    red = sin(phase); // -1 to 1
    red += 1; // 0 2
    red *= 0.5; // 0 1
    red *= 255; // 0-255
    green = (cos(phase)+1) * 0.5 * 255;
    blue = (tan(phase)+1) * 0.5 * 255;
    stroke(red, green, blue);
    ellipse(0, 0, x, x);
    x ++;
  }
}
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=502</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dizzy ball</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=499</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=499#comments</comments>
		<pubDate>Fri, 22 Mar 2013 06:11:09 +0000</pubDate>
		<dc:creator>simstudent</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=499</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><script type="application/processing">
//Info: http://processingjs.org/reference
void setup(){
size(500,500);
}

void draw(){
  float x=0;
  background(0);
  translate(width/2,height/2); 
for(float phase=0; x<height; phase+=TWO_PI/width*mouseX){
float red,green,blue;
red=sin(phase); //-1 tp 1
red +=1;// 0 2
red *=0.5;// 0 1
red*=255;//0-255
//fill((sin());
blue = (cos(phase)+1)*0.5*255;
green = (tan(phase)+1)*0.5*255;
noFill();
stroke(red,green,blue);
ellipse(0,0,x,height);
x++;
}
}

</script></p>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=499</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dizzy Tunnel</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=497</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=497#comments</comments>
		<pubDate>Fri, 22 Mar 2013 05:56:44 +0000</pubDate>
		<dc:creator>simstudent</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=497</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><script type="application/processing">
void setup(){
  size(500,500);
}

void draw(){
  float x = 0;
  for(float phase = 0; x < height; phase+=TWO_PI/width*mouseX){
    float red, green, blue;
    red = sin(phase); // -1 to 1
    red += 1; // 0 2
    red *= 0.5; // 0 1
    red *= 255; // 0-255
    green = ((cos(phase)+1)*0.5*255);
    blue = ((tan(phase)+1)*0.5*255);
    stroke(red,green,blue);
    line(width/2,height/2,x,width);
    line(width/2,height/2,x,-(width/500));
    line(width/2,height/2,height,x);
    line(width/2,height/2,-(height/500),x);
    x++;
  }
}
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=497</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sin and cos colour</title>
		<link>http://igor.gold.ac.uk/~mas01mjy/wp/?p=495</link>
		<comments>http://igor.gold.ac.uk/~mas01mjy/wp/?p=495#comments</comments>
		<pubDate>Fri, 22 Mar 2013 05:46:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://igor.gold.ac.uk/~mas01mjy/wp/?p=495</guid>
		<description><![CDATA[void setup(){ size(500, 500); } void draw(){ float x = 0; for (float phase = 0; x &#60; height; phase+=TWO_PI/width * mouseX){ float red, green; red = sin(phase); // -1 to 1 red += 1; // 0 2 red *= 0.5; // 0 1 red *= 255; // 0-255 green = (cos(phase)+1) * 0.5 *&#8230; <a href="http://igor.gold.ac.uk/~mas01mjy/wp/?p=495">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><script type="application/processing">
void setup(){
 size(500, 500); 
}

void draw(){
  float x = 0;
  for (float phase = 0; x < height; phase+=TWO_PI/width * mouseX){
    float red, green;
    red = sin(phase); // -1 to 1
    red += 1; // 0 2
    red *= 0.5; // 0 1
    red *= 255; // 0-255
    green = (cos(phase)+1) * 0.5 * 255;
    stroke(red, green, 0);
    line(x,0,x, height);
    x ++;
  }
}
</script></p>
<pre class="wp-code-highlight prettyprint">

void setup(){
 size(500, 500); 
}

void draw(){
  float x = 0;
  for (float phase = 0; x &lt; height; phase+=TWO_PI/width * mouseX){
    float red, green;
    red = sin(phase); // -1 to 1
    red += 1; // 0 2
    red *= 0.5; // 0 1
    red *= 255; // 0-255
    green = (cos(phase)+1) * 0.5 * 255;
    stroke(red, green, 0);
    line(x,0,x, height);
    x ++;
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://igor.gold.ac.uk/~mas01mjy/wp/?feed=rss2&#038;p=495</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
