<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>USC IMD: </title>
<link rel="alternate" type="text/html" href="" />
<modified>2009-05-26T22:59:10Z</modified>
<tagline></tagline>
<id>tag:,2009::</id>
<generator url="http://interactive.usc.edu/" version="1.0">USC Interactive Media Division</generator>
	<entry>
		<title><![CDATA[CTIN 544 - ROBOCAR - PART 1]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/msilverman/2009/05/ctin_544_robocar_part_1.html" />
		<modified>2009-05-26T22:59:10Z</modified>
		<issued>2009-05-26T20:06:40Z</issued>
		<id>tag:,2009-05-26:interactive.usc.edu/members/msilverman:212</id>
		<created>2009-05-26T20:06:40Z</created>
		<summary type="text/plain"><![CDATA[For Perry Hoberman's Experiments In Interactivity 2, I present how to make an arduino controlled...]]></summary>
		<author>
			<name>msilverman</name>
			<url>http://interactive.usc.edu/members/msilverman</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/msilverman/2009/05/ctin_544_robocar_part_1.html">
			<![CDATA[For Perry Hoberman's Experiments In Interactivity 2, I present how to make an arduino controlled RC Mustang.<br /><br /><img alt="IMG_0081.JPG" src="http://interactive.usc.edu/members/msilverman/IMG_0081.JPG" width="600" /><br /><br />]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[Sonar Tonebank]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/jwatson/2009/05/sonar_tonebank.html" />
		<modified>2009-05-10T07:11:55Z</modified>
		<issued>2009-05-10T06:37:20Z</issued>
		<id>tag:,2009-05-10:interactive.usc.edu/members/jwatson:228</id>
		<created>2009-05-10T06:37:20Z</created>
		<summary type="text/plain"><![CDATA[The Sonar Tonebank is a simple musical instrument that uses a range sensor to trigger sound...]]></summary>
		<author>
			<name>jwatson</name>
			<url>http://interactive.usc.edu/members/jwatson</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/jwatson/2009/05/sonar_tonebank.html">
			<![CDATA[<img src="http://remotedevice.net/wp-content/uploads/2009/05/img_0209.jpg" alt="img_0209" title="img_0209" width="425" height="319" class="alignnone size-full wp-image-960" /><br /><br />The Sonar Tonebank is a simple musical instrument that uses a range sensor to trigger sound samples. Players can create musical soundscapes by moving in front of the range sensor, which maps pitch to distance. This project was created using an <a href="http://arduino.cc/">Arduino</a>, a PING sonar sensor and the Minim sound library in <a href="http://processing.org/">Processing</a>.<br /><br />This project was created as an exercise for Perry Hoberman's graduate seminar, <em>Experiments in Interactivity II</em>.<br /><br /><h3>Video</h3><br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/GtSfzf-Squs&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GtSfzf-Squs&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br /><br /><h3>Code & Notes</h3><br /><strong>The Processing code</strong> is actually very simple. The program reads range data from the Arduino via the serial port, then triggers samples and visualizer elements according to the distances reported. Any set of samples could be used (for this version, I'm using 16 different short sound textures generated with Reason), and it's easy to imagine how the code could be modified to send MIDI signals instead of triggering samples.<br /><br /><blockquote>// SONAR TONEBANK<br /><br />// 1.0<br />// Jeff Watson<br />// 27 April 2009<br /><br />import processing.serial.*;<br />import ddf.minim.*;<br /><br />// arduino variables<br /><br />Serial myPort;        // The serial port<br /><br /><br />// video variables<br /><br /><br />// minim variables<br /><br />Minim minim;<br /><br />AudioSample bell;<br />AudioSample bell2;<br />AudioSample bell3;<br />AudioSample bell4;<br />AudioSample bell5;<br />AudioSample bell6;<br />AudioSample bell7;<br />AudioSample bell8;<br />AudioSample bell9;<br />AudioSample bell10;<br />AudioSample bell11;<br />AudioSample bell12;<br />AudioSample bell13;<br />AudioSample bell14;<br />AudioSample bell15;<br />AudioSample bell16;<br /><br /><br />// visualizer variables<br /><br /><br /><br /><br />void setup () {<br />  <br />  size(640, 480, P2D);<br />  background(0);<br />  noStroke();<br /><br />  minim = new Minim(this);<br />  bell = minim.loadSample("F#3.wav", 2048);<br />  bell2 = minim.loadSample("G#3.wav", 2048);<br />  bell3 = minim.loadSample("A#3.wav", 2048);<br />  bell4 = minim.loadSample("C#4.wav", 2048);<br />  bell5 = minim.loadSample("D#4.wav", 2048);<br />  bell6 = minim.loadSample("F#4.wav", 2048);<br />  bell7 = minim.loadSample("G#4.wav", 2048);<br />  bell8 = minim.loadSample("A#4.wav", 2048);<br />  bell9 = minim.loadSample("C#5.wav", 2048);<br />  bell10 = minim.loadSample("D#5.wav", 2048);  <br />  bell11 = minim.loadSample("F#5.wav", 2048);<br />  bell12 = minim.loadSample("G#5.wav", 2048);<br />  bell13 = minim.loadSample("A#5.wav", 2048);<br />  bell14 = minim.loadSample("C#6.wav", 2048);<br />  bell15 = minim.loadSample("D#6.wav", 2048);<br />  bell16 = minim.loadSample("F#6.wav", 2048);<br /><br /> <br />  // List all the available serial ports<br />  println(Serial.list());<br />  // Open whatever port is the one you're using.<br />  myPort = new Serial(this, Serial.list()[1], 9600);<br />  // don't generate a serialEvent() unless you get a newline character:<br />  myPort.bufferUntil('\n');<br />}<br /><br />void draw () {<br />  // everything happens in the serialEvent()<br />}<br /><br />void serialEvent (Serial myPort) {<br />  // get the ASCII string:<br />  String inString = myPort.readStringUntil('\n');<br /><br />  if (inString != null) {<br />    // trim off any whitespace:<br />    inString = trim(inString);<br />    // convert to an int and map to the screen height:<br />    float inByte = float(inString); <br />    int VideoMod = int(inString);<br /><br />println(VideoMod);<br /><br />// 1st Octave<br /><br />if ( VideoMod < 5 )<br />{<br />bell.trigger();<br />delay(33);<br />fill(0,0,255);<br />rect(1,0,128,480);<br />}<br /><br />else if ( VideoMod < 8 )<br />{<br />  bell2.trigger();<br />  delay(33);<br />  fill(13,82,122);<br />  rect(129,0,128,480);<br />}<br /><br />else if ( VideoMod < 11 )<br />{<br />  bell3.trigger();<br />  delay(33);<br />  fill(0,0,255);<br />  rect(257,0,128,480);<br />}<br /><br />else if ( VideoMod < 14 )<br />{<br />  bell4.trigger();<br />  delay(33);<br />  fill(13,82,122);<br />  rect(385,0,128,480);  <br />}<br /><br />else if ( VideoMod < 17 )<br />{<br />  bell5.trigger();<br />  delay(33);<br />  fill(0,0,255);<br />  rect(513,0,128,480);  <br />}<br /><br />// 2nd Octave<br /><br />else if ( VideoMod < 20 )<br />{<br />  bell6.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,0,640,480);  <br />  fill(0,0,255,191);<br />  rect(1,0,128,480);   <br />}<br /><br />else if ( VideoMod < 23 )<br />{<br />  bell7.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,0,640,480);  <br />  fill(13,82,122,191);<br />  rect(129,0,128,480);    <br />}<br /><br />else if ( VideoMod < 26 )<br />{<br />  bell8.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,0,640,480);  <br />  fill(0,0,255,191);<br />  rect(257,0,128,480);   <br />}<br /><br />else if ( VideoMod < 29 )<br />{<br />  bell9.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,0,640,480);  <br />  fill(13,82,122,191);<br />  rect(385,0,128,480);   <br />}<br /><br />else if ( VideoMod < 32 )<br />{<br />  bell10.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,0,640,480);  <br />  fill(0,0,255,191);<br />  rect(513,0,128,480);   <br />}<br /><br />// 3rd Octave<br /><br />else if ( VideoMod < 35 )<br />{<br />  bell11.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,100,640,380);  <br />  fill(0,0,255,127);<br />  rect(1,0,128,480);   <br />}<br /><br />else if ( VideoMod < 38 )<br />{<br />  bell12.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,100,640,380);  <br />  fill(13,82,122,191);<br />  rect(129,0,128,480);    <br />}<br /><br />else if ( VideoMod < 41 )<br />{<br />  bell13.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,100,640,380);  <br />  fill(0,0,255,191);<br />  rect(257,0,128,480);   <br />}<br /><br />else if ( VideoMod < 44 )<br />{<br />  bell14.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,100,640,380);  <br />  fill(13,82,122,191);<br />  rect(385,0,128,480);   <br />}<br /><br />else if ( VideoMod < 47 )<br />{<br />  bell15.trigger();<br />  delay(33);<br />  fill(0,0,0);<br />  rect(0,100,640,380);  <br />  fill(0,0,255,191);<br />  rect(513,0,128,480);   <br />}<br /><br />// Extra note clears screen<br /><br />else if ( VideoMod < 50 )<br />{<br />  bell16.trigger();<br />  delay(33);<br />  background(0);<br />}<br /><br />else if ( VideoMod > 50 )<br />{<br />}<br /><br />}<br />}<br /></blockquote><br /><br /><em>See also:</em> <a href="http://www.arduino.cc/en/Tutorial/Graph">Arduino-Graph</a><br /><br /><img src="http://remotedevice.net/wp-content/uploads/2009/05/img_0207.jpg" alt="img_0207" title="img_0207" width="425" height="319" class="alignnone size-full wp-image-961" /><br /><br /><strong>The Arduino code</strong> is also pretty straight-forward. All it does is translate the raw PING sonar data into easier-to-handle Imperial and metric measurements, which are then sent out the serial port to Processing.<br /><br /><blockquote>int pingPin = 7;<br /><br />void setup()<br />{<br />  Serial.begin(9600);<br />}<br /><br />void loop()<br />{<br />  long duration, inches, cm;<br /><br />  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.<br />  // We give a short LOW pulse beforehand to ensure a clean HIGH pulse.<br />  pinMode(pingPin, OUTPUT);<br />  digitalWrite(pingPin, LOW);<br />  delayMicroseconds(2);<br />  digitalWrite(pingPin, HIGH);<br />  delayMicroseconds(5);<br />  digitalWrite(pingPin, LOW);<br /><br />  // The same pin is used to read the signal from the PING))): a HIGH<br />  // pulse whose duration is the time (in microseconds) from the sending<br />  // of the ping to the reception of its echo off of an object.<br />  pinMode(pingPin, INPUT);<br />  duration = pulseIn(pingPin, HIGH);<br /><br />  // convert the time into a distance<br />  inches = microsecondsToInches(duration);<br />  cm = microsecondsToCentimeters(duration);<br /><br /><br />  Serial.println(inches);<br /><br />  delay(100);<br />}<br /><br />long microsecondsToInches(long microseconds)<br />{<br />  // According to Parallax's datasheet for the PING))), there are<br />  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per<br />  // second).  This gives the distance travelled by the ping, outbound<br />  // and return, so we divide by 2 to get the distance of the obstacle.<br />  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf<br />  return microseconds / 74 / 2;<br />}<br /><br />long microsecondsToCentimeters(long microseconds)<br />{<br />  // The speed of sound is 340 m/s or 29 microseconds per centimeter.<br />  // The ping travels out and back, so to find the distance of the<br />  // object we take half of the distance travelled.<br />  return microseconds / 29 / 2;<br />}</blockquote><br /><em><br />See also:</em> <a href="http://arduino.cc/en/Tutorial/Ping">Arduino-Ping</a><br /><br /><img src="http://remotedevice.net/wp-content/uploads/2009/05/img_0208.jpg" alt="img_0208" title="img_0208" width="425" height="319" class="alignnone size-full wp-image-962" /><br /><br />During the early prototyping phase, I also made a simple Theremin using the PING sensor, based on Alberto Bietti's <a href="http://alandtech.blogspot.com/2007/12/arduino-theremin.html">excellent documentation</a>. The piezo speaker and button on the current version of the project are remnants of this prototype; I've left them on there for now for demoing purposes.<br /><br />]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[CTIN 544 | Monty!]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/eduff/2009/05/ctin_544_monty.html" />
		<modified>2009-05-04T13:46:18Z</modified>
		<issued>2009-05-04T11:19:21Z</issued>
		<id>tag:,2009-05-04:interactive.usc.edu/members/eduff:215</id>
		<created>2009-05-04T11:19:21Z</created>
		<summary type="text/plain"><![CDATA[Monty iTunes Controller v.1 uses accelerometer data to control iTunes. Depending on Monty's...]]></summary>
		<author>
			<name>eduff</name>
			<url>http://interactive.usc.edu/members/eduff</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/eduff/2009/05/ctin_544_monty.html">
			<![CDATA[Monty iTunes Controller v.1 uses accelerometer data to control iTunes. Depending on Monty's position, data is sent via the serial port to an AppleScript to communicate with iTunes. The motions are a bit exaggerated currently, because my X and Y values are very small, this will change in v.2 to allow for a greater range of motion.<br /><br /><a href="http://interactive.usc.edu/members/eduff/monty_v1.zip">Monty v.1 Download (Arduino + AppleScript)</a><br /><br />Monty's Positions:<br />Standing = Play<br />Sleeping = Pause<br />Lean Right = Next Track<br />Lean Left = Previous Track<br /><br />What's next for Monty?Hopefully over the summer Monty can go wireless! He will also  fade the volume in and out as he wakes and sleeps. <br /><div align="center"><br /><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4477261&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4477261&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a href="http://vimeo.com/4477261">Monty iTunes Controller v.1</a> from <a href="http://vimeo.com/emilycduff">emily c. duff</a> on <a href="http://vimeo.com">Vimeo</a>.</p><br /><img alt="monty1.jpg" src="http://interactive.usc.edu/members/eduff/monty1.jpg" width="500" height="200" /></div><br /><br />Useful Links:<br /><a href="http://www.arduino.cc/en/Tutorial/AccelerometerMemsic2125">Arduino + Accelerometer</a><br /><a href="http://www.tinker.it/files/asproxy02.dmg">Tinker.it! AppleScript Proxy</a>]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[CTIN544 Final Project - Swinging Leak -]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/hyasuda/2009/04/ctin544_final_project_swinging.html" />
		<modified>2009-04-30T00:28:30Z</modified>
		<issued>2009-04-30T00:21:53Z</issued>
		<id>tag:,2009-04-30:interactive.usc.edu/members/hyasuda:229</id>
		<created>2009-04-30T00:21:53Z</created>
		<summary type="text/plain"><![CDATA[This is part of my assignment of CTIN544.From hereI removed Arduino stuff and ARToolkit...]]></summary>
		<author>
			<name>hyasuda</name>
			<url>http://interactive.usc.edu/members/hyasuda</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/hyasuda/2009/04/ctin544_final_project_swinging.html">
			<![CDATA[<img alt="leakswing1_capture.jpg" src="http://interactive.usc.edu/members/hyasuda/leakswing1_capture.jpg" width="320" height="251" /><br /><br />This is part of my assignment of CTIN544.<br /><br /><a href="http://www.hyde-ysd.com/reco-memo/Proce55ing/sample/miku_swing_leak2/content-e.html">From here</a><br /><br />I removed Arduino stuff and ARToolkit stuff.<br />Because it's difficult to execute these stuff on the browser.<br /><br />But I can give source code including these stuff.<br />Please contact me.<br /><br /><br />]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[Digital Puppet and Physical Controller]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/wgraner/2009/04/digital_puppet_and_physical_co_1.html" />
		<modified>2009-04-30T17:59:27Z</modified>
		<issued>2009-04-25T00:14:00Z</issued>
		<id>tag:,2009-04-25:interactive.usc.edu/members/wgraner:216</id>
		<created>2009-04-25T00:14:00Z</created>
		<summary type="text/plain"><![CDATA[I created a glove controller using three bend sensors, and hooked it up to a digital Processing...]]></summary>
		<author>
			<name>granerw</name>
			<url>http://interactive.usc.edu/members/wgraner</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/wgraner/2009/04/digital_puppet_and_physical_co_1.html">
			<![CDATA[I created a glove controller using three bend sensors, and hooked it up to a digital Processing puppet via Arduino.<br /><br /><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/9f21j9Jdqyk&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&ap=%2526fmt%3D18"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9f21j9Jdqyk&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999&ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[Example Code for Communicating From Arduino to Processing]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/wgraner/2009/04/example_code_for_communicating.html" />
		<modified>2009-04-25T00:20:05Z</modified>
		<issued>2009-04-10T13:07:34Z</issued>
		<id>tag:,2009-04-10:interactive.usc.edu/members/wgraner:216</id>
		<created>2009-04-10T13:07:34Z</created>
		<summary type="text/plain"><![CDATA[This is some example code for communicating between Arduino and processing.  It just reads a...]]></summary>
		<author>
			<name>granerw</name>
			<url>http://interactive.usc.edu/members/wgraner</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/wgraner/2009/04/example_code_for_communicating.html">
			<![CDATA[This is some example code for communicating between Arduino and processing.  It just reads a digital input pin, then changes a Processing window background color to match the input.  You can use this with a switch, for instance.<br /><br />-Bill]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[CTIN 544 | Phrases]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/eduff/2009/03/ctin_544_phrases.html" />
		<modified>2009-03-26T19:09:12Z</modified>
		<issued>2009-03-26T19:00:39Z</issued>
		<id>tag:,2009-03-26:interactive.usc.edu/members/eduff:215</id>
		<created>2009-03-26T19:00:39Z</created>
		<summary type="text/plain"><![CDATA[//I Think It Is Superb!//by Emily Duff - CTIN 544//March 26, 2009////This app is a visualization...]]></summary>
		<author>
			<name>eduff</name>
			<url>http://interactive.usc.edu/members/eduff</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/eduff/2009/03/ctin_544_phrases.html">
			<![CDATA[//I Think It Is Superb!<br />//by Emily Duff - CTIN 544<br />//March 26, 2009<br />//<br />//This app is a visualization of the phrase 'I think it is superb'<br />//Click and drag on the man's head to pull out his thoughts. When<br />//you reach the end, a button appears to move on to the next phrase<br />//<br />//Uses Minim & original code<br />//Art Credit: http://cvydesign.wordpress.com/2009/03/06/933/<br /><br />Note: Feel free to suggest additional words to add to his mind.<br /><a href="http://interactive.usc.edu/members/eduff/emily_think.zip">Download file</a>]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[CTIN544 Story Assignment]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/sbouchard/2009/02/ctin544_story_assignment.html" />
		<modified>2009-02-21T15:29:20Z</modified>
		<issued>2009-02-21T07:56:42Z</issued>
		<id>tag:,2009-02-21:interactive.usc.edu/members/sbouchard:213</id>
		<created>2009-02-21T07:56:42Z</created>
		<summary type="text/plain"><![CDATA[I was a little at a loss as to what to do for this assignment. I came up with half an idea for...]]></summary>
		<author>
			<name>sbouchard</name>
			<url>http://interactive.usc.edu/members/sbouchard</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/sbouchard/2009/02/ctin544_story_assignment.html">
			<![CDATA[I was a little at a loss as to what to do for this assignment. I came up with half an idea for something recombinant based on Jane Austen Unscripted, but I didn't have time to develop it. So I opted for lots of particles. Particles make everything better.]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[Processing: Briar Stories]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/wgraner/2009/02/processing_briar_stories.html" />
		<modified>2009-04-25T00:21:44Z</modified>
		<issued>2009-02-21T00:27:34Z</issued>
		<id>tag:,2009-02-21:interactive.usc.edu/members/wgraner:216</id>
		<created>2009-02-21T00:27:34Z</created>
		<summary type="text/plain"><![CDATA[Here is a representation of Robert Coover's Briar Rose, using some artificially intelligent...]]></summary>
		<author>
			<name>granerw</name>
			<url>http://interactive.usc.edu/members/wgraner</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/wgraner/2009/02/processing_briar_stories.html">
			<![CDATA[Here is a representation of Robert Coover's Briar Rose, using some artificially intelligent typography.  Download this all-inclusive zip to check it out.<br /><br /><a href="http://interactive.usc.edu/members/wgraner/BriarStories.zip">BriarStories.zip</a><br /><br />-B]]>
		</content>
	</entry>
	<entry>
		<title><![CDATA[CTIN544 assignment4: narrative - your own Luffy]]></title>
		<link rel="alternate" type="text/html" href="http://interactive.usc.edu/members/hchen/2009/02/ctin544_assignment4_narrative.html" />
		<modified>2009-02-21T00:34:34Z</modified>
		<issued>2009-02-21T00:07:16Z</issued>
		<id>tag:,2009-02-21:interactive.usc.edu/members/hchen:214</id>
		<created>2009-02-21T00:07:16Z</created>
		<summary type="text/plain"><![CDATA[//in order to understand this play, watch this...]]></summary>
		<author>
			<name>hchen</name>
			<url>http://interactive.usc.edu/members/hchen</url>
		</author>
		<dc:subject></dc:subject>
		<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://interactive.usc.edu/members/hchen/2009/02/ctin544_assignment4_narrative.html">
			<![CDATA[//in order to understand this play, watch this clip:<br />//http://www.youtube.com/watch?v=cQGi1hXNcMM<br />//See? Luffy is a rubber man, rubber man, happy rubber man~~<br />import traer.physics.*;<br />import traer.animation.*;<br /><br />final float NODE_SIZE = 20;<br />final float EDGE_LENGTH = 1;<br />final float EDGE_STRENGTH = 0.2;<br />final float SPACER_STRENGTH = 2000;<br /><br />boolean token = true;<br />int tag = 0;<br /><br />ParticleSystem physics;<br />Smoother3D centroid;<br /><br />Particle head, body, rShoulder, rArm, rHand, lShoulder, lArm,<br />lHand, waist, rKnee, rLeg, lKnee, lLeg;<br /><br />//float space = 10000;<br />//float space2 = 200;<br /><br /><br />void setup()<br />{<br />  size( 800, 600 );<br />  smooth();<br />  frameRate( 24 );<br />  strokeWeight( 2 );<br />  ellipseMode( CENTER );<br />  cursor(CROSS);<br /><br />  physics = new ParticleSystem( 0, 1 );<br />  centroid = new Smoother3D( 0.8 );<br />  centroid.setValue( 0, 0, 1.0 );<br />  makeChar();<br />  //addSpacersToNode();<br />}  <br /><br />void draw()<br />{<br />  physics.tick( 1.0 );<br />  if (mousePressed)<br />  {<br />    if (token == true)<br />    {<br />      tag = checkPoint();<br />    }<br />    move(tag);<br />  }<br /><br />  if ( physics.numberOfParticles() > 1 )<br />    updateCentroid();<br />  background( 255 );<br />  //translate( width/2 , height/2 );<br />  scale( centroid.z() );<br />  //translate( -centroid.x(), -centroid.y() );<br /><br />  drawNetwork();<br /><br />}<br /><br />void drawNetwork()<br />{      <br />  // draw edges <br />  stroke( 0 );<br />  beginShape( LINES );<br />  for ( int i = 0; i < physics.numberOfSprings(); ++i )<br />  {<br />    Spring e = physics.getSpring( i );<br />    Particle a = e.getOneEnd();<br />    Particle b = e.getTheOtherEnd();<br />    vertex( a.position().x(), a.position().y() );<br />    vertex( b.position().x(), b.position().y() );<br />  }<br />  endShape();<br /><br />  // draw vertices<br />  fill( 160 );<br />  noStroke();<br />  /*for ( int i = 1; i < physics.numberOfParticles(); ++i )<br />   {<br />   Particle v = physics.getParticle( i );<br />   ellipse( v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE );<br />   }*/<br />  ellipse( body.position().x(), body.position().y(), 1.5*NODE_SIZE, 1.5*NODE_SIZE );<br />  ellipse( waist.position().x(), waist.position().y(), NODE_SIZE, NODE_SIZE );<br /><br />  fill(100);<br />  ellipse( rArm.position().x(), rArm.position().y(), NODE_SIZE, NODE_SIZE );<br />  ellipse( lArm.position().x(), lArm.position().y(), NODE_SIZE, NODE_SIZE );  <br /><br />  fill(0);<br />  ellipse( rLeg.position().x(), rLeg.position().y(), NODE_SIZE, NODE_SIZE );<br />  ellipse( lLeg.position().x(), lLeg.position().y(), NODE_SIZE, NODE_SIZE );<br />  ellipse( rShoulder.position().x(), rShoulder.position().y(), NODE_SIZE/3, NODE_SIZE/3 );<br />  ellipse( lShoulder.position().x(), lShoulder.position().y(), NODE_SIZE/3, NODE_SIZE/3 );<br />  ellipse( rKnee.position().x(), rKnee.position().y(), NODE_SIZE/3, NODE_SIZE/3 );<br />  ellipse( lKnee.position().x(), lKnee.position().y(), NODE_SIZE/3, NODE_SIZE/3 );<br /><br />  fill(255);<br />  stroke(0);<br />  ellipse(head.position().x(), head.position().y(),2*NODE_SIZE, 2*NODE_SIZE);<br />  //ellipse(head.position().x(), head.position().y(), NODE_SIZE, NODE_SIZE);<br />}<br /><br /><br />void updateCentroid()<br />{<br />  float <br />    xMax = Float.NEGATIVE_INFINITY, <br />  xMin = Float.POSITIVE_INFINITY, <br />  yMin = Float.POSITIVE_INFINITY, <br />  yMax = Float.NEGATIVE_INFINITY;<br /><br />  for ( int i = 0; i < physics.numberOfParticles(); ++i )<br />  {<br />    Particle p = physics.getParticle( i );<br />    xMax = max( xMax, p.position().x() );<br />    xMin = min( xMin, p.position().x() );<br />    yMin = min( yMin, p.position().y() );<br />    yMax = max( yMax, p.position().y() );<br />  }<br />  float deltaX = xMax-xMin;<br />  float deltaY = yMax-yMin;<br />  if ( deltaY > deltaX )<br />    centroid.setTarget( xMin + 0.5*deltaX, yMin +0.5*deltaY, height/(deltaY+50) );<br />  else<br />    centroid.setTarget( xMin + 0.5*deltaX, yMin +0.5*deltaY, width/(deltaX+50) );<br />}<br /><br />void addSpacersToNode()<br />{<br />  for ( int i = 0; i < physics.numberOfParticles()-1; ++i )<br />  {<br />    for (int j=i;j<physics.numberOfParticles();++j)<br />    {<br />      Particle q = physics.getParticle( i );<br />      Particle p = physics.getParticle( j );<br />      physics.makeAttraction( p, q, -1.5*SPACER_STRENGTH, 2 );<br />    }<br />  }<br />}<br /><br />void makeChar()<br />{<br />  head = physics.makeParticle(1,width/2,height/2,0);<br />  //head.makeFixed();<br /><br />  //make the other parts of the body<br />  body = physics.makeParticle(1,width/2,height/2,0);<br />  rShoulder = physics.makeParticle(1,width/2,height/2,0);<br />  rArm = physics.makeParticle(1,width/2,height/2,0);<br />  //rHand = physics.makeParticle();<br />  lShoulder = physics.makeParticle(1,width/2,height/2,0);<br />  lArm = physics.makeParticle(1,width/2,height/2,0);<br />  //lHand = physics.makeParticle();<br />  waist = physics.makeParticle(1,width/2,height/2,0);<br />  rKnee = physics.makeParticle(1,width/2,height/2,0);<br />  rLeg = physics.makeParticle(1,width/2,height/2,0);<br />  lKnee = physics.makeParticle(1,width/2,height/2,0);<br />  lLeg = physics.makeParticle(1,width/2,height/2,0);<br /><br />  addSpacersToNode();<br /><br />  //make connections between parts<br />  physics.makeSpring(head, body, 1.2*EDGE_STRENGTH, 1.2*EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(body, rShoulder, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH/3);<br />  physics.makeSpring(body, lShoulder, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH/3);<br />  physics.makeSpring(rShoulder, rArm, EDGE_STRENGTH, EDGE_STRENGTH/10, EDGE_LENGTH);<br />  //physics.makeSpring(rArm, rHand, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(lShoulder, lArm, EDGE_STRENGTH, EDGE_STRENGTH/10, EDGE_LENGTH);<br />  //physics.makeSpring(lArm, lHand, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(body, waist, 2*EDGE_STRENGTH, 2*EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(waist, rKnee, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(rKnee, rLeg, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(waist, lKnee, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br />  physics.makeSpring(lKnee, lLeg, EDGE_STRENGTH, EDGE_STRENGTH, EDGE_LENGTH);<br /><br />  //move parts<br />  body.moveTo(head.position().x()+random(-1,1), head.position().y()+random(-1,1),0);<br />  rShoulder.moveTo(body.position().x()+random(-1,1), body.position().y()+random(-1,1),0);<br />  rArm.moveTo(rShoulder.position().x()+random(-1,1), rShoulder.position().y()+random(-1,1),0);<br />  //rHand.moveTo(rArm.position().x()+random(-1,1), rArm.position().y()+random(-1,1),0);<br />  lShoulder.moveTo(body.position().x()+random(-1,1), body.position().y()+random(-1,1),0);<br />  lArm.moveTo(lShoulder.position().x()+random(-1,1), lShoulder.position().y()+random(-1,1),0);<br />  //lHand.moveTo(lArm.position().x()+random(-1,1), lArm.position().y()+random(-1,1),0);<br />  waist.moveTo(body.position().x()+random(-1,1), body.position().y()+random(-1,1),0);<br />  rKnee.moveTo(waist.position().x()+random(-1,1), waist.position().y()+random(-1,1),0);<br />  rLeg.moveTo(rKnee.position().x()+random(-1,1), rKnee.position().y()+random(-1,1),0);<br />  lKnee.moveTo(waist.position().x()+random(-1,1), waist.position().y()+random(-1,1),0);<br />  lLeg.moveTo(lKnee.position().x()+random(-1,1), lKnee.position().y()+random(-1,1),0);<br /><br />}<br /><br />//collisiton detection on border<br />void handleBoundaryCollisions( Particle p )<br />{<br />  if ( p.position().x() < 0 || p.position().x() > width )<br />    p.setVelocity( -2*p.velocity().x(), p.velocity().y(), 0 );<br />  if ( p.position().y() < 0 || p.position().y() > height )<br />    p.setVelocity( p.velocity().x(), -2*p.velocity().y(), 0 );<br />  p.moveTo( constrain( p.position().x(), 0, width ), constrain( p.position().y(), 0, height ), 0 ); <br />}<br /><br />//check the body part<br />int checkPoint(){<br />  //float N2 = NODE_SIZE * NODE_SIZE;<br /><br /><br />  //println(NODE_SIZE+"+"+distance+",");<br /><br />  for ( int i = 0; i < physics.numberOfParticles(); ++i )<br />  {    <br />    Particle p = physics.getParticle( i);<br />    float distance = sqrt(sq(p.position().x()-mouseX)+sq(p.position().y()-mouseY));<br />    if (distance < NODE_SIZE){<br />      token = false;<br />      return i;<br />      //print(i);<br />    }<br /><br />    //float c = p.position().x();<br />    //print(c);<br />  }<br />  return 3;<br />  //rArm.moveTo(mouseX-400, mouseY-200, 0);<br />  //<br />}<br /><br />//drag the char<br />void move(int tag)<br />{<br />  Particle p = physics.getParticle(tag);<br />  p.moveTo(mouseX, mouseY, 0);<br />  //println(NODE_SIZE+"+"+distance+",");<br />  //rArm.velocity().clear();<br />}  <br /><br />//reset the tag<br />void mouseReleased()<br />{<br />  Particle p = physics.getParticle(tag);<br />  p.setVelocity((mouseX - pmouseX), (mouseY - pmouseY), 0 );<br />  token = true;<br />}<br /><br /><br />void keyPressed()<br />{<br />  switch (key)<br />  {<br />    case ' ':<br />    physics.setGravity(0);<br />    case '=':<br />    physics.setGravity(1);<br />    case '-':<br />    physics.setGravity(-1);<br />  }<br />}<br />    <br />  ]]>
		</content>
	</entry>
</feed>