<?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>erratica &#187; processing</title>
	<atom:link href="http://www.erratica.us/category/processing/feed" rel="self" type="application/rss+xml" />
	<link>http://www.erratica.us</link>
	<description>parsing architecture, culture and design</description>
	<lastBuildDate>Mon, 03 Oct 2011 03:58:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Time</title>
		<link>http://www.erratica.us/1159.html</link>
		<comments>http://www.erratica.us/1159.html#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:21:57 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1159</guid>
		<description><![CDATA[A completely unreadable processing clock. PFont font; int hY = 40; void setup (){ size (890,hY*3); smooth (); } void draw (){ font = loadFont ("HelveticaNeue-12.vlw"); textFont (font); textSize (12); scale (.9); // use only to fit into blog header int ms = (millis ()/100)% 200; // millis int s = second (); float mapS [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/clock1.png" title="Erratica - Clock"><img src="http://www.erratica.us/wp-content/uploads/2009/04/clock1.thumbnail.png" alt="Erratica - Clock" width="500" height="106" class="attachment wp-att-1160 centered" /></a></p>
<p>A completely unreadable processing clock.<br />
<span id="more-1159"></span><br />
<code></p>
<p>PFont font;</p>
<p>int hY = 40;</p>
<p>void setup (){<br />
size (890,hY*3);<br />
smooth ();</p>
<p>}</p>
<p>void draw (){<br />
font = loadFont ("HelveticaNeue-12.vlw");<br />
textFont (font);<br />
textSize (12);<br />
scale (.9); // use only to fit into blog header<br />
int ms = (millis ()/100)% 200;  // millis</p>
<p>int s = second ();<br />
float mapS = map (s,0,60,0,127.5); //map seconds</p>
<p>int m = minute ();<br />
float mapM = map (m,0,60,0,127.5); // map minutes</p>
<p>int h = hour ();<br />
float mapH = map (h,0,60,0,127.5); // map hours</p>
<p>int d = day ();</p>
<p>int mo = month ();<br />
int ye = (year ()%1000)+100;</p>
<p>int y = 40;<br />
background (255);</p>
<p>//1 milliseconds<br />
noStroke ();<br />
fill (0,ms*1.2);<br />
rect (0,y,ms,y);</p>
<p>stroke (0);<br />
line (ms,y*2+5,ms,y*2+10);<br />
fill (0);<br />
text (ms*5, ms, y*2+25);</p>
<p>//2 seconds<br />
noStroke ();<br />
fill (0,mapS*2);<br />
rect (200+1,y,mapS,y);</p>
<p>stroke (0);<br />
line ((mapS+201),y-5,(mapS+201),y-10);<br />
fill (0);<br />
if (s <=9){<br />
text (":0"+s, (mapS+201), y-15);<br />
} else {<br />
  text (":"+s+ "''", (mapS+201), y-15);<br />
}</p>
<p>//3 mins<br />
noStroke ();<br />
fill (0,mapM*2);<br />
rect ((327.5+1),y,(mapM*2),y);</p>
<p>stroke (0);<br />
line (((mapM*2)+328.5),y*2+5,((mapM*2)+328.5),y*2+10);<br />
fill (0);<br />
if (m <=9){<br />
text (":0"+m + "'" , ((mapM*2)+328.5), y*2+25);<br />
} else {<br />
  text (":"+m + "'" , ((mapM*2)+328.5), y*2+25);<br />
}</p>
<p>//4 hour<br />
noStroke ();<br />
fill (0,mapH*2.65625);<br />
rect ((582+1),y,(mapH*2),y);</p>
<p>stroke (0);<br />
line (((mapH*2)+583),y-5,((mapH*2)+583),y-10);<br />
fill (0);<br />
text (":"+ h , ((mapH*2)+583), y-15);</p>
<p>//5 day<br />
noStroke ();<br />
fill (0,d*8.5);<br />
rect (711,y,(d*2),y);</p>
<p>stroke (0);<br />
line (((d*2)+711),y*2+5,((d*2)+711),y*2+10);</p>
<p>fill (0);<br />
//text (d, ((d*2)+711), y*2+25);<br />
if (d<=9){<br />
 text ("0"+ d, ((d*2)+711), y*2+25);<br />
} else {<br />
  text (d, ((d*2)+711), y*2+25);<br />
}</p>
<p>//6 month<br />
noStroke ();<br />
fill (0,mo*21.55);<br />
rect (762,y,mo*2,y);<br />
 stroke (0);<br />
line (((mo*2)+762),y-5,((mo*2)+762),y-10);</p>
<p>fill (0);<br />
if (mo <=9){<br />
text ("0"+mo, ((mo*2)+762), y-15);<br />
}else {<br />
 text (mo, ((mo*2)+762), y-15);<br />
}</p>
<p>//7 year<br />
noStroke ();<br />
fill (0);<br />
rect (787,y,(ye),y);</p>
<p> stroke (0);<br />
line (((ye)+787),y*2+5,((ye)+787),y*2+10);<br />
text (ye+1900, ((ye+787)), y*2+25);</p>
<p>}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1159.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Read 3</title>
		<link>http://www.erratica.us/1140.html</link>
		<comments>http://www.erratica.us/1140.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 02:51:27 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[experimental]]></category>
		<category><![CDATA[processing]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1140</guid>
		<description><![CDATA[Another slight variation on the image read experiment. This time, the variation is based on the mouse distance, both for images and the webcam. For images. For Webcam import processing.video.*; float r = 5; int xPix, yPix; Capture video; void setup (){ size (640,480, JAVA2D); background (255); smooth (); noStroke (); video = new Capture [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-6.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-6.thumbnail.png" alt="Erratica - Image Read" width="500" height="404" class="attachment wp-att-1144 centered" /></a></p>
<p>Another slight variation on the image read experiment. This time, the variation is based on the mouse distance, both for images and the webcam.<br />
<span id="more-1140"></span></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-7.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-7.thumbnail.png" alt="Erratica - Image Read" width="500" height="404" class="attachment wp-att-1145 centered" /></a></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-8.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-8.thumbnail.png" alt="Erratica - Image Read" width="500" height="404" class="attachment wp-att-1146 centered" /></a></p>
<p>For images.</p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-5.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-5.thumbnail.png" alt="Erratica - Image Read" width="500" height="539" class="attachment wp-att-1143 centered" /></a></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-4.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-4.thumbnail.png" alt="Erratica - Image Read" width="500" height="539" class="attachment wp-att-1142 centered" /></a></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/picture-3.png" title="Erratica - Image Read"><img src="http://www.erratica.us/wp-content/uploads/2009/04/picture-3.thumbnail.png" alt="Erratica - Image Read" width="500" height="539" class="attachment wp-att-1141 centered" /></a></p>
<p>For Webcam<br />
<code></p>
<p>import processing.video.*;</p>
<p>float r = 5;<br />
int xPix, yPix;</p>
<p>Capture video;</p>
<p>void setup (){<br />
  size (640,480, JAVA2D);<br />
  background (255);<br />
  smooth ();<br />
  noStroke ();</p>
<p>  video = new Capture (this,width,height);</p>
<p>}</p>
<p>void draw (){</p>
<p>  if (video.available()){<br />
    video.read();<br />
  }</p>
<p>  for (int x = 0; x < 640; x+=20){<br />
    for (int y = 0; y < 480; y += 20){<br />
      float myDist = (dist (x, y, mouseX, mouseY)/12);</p>
<p>      color  c =  video.get (x,y);</p>
<p>      fill (c);<br />
      rectMode (CENTER);</p>
<p>      rect (x,y,myDist,myDist);</p>
<p>    }<br />
  }</p>
<p>}</p>
<p></code></p>
<p>For Images<br />
<code><br />
PImage img;</p>
<p>void setup (){</p>
<p>  img = loadImage ("picture1.jpg");<br />
  size (img.width,img.height);<br />
  noStroke ();<br />
  smooth ();</p>
<p>}</p>
<p>void draw (){<br />
  background (255);</p>
<p>  for (int x = 0; x < img.width; x+=20){<br />
    for (int y = 0; y < img.height; y += 20){<br />
      float myDist = (dist (x, y, mouseX, mouseY)/8);<br />
      color c = img.get (x,y);<br />
      fill (c);<br />
      ellipseMode (CENTER);<br />
      ellipse (x,y, myDist,myDist);<br />
    }<br />
  }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1140.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Read 2</title>
		<link>http://www.erratica.us/1131.html</link>
		<comments>http://www.erratica.us/1131.html#comments</comments>
		<pubDate>Mon, 06 Apr 2009 01:11:11 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[processing]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1131</guid>
		<description><![CDATA[This is the continuation of the image processing test driven this time by the webcam. The next step will be to make each of the cells being placed on the image be more than just an ellipse and have them be driven by the brightness of the pixels. Changing the radius based on brightness import [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/webcam_1.jpg" title="Erratica - Webcam"><img src="http://www.erratica.us/wp-content/uploads/2009/04/webcam_1.thumbnail.jpg" alt="Erratica - Webcam" width="500" height="398" class="attachment wp-att-1132 centered" /></a></p>
<p>This is the continuation of the image processing test driven this time by the webcam. The next step will be to make each of the cells being placed on the image be more than just an ellipse and have them be driven by the brightness of the pixels.<br />
<span id="more-1131"></span></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/webcam2.jpg" title="Erratica - Webcam"><img src="http://www.erratica.us/wp-content/uploads/2009/04/webcam2.thumbnail.jpg" alt="Erratica - Webcam" width="500" height="404" class="attachment wp-att-1133 centered" /></a></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/webcam3.jpg" title="Erratica - Webcam"><img src="http://www.erratica.us/wp-content/uploads/2009/04/webcam3.thumbnail.jpg" alt="Erratica - Webcam" width="500" height="404" class="attachment wp-att-1134 centered" /></a></p>
<p>Changing the radius based on brightness</p>
<p><code></p>
<p>import processing.video.*;</p>
<p>float r = 5;<br />
int xPix, yPix;</p>
<p>Capture video;</p>
<p>void setup (){<br />
 size (640,480, P2D);<br />
 smooth ();<br />
 noStroke ();<br />
video = new Capture (this,width,height);<br />
}</p>
<p>void draw (){<br />
  if (video.available()){<br />
    video.read();<br />
    video.loadPixels();<br />
  }</p>
<p>for (int x = 0; x < width; x+=10){<br />
  for (int y = 0; y < height; y += 10){</p>
<p>color  c =  video.get (x,y);<br />
float b = brightness (c);<br />
//r = b/8;</p>
<p>    fill (c, 14);<br />
    ellipse (x,y,10,10);<br />
// ellipse (x,y,r,r);</p>
<p>  }<br />
}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1131.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Image Read</title>
		<link>http://www.erratica.us/1125.html</link>
		<comments>http://www.erratica.us/1125.html#comments</comments>
		<pubDate>Fri, 03 Apr 2009 20:21:33 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[experimental]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1125</guid>
		<description><![CDATA[Reading the pixel data of an image to drive the color and scale of circles. Next step will be to draw the webcam video using the ellipses. Now its just changing based on a random number linked to the brightness. Some image downloaded from the web&#8230; PImage img; void setup (){ size (360,360); img = [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/imageprocessing.jpg" title="Erratica - Image Processing"><img src="http://www.erratica.us/wp-content/uploads/2009/04/imageprocessing.thumbnail.jpg" alt="Erratica - Image Processing" width="500" height="500" class="attachment wp-att-1126 centered" /></a></p>
<p>Reading the pixel data of an image to drive the color and scale of circles. </p>
<p>Next step will be to draw the webcam video using the ellipses. Now its just changing based on a random number linked to the brightness. </p>
<p><span id="more-1125"></span></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/image.jpg" title="Erratica - Image Processing"><img src="http://www.erratica.us/wp-content/uploads/2009/04/image.thumbnail.jpg" alt="Erratica - Image Processing" width="500" height="500" class="attachment wp-att-1130 centered" /></a></p>
<p>Some image downloaded from the web&#8230;</p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/04/imageprocessing2.jpg" title="Erratica - Image Processing"><img src="http://www.erratica.us/wp-content/uploads/2009/04/imageprocessing2.thumbnail.jpg" alt="Erratica - Image Processing" width="500" height="500" class="attachment wp-att-1127 centered" /></a></p>
<p><code></p>
<p>PImage img;</p>
<p>void setup (){<br />
size (360,360);<br />
img = loadImage ("artlife4.jpg");<br />
noStroke ();<br />
smooth ();<br />
tint (255,255,255,0);<br />
image (img, 0,0);<br />
frameRate (8);<br />
}</p>
<p>void draw (){</p>
<p>for (int i = 0; i < width; i += 10){<br />
  for (int j = 0; j < height; j += 10){</p>
<p>    int posX = i;<br />
    int posY = j;<br />
    color c = img.get (posX,posY);<br />
    float b = (random(brightness (c)/4));  </p>
<p>    fill (c, 200);<br />
    ellipseMode (CENTER);<br />
    ellipse (i, j,b,b);  </p>
<p>  }<br />
}</p>
<p>}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1125.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing Patterns 01</title>
		<link>http://www.erratica.us/1100.html</link>
		<comments>http://www.erratica.us/1100.html#comments</comments>
		<pubDate>Thu, 26 Mar 2009 14:36:54 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1100</guid>
		<description><![CDATA[I&#8217;m working on my Processing skillz these days. Here are a few images of a simple recursive branch. Changing position&#8230; No dots.]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/picture1.jpg" title="Erratica - Processing Patterns"><img src="http://www.erratica.us/wp-content/uploads/2009/03/picture1.jpg" alt="Erratica - Processing Patterns"  class="attachment wp-att-1095 centered" /></a></p>
<p>I&#8217;m working on my Processing skillz these days. Here are a few images of a simple recursive branch.</p>
<p><span id="more-1100"></span></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/picture-2.jpg" title="Erratica - Processing Patterns"><img src="http://www.erratica.us/wp-content/uploads/2009/03/picture-2.jpg" alt="Erratica - Processing Patterns"  class="attachment wp-att-1095 centered" /></a></p>
<p>Changing position&#8230;</p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/picture-3.jpg" title="Erratica - Processing Patterns"><img src="http://www.erratica.us/wp-content/uploads/2009/03/picture-3.jpg" alt="Erratica - Processing Patterns"  class="attachment wp-att-1095 centered" /></a></p>
<p>No dots.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1100.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arduino Confetti</title>
		<link>http://www.erratica.us/1094.html</link>
		<comments>http://www.erratica.us/1094.html#comments</comments>
		<pubDate>Mon, 23 Mar 2009 05:19:47 +0000</pubDate>
		<dc:creator>coche</dc:creator>
				<category><![CDATA[arduino]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.erratica.us/?p=1094</guid>
		<description><![CDATA[A photoresistor controlling the size, color, alpha and placement of the circles in processing. Code and clip after the jump below. [flv:arduino_confetti.flv arduino_confetti.jpg 500 375] //Processing import processing.serial.*; Serial myPort; int val; void setup() { size(200, 200); smooth (); String portName = Serial.list()[0]; myPort = new Serial(this, portName, 9600); } void draw(){ if ( myPort.available() [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/img_1767.jpg" title="Erratica - Confetti"><img src="http://www.erratica.us/wp-content/uploads/2009/03/img_1767.thumbnail.jpg" alt="Erratica - Confetti" width="500" height="375" class="attachment wp-att-1095 centered" /></a></p>
<p>A photoresistor controlling the size, color, alpha and placement of the circles in processing.</p>
<p>Code and clip after the jump below.<br />
<span id="more-1094"></span></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/img_1766.jpg" title="img_1766"><img src="http://www.erratica.us/wp-content/uploads/2009/03/img_1766.thumbnail.jpg" alt="img_1766" width="500" height="375" class="attachment wp-att-1098 centered" /></a></p>
<p style="text-align: center;"><a href="http://www.erratica.us/wp-content/uploads/2009/03/img_1765.jpg" title="Erratica - Confetti"><img src="http://www.erratica.us/wp-content/uploads/2009/03/img_1765.thumbnail.jpg" alt="Erratica - Confetti" width="500" height="375" class="attachment wp-att-1096 centered" /></a></p>
<p>[flv:arduino_confetti.flv arduino_confetti.jpg 500 375]</p>
<p><code><br />
//Processing</p>
<p>import processing.serial.*;</p>
<p>Serial myPort;<br />
int val;     </p>
<p>void setup()<br />
{<br />
  size(200, 200);<br />
  smooth ();<br />
  String portName = Serial.list()[0];<br />
  myPort = new Serial(this, portName, 9600);<br />
}</p>
<p>void draw(){</p>
<p>  if ( myPort.available() > 0) {<br />
    val = myPort.read();<br />
  }</p>
<p>  if (val > 20) {<br />
  fill (random (val),random (val), random (val),  val*1.25);<br />
  ellipse (random (val),random (val),val/4,  val/4);</p>
<p>}</p>
<p>  if (val >20){<br />
  println (val);<br />
  }<br />
}</p>
<p>//arduino + wiring</p>
<p>int potPin = 0;<br />
int val = 0;</p>
<p>void setup (){<br />
  Serial.begin (9600);<br />
}</p>
<p>void loop (){<br />
  val = analogRead (potPin)/4;<br />
  delay (100);<br />
  Serial.print (val, BYTE);<br />
  Serial.println();  </p>
<p>}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erratica.us/1094.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

