Commits

Anonymous committed c4ac159

Mother 0.6

Comments (0)

Files changed (18)

Foetus/.classpath

+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6.0_16"/>
+	<classpathentry kind="lib" path="C:/Program Files/Processing/lib/core.jar"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/shapetween"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>processing-Foetus</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Foetus/.settings/org.eclipse.jdt.ui.prefs

+#Fri Nov 07 14:40:51 GMT 2008
+eclipse.preferences.version=1
+internal.default.compliance=default

Foetus/examples/Gradient/Gradient.pde

+import oscP5.*;
+import netP5.*;
+import processing.opengl.*;
+
+import foetus.*;
+import processing.core.*;
+import processing.core.PApplet.RegisteredMethods;
+
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+// Messages:
+// "/Gradient/TopColor" iii
+// "/Gradient/BottomColor" iii
+
+public Foetus f;
+
+FoetusParameter m_TopR;
+FoetusParameter m_TopG;
+FoetusParameter m_TopB;
+FoetusParameter m_BotR;
+FoetusParameter m_BotG;
+FoetusParameter m_BotB;
+	
+void setup()
+{
+  // When run as a synth, setup() is never called!
+  // put the necessary initialization code in a method named initializeFoetus().
+  // The necessary Processing initialization calls are called by Mother, and so should be left out from
+  // initializeFoetus().
+  // Finally, for the synth to work as a processing sketch within the PDE, call initializeFoetus() from within
+  // setup().
+
+  size(400, 300, OPENGL);
+  frameRate(24);
+
+  initializeFoetus();
+}
+
+void initializeFoetus()
+{
+  noStroke();
+
+  // Instantiate foetus object here
+  f = new Foetus(this);
+
+  // Register messages that synth responds to (see OSC documentation)
+  // This is here done automatically by the FoetusParameter constructors.
+  m_TopR = new FoetusParameter(f, 1.0, "/TopRed", 	"f");
+  m_TopG = new FoetusParameter(f, 0, "/TopGreen", 	"f");
+  m_TopB = new FoetusParameter(f, 0, "/TopBlue",        "f");
+  m_BotR = new FoetusParameter(f, 0, "/BotRed", 	"f");
+  m_BotG = new FoetusParameter(f, 0, "/BotGreen", 	"f");
+  m_BotB = new FoetusParameter(f, 0, "/BotBlue", 	"f");
+}
+
+// Uncomment this before exporting Gradient.jar for use with Mother!
+
+void init()
+{
+  sizeMethods 		= new RegisteredMethods();
+  preMethods 		= new RegisteredMethods();
+  drawMethods 		= new RegisteredMethods();
+  postMethods 		= new RegisteredMethods();
+  mouseEventMethods 	= new RegisteredMethods();
+  keyEventMethods 	= new RegisteredMethods();
+  disposeMethods 	= new RegisteredMethods();
+}
+
+
+void draw()
+{
+  pushMatrix();
+		
+  beginShape(QUADS);
+			
+  fill(m_TopR.getValue()*255, m_TopG.getValue()*255, m_TopB.getValue()*255);
+  vertex(0, 0);
+  vertex(width - 1, 0);
+		
+  fill(m_BotR.getValue()*255, m_BotG.getValue()*255, m_BotB.getValue()*255);
+  vertex(width - 1, height - 1);
+  vertex(0, height - 1);
+
+  endShape();
+			
+  popMatrix();
+}
+
+/**
+ * This method is called when an OSC message is received by the synth.
+ */
+void oscEvent(OscMessage theOscMessage)
+{
+  if (theOscMessage.checkAddrPattern("/TopRed") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopR.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/TopGreen") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopG.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/TopBlue") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopB.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/BotRed") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_BotR.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  }
+  else if (theOscMessage.checkAddrPattern("/BotGreen") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_BotG.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  }
+  else if (theOscMessage.checkAddrPattern("/BotBlue") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_BotB.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  }
+}

Foetus/examples/Waltz/Waltz.pde

+
+import oscP5.*;
+import netP5.*;
+import processing.opengl.*;
+
+import foetus.*;
+import processing.core.*;
+import processing.core.PApplet.RegisteredMethods;
+
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+/**
+ * Geometry by Marius Watz.
+ * 
+ * Modified by Ilias Bergstrom to be compatible with the Mother visual synthesizer host.
+ * 
+ * Using sin/cos lookup tables, blends colors, and draws a series of rotating arcs on the screen.
+ */
+
+// Declare Foetus
+public Foetus f;
+
+FoetusParameter m_Scale;
+
+// Trig lookup tables borrowed from Toxi. Cryptic but effective
+float sinLUT[];
+
+float cosLUT[];
+
+float SINCOS_PRECISION = 1.0f;
+
+int SINCOS_LENGTH = (int) ((360.0 / SINCOS_PRECISION));
+
+// System data
+boolean dosave = false;
+
+int num;
+
+float pt[];
+
+int style[];
+
+void setup()
+{
+  // When run as a synth, setup() is never called!
+  // 
+  // Put the necessary initialization code in a method named initializeFoetus().
+  // The necessary Processing initialization calls size() and frameRate()
+  // are called by Mother, and so should be left out from initializeFoetus().  
+  // Finally, for the synth to work as a processing sketch within the PDE,
+  // call initializeFoetus() from within setup().
+
+  size(640, 480, OPENGL);
+  frameRate(24);
+  
+  initializeFoetus();
+}
+
+// Uncomment this before exporting Gradient.jar for use with Mother!
+
+void init()
+{
+  sizeMethods 		= new RegisteredMethods();
+  preMethods 		= new RegisteredMethods();
+  drawMethods 		= new RegisteredMethods();
+  postMethods 		= new RegisteredMethods();
+  mouseEventMethods 	= new RegisteredMethods();
+  keyEventMethods 	= new RegisteredMethods();
+  disposeMethods 	= new RegisteredMethods();
+}
+
+	
+void initializeFoetus()
+{
+  
+  // Instantiate foetus object here
+  f = new Foetus(this);
+
+  // Register messages that synth responds to (see OSC documentation)
+  // This is here done automatically by the FoetusParameter constructors.
+  m_Scale = new FoetusParameter(f, 1.0f, "/Scale", "f");
+
+  // Fill the tables
+  sinLUT = new float[SINCOS_LENGTH];
+  cosLUT = new float[SINCOS_LENGTH];
+
+  for (int i = 0; i < SINCOS_LENGTH; i++)
+  {
+    sinLUT[i] = (float) Math.sin(i * DEG_TO_RAD * SINCOS_PRECISION);
+    cosLUT[i] = (float) Math.cos(i * DEG_TO_RAD * SINCOS_PRECISION);
+  }
+
+  num = 150;
+  pt = new float[6 * num]; // rotx, roty, deg, rad, w, speed
+  style = new int[2 * num]; // color, render style
+
+  // Set up arc shapes
+  int index = 0;
+  float prob;
+  for (int i = 0; i < num; i++)
+  {
+    pt[index++] = random(PI * 2); // Random X axis rotation
+    pt[index++] = random(PI * 2); // Random Y axis rotation
+
+    pt[index++] = random(60, 80); // Short to quarter-circle arcs
+    if (random(100) > 90)
+	pt[index] = (int) random(8, 27) * 10;
+
+    pt[index++] = (int) (random(2, 50) * 5); // Radius. Space them out nicely
+
+    pt[index++] = random(4, 32); // Width of band
+    if (random(100) > 90)
+      pt[index] = random(40, 60); // Width of band
+
+    pt[index++] = radians(random(5, 30)) / 5; // Speed of rotation
+
+    // get colors
+    prob = random(100);
+
+    if (prob < 30)
+      style[i * 2] = colorBlended(random(1), 255, 0, 100, 255, 0, 0, 210);
+    else if (prob < 70)
+      style[i * 2] = colorBlended(random(1), 0, 153, 255, 170, 225, 255, 210);
+    else if (prob < 90)
+      style[i * 2] = colorBlended(random(1), 200, 255, 0, 150, 255, 0, 210);
+    else
+      style[i * 2] = color(255, 255, 255, 220);
+
+    if (prob < 50)
+      style[i * 2] = colorBlended(random(1), 200, 255, 0, 50, 120, 0, 210);
+    else if (prob < 90)
+      style[i * 2] = colorBlended(random(1), 255, 100, 0, 255, 255, 0, 210);
+    else
+      style[i * 2] = color(255, 255, 255, 220);
+
+    style[i * 2 + 1] = (int) (random(100)) % 3;
+  }
+}
+
+void draw()
+{
+  int index = 0;
+  translate(width / 2, height / 2, 0);
+  rotateX(PI / 6);
+  rotateY(PI / 6);
+
+  scale(m_Scale.getValue());
+
+  for (int i = 0; i < num; i++)
+  {
+    pushMatrix();
+
+    rotateX(pt[index++]);
+    rotateY(pt[index++]);
+
+    if (style[i * 2 + 1] == 0)
+    {
+      stroke(style[i * 2]);
+      noFill();
+      strokeWeight(1);
+      arcLine(0, 0, pt[index++], pt[index++], pt[index++]);
+    } 
+    else if (style[i * 2 + 1] == 1)
+    {
+      fill(style[i * 2]);
+      noStroke();
+      arcLineBars(0, 0, pt[index++], pt[index++], pt[index++]);
+    }
+    else
+    {
+      fill(style[i * 2]);
+      noStroke();
+      arc(0, 0, pt[index++], pt[index++], pt[index++]);
+    }
+
+    // increase rotation
+    pt[index - 5] += pt[index] / 10;
+    pt[index - 4] += pt[index++] / 20;
+
+    popMatrix();
+  }
+}
+
+// Get blend of two colors
+int colorBlended(float fract, float r, float g, float b, float r2, float g2, float b2, float a)
+{
+  r2 = (r2 - r);
+  g2 = (g2 - g);
+  b2 = (b2 - b);
+  return color(r + r2 * fract, g + g2 * fract, b + b2 * fract, a);
+}
+
+// Draw arc line
+void arcLine(float x, float y, float deg, float rad, float w)
+{
+  int a = (int) (min(deg / SINCOS_PRECISION, SINCOS_LENGTH - 1));
+  int numlines = (int) (w / 2);
+
+  for (int j = 0; j < numlines; j++)
+  {
+    beginShape();
+    for (int i = 0; i < a; i++)
+    {
+      vertex(cosLUT[i] * rad + x, sinLUT[i] * rad + y);
+    }
+    endShape();
+    rad += 2;
+  }
+}
+
+// Draw arc line with bars
+void arcLineBars(float x, float y, float deg, float rad, float w)
+{
+  int a = (int) ((min(deg / SINCOS_PRECISION, SINCOS_LENGTH - 1)));
+  a /= 4;
+
+  beginShape(QUADS);
+
+  for (int i = 0; i < a; i += 4)
+  {
+    vertex(cosLUT[i] * (rad) + x, sinLUT[i] * (rad) + y);
+    vertex(cosLUT[i] * (rad + w) + x, sinLUT[i] * (rad + w) + y);
+    vertex(cosLUT[i + 2] * (rad + w) + x, sinLUT[i + 2] * (rad + w) + y);
+    vertex(cosLUT[i + 2] * (rad) + x, sinLUT[i + 2] * (rad) + y);
+  }
+
+  endShape();
+}
+
+// Draw solid arc
+void arc(float x, float y, float deg, float rad, float w)
+{
+  int a = (int) (min(deg / SINCOS_PRECISION, SINCOS_LENGTH - 1));
+  beginShape(QUAD_STRIP);
+  for (int i = 0; i < a; i++)
+  {
+    vertex(cosLUT[i] * (rad) + x, sinLUT[i] * (rad) + y);
+    vertex(cosLUT[i] * (rad + w) + x, sinLUT[i] * (rad + w) + y);
+  }
+  endShape();
+}
+
+/**
+ * This method is called when an OSC message is received by the synth.
+ */
+void oscEvent(OscMessage theOscMessage)
+{
+  try
+  {
+    if (theOscMessage.checkAddrPattern("/Scale") == true)
+    {
+      /* check if the typetag is the right one. */
+      if (theOscMessage.checkTypetag("f"))
+      {
+        m_Scale.setValue(theOscMessage.get(0).floatValue());
+	// println("got message: " + m_Scale);
+	return;
+      }
+    }
+  } 
+  catch (Exception e)
+  {
+     println("Exception while processing Waltz input " + " " + theOscMessage.addrPattern());
+  }
+}
+

Foetus/readme.html

+<html>
+<head>
+<title>Library Template &gt;&gt; Develop Processing </title>
+<base href="http://dev.processing.org/libraries/" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link rel="stylesheet" href="../../processing_beta.css">
+<style type="text/css">
+ul {
+   	list-style: none outside;
+   }
+ </style>
+
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+
+
+function MM_preloadImages() { //v3.0
+  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
+    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
+    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
+}
+//-->
+</script>
+</head>
+<body bgcolor="#FFFFFF" text="#333333" link="#CC6600" vlink="#CC6600" alink="#CC6600" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
+<table width="750" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
+  <tr> 
+    <td width="550" colspan="2"><img src="../images/processing_dev.gif" width="500" height="50"></td>
+
+    <td width="180" align="right" valign="top" bgcolor="#FFFFFF"> <img src="images/1pix.gif" width="180" height="8"></td>
+
+    <td width="20">&nbsp;</td>
+  </tr>
+</table>
+<table width="750" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="55" bgcolor="#CCCCBE" height="25">&nbsp;</td>
+    <td width="675" valign="middle" rowspan="2"> 
+      <table = width="675" valign="middle" border="0" cellspacing="0" cellpadding="0">
+        <tr> 
+          <td width="1" height="25" bgcolor="#CCCCBE"><a href="../">Cover</a>&nbsp;</td>
+
+          <td width="1" height="25" bgcolor="#CCCCBE"><font color="#999999">\</font>&nbsp;<a href="../build/">Build</a>&nbsp;</td>
+
+          <td width="1" height="25" bgcolor="#CCCCBE"><font color="#999999">\</font>&nbsp;<a href="../source/">Source</a>&nbsp;</td>
+          <td width="1" height="25" bgcolor="#CCCCBE"><font color="#999999">\</font>&nbsp;<a href="../bugs/">Bugs</a><font color="#CCCCBE">&nbsp; 
+            </font></td>
+          <td width="1" height="25" bgcolor="#CCCCBE"><font color="#999999">\</font>&nbsp;<a href="../reference/">Reference</a>&nbsp;</td>
+
+          <td width="1" height="25" bgcolor="#CCCCBE"><font color="#999999">\</font>&nbsp;<a href="../libraries/"><font color="#666666">Libraries</font></a>&nbsp;</td>
+
+          <td width="672" height="25" bgcolor="#CCCCBE">&nbsp;</td>
+        </tr>
+        <tr> 
+          <td width="1" height="25" bgcolor="#FFFFFF">&nbsp;</td>
+          <td width="1" height="25" bgcolor="#FFFFFF">&nbsp;</td>
+          <td width="1" height="25" bgcolor="#FFFFFF">&nbsp;</td>
+	  	  <td width="1" height="25" bgcolor="#FFFFFF">&nbsp;</td>
+
+	  	  <td width="1" height="25" bgcolor="#FFFFFF">&nbsp;</td>
+		  <td width="672" height="25" colspan="2" valign="middle" bgcolor="#DDDDCD"> 
+            <img src="../images/nav_bottomarrow.gif" width="33" height="25" align="absmiddle"><a href="./index.html">Overview</a> <font color="#999999">\</font> <a href="./guidelines.html">Guidelines</a> <font color="#999999">\</font> <a href="./template.html"><font color="#666666">Template</font></a> <font color="#999999">\</font> <a href="./basics.html">Basics</a>
+
+          </td>
+        </tr>
+      </table>
+    </td>
+    <td width="20" bgcolor="#CCCCBE" height="25" valign="middle">&nbsp;</td>
+  </tr>
+  <tr> 
+    <td width="55" bgcolor="#FFFFFF" height="25" valign="middle">&nbsp;</td>
+
+    <td width="20" bgcolor="#DDDDCD" height="25" valign="middle">&nbsp;</td>
+
+  </tr>
+</table>
+<table width="750" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
+  <tr> 
+    <td width="55"><img src="../images/1pix.gif" width="55" height="40"></td>
+    <td width="695">&nbsp;</td>
+  </tr>
+</table>
+<table width="750" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
+  <tr> 
+    <td width="55"><img src="../images/1pix.gif" width="55" height="1"></td>
+
+    <td width="695" valign="top">
+    
+    <table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
+    <tr><td>
+	 <h3>Eclipse Library Template</h3>
+     <p>The following describe how to set up a Processing library project in Eclipse and build it successfully, and to make your library ready for distribution.</p>
+     <ol>
+     <li>Download the latest Eclipse template from <a href="http://code.google.com/p/processing-library-template/downloads/list" rel="nofollow">here</a>. <strong>Don&#x27;t unzip the .zip file yet</strong>.<br><br></li>
+
+     <li>Create a new java project in eclipse. from the menubar choose File &rarr; New &rarr; Java Project. Give the project the name of your library. <br><br></li>
+     <li>Right-click (ctrl-click) onto the folder icon of your newly created project in the &quot;Package Explorer&quot; and choose &quot;Import&quot; from the menu that pops up. Select General &rarr; Archive File, click &quot;Next&quot; and navigate to the zip file you downloaded earlier in step 1. Confirm the archive with &quot;Finish&quot;. <br><br></li>
+
+     <li>Open your project&#x27;s &quot;Properties&quot; window. Under &quot;Java Build Path&quot;, select the &quot;Libraries&quot; tab and use &quot;add external JARs&quot; and add processing&#x27;s core.jar to your build path. It is recommended that a copy of core.jar is located in your eclipse workspace in a folder libs. If folder libs does not exist yet, create it. Read the section below regarding where to find the core.jar file. <br><br></li>
+     <li>Confirm the setup with &quot;finish&quot;. <br><br></li>
+
+     <li>Open the &quot;resources&quot; folder inside of your java project and double click the build.xml file. This file will be used to compile your library with apache ant. After double clicking the file, you should see its content in the eclipse editor. Edit the ant file, make changes to items 1-14 at the beginning of the file so that the values and paths are properly set for your project to compile. A path can be a relative path or absolute. (1-4 are settings for compiling your project. 5-14 are settings for the automatically generated html document.) <br><br></li>
+     <li>From the menu bar, choose Window &rarr; Show View &rarr; Ant. A tab with the title ant will pop up on the right side of your eclipse editor. Drag the resources/build.xml file in there, and a new item &quot;processingLibs&quot; will appear. Press the play button inside the ant tab. <br><br></li>
+     <li>BUILD SUCCESSFUL. The library template will start to compile, control-messages will appear in the console window, warnings can be ignored. When finished it should say BUILD SUCCESSFUL. congratulations, you are set and you can start writing your own library by making changes to the source code in folder &quot;src&quot;. <br><br></li>
+
+     <li>BUILD FAILED. In case the compile process fails, check the output in the console which will give you a closer idea of what went wrong. Wrrors may have been caused by<br><br>
+     <ul>
+     	<li>Incorrect path settings in the build.xml file. <br><br></li>
+     	<li>Error &quot;Javadoc failed&quot;. if you are on windows, make sure you are using a JDK instead of a JRE in order to be able to create the javadoc for your library. JRE does not come with the javadoc application, but it is required to create libraries from this template. <br></li>
+     </ul>
+     </li>
+
+     </ol>
+     After having compiled and built your project successfully, you should be able to find your library in processing&#x27;s sketchbook folder, examples will be listed in processing&#x27;s sketchbook menu. Files that have been created for the distribution of the library are located in your eclipse&#x27;s workspace/yourProject/distribution folder. In there you find the web folder which contains the documentation, a zip file for downloading your library, a folder with examples as well as the index.html and css file.
+     <p>To distribute your library please refer to the <a href="guidelines.html">guidelines</a>.</p>
+     <br>
+
+
+<b>Source code</b>
+
+	<p>If you want to share your library's source code, we recommend to use an online repository available for free at <a href="http://code.google.com">code.google.com</a> or <a href="http://sourceforge.net">sourceforge.net</a>.</p>
+	<br>
+
+<b>Adding core.jar and other .jar files to your classpath</b>
+<br>
+<p>The core.jar file contains the core classes of processing and has to be part of your classpath when building a library. On Windows and Linux, the file is located in the Processing distribution folder inside a folder named "lib". On Mac OS X, right-click Processing.app and use Show Package Contents to see the guts. The lib folder is at Contents &rarr; Resources &rarr; Java &rarr; lib. For further information about the classes in core.jar, you can see the source <a href="http://dev.processing.org/source/index.cgi/trunk/processing/">here</a> and the developer documentation <a href="http://dev.processing.org/reference/core/">here</a>.</p>
+
+<p>If you created a "libs" folder as described above, put the libraries you need to add to your classpath in there. In the "Properties" of your java project, navigate to Java Build Path &rarr; Libraries, and click "Add External JARs". Select the .jar files from the libs folder that are required for compiling you project. Adjust the build.xml file accordingly.</p>
+
+<p>The libs folder is recommended but not a requirement, nevertheless you need to specify where your jar files are located in your system in order to add them to the classpath.</p>
+
+<p>In case a library depends on systems libraries, put these dependencies next to the jar file. For example processing's opengl.jar library depends on jogl hence the dlls (for windows) or jnilibs (for osx) have to be located next to the opengl.jar file.</p>
+
+<br>
+<b>What is the difference between JDK and JRE?</b>
+
+<p>JDK stands for Java Development Kit whereas JRE stands for Java Runtime Environment.
+For developers it is recommended to work with a JDK instead of a JRE since more Java development related applications such as Javadoc. Javadoc is a requirement to properly compile and document a Processing library as described on the guidelines page.</p>
+
+<p>You can have both, a JDK and a JRE, installed on your system. in eclipse you need to specify which one you want to use.</p>
+
+<br>
+<b>The JRE System Library</b>
+
+<p>This primarily affects Windows and Linux users (because the full JDK is installed by default on Mac OS X). It is recommended that you use the JDK instead of a JRE. The JDK can be downloaded from <a href="http://java.sun.com/javase/downloads/index.jsp">Sun's download site</a>. Also see the <a href="http://java.sun.com/javase/6/webnotes/install/index.html">Java webnotes </a> which contain useful information about installation.</p>
+
+<p>To change the JRE used to compile your java project:
+
+<ol>
+
+<li>open the properties of your project from the menu Project &rarr; Properties", select "Java Build Path" and in its sub menu, click on the "Libraries" tab.
+<li>A list of JARs and class folders in the build path will show up. In this list you can find the JRE System Library that is used to compile your code. Remove this JRE System library. 
+<li>Click "Add Library..." In the popup window choose "JRE System Library" and press "Next". 
+<li>Select an alternate JRE from the pull-down menu or click and modify the "installed JREs". Confirm with "Finish" and "OK".
+</ol>
+<br>
+<b>Compiling with ant and javadoc</b>
+
+<p>
+Ant is a Java-based build tool. For more information visit the <a href="http://ant.apache.org/faq.html#what-is-ant">ant</a> web site. Ant uses a file named <tt>build.xml</tt> to store build settings for a project.
+
+</p>
+
+<p>
+Javadoc is an application that creates an HTML-based API documentation of Java code. You can check for its existence by typing <tt>javadoc</tt> on the command line. On Mac OS X it is installed by default. On Windows and Linux, installing the JDK will also install the javadoc tool.
+</p>
+	</td></tr>
+	</table>
+
+
+</td>
+  </tr>
+
+</table>
+<table width="750" border="0" cellspacing="0" cellpadding="0">
+  <tr> 
+    <td width="55"><br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> 
+      <br /> </td>
+
+    <td width="20">&nbsp;</td>
+
+  </tr>
+  <tr> 
+    <td width="55" height="25" bgcolor="#DDDDCD" valign="top">&nbsp;</td>
+    <td width="675" valign="middle" bgcolor="#DDDDCD">Processing is an open project 
+      initiated by <a href="http://benfry.com">Ben Fry</a> and <a href="http://reas.com">Casey 
+      Reas</a></td>
+    <td width="20" bgcolor="#DDDDCD" valign="top">&nbsp;</td>
+  </tr>
+
+  <tr> 
+    <td width="55" height="25" bgcolor="#CCCCBE">&nbsp;</td>
+    <td width="675" valign="middle" bgcolor="#CCCCBE"><a href="http://processing.org/copyright.html">&copy; 
+      Info</a> &#92; Site hosted by <a href="">Media Temple!</a></td>
+    <td width="20" bgcolor="#CCCCBE">&nbsp;</td>
+  </tr>
+</table>
+</body>
+
+</html>

Foetus/resources/build.xml

+<project name="processingLibs" default="build" basedir="../">
+    
+	<description>
+        processingLibs. ant build file.
+    </description>
+
+	
+<!-- #### (1) where are your processing libraries located? edit location. #### -->
+	<property name="processing" location="D:\Documents\Processing\libraries"/>
+
+
+<!-- #### (2) where are the jar files located that are required for compiling 
+		your library such as e.g. core.jar ? edit location. #### -->
+
+	<property name="libraryClasspath"  location="C:\Program Files\Processing\lib"/>	
+	<path id="library-classpath">
+		<fileset dir="${libraryClasspath}" >		
+<!-- #### (3) add the jar files that are required for compiling. edit name.
+		for more include files. duplicate <include name="" /> #### -->
+			<include name="core.jar"/>
+		</fileset>
+	</path>		
+	
+
+<!-- #### (4) set the java version that should be used to compile your library. #### -->	
+	<property name="javaVersion" value="1.6"/>
+		
+		
+		
+	<!-- #### 	the following items are properties that will be used to make changes to 
+				the html document template. values of properties will be 
+				implemented ito the document automatically. #### -->	
+				
+<!-- #### (5) who is the author of this library?  edit value.  #### -->
+	<property name="author" value="Ilias Bergstrom"/>
+	
+<!-- #### (6) which copyright?  edit value.  #### -->
+	<property name="copyright" value="(c) 2009"/>
+
+<!-- #### (7) give your library a name. edit value.  #### -->
+	<property name="libraryName"  value="Foetus"/>
+	
+<!-- #### (8) give your library a name. edit value.   #### -->
+	<property name="versionNumber"  value="0.5.0"/>
+	
+<!-- #### (9) your contact url. edit value. #### -->
+	<property name="yourLink"  value="http://www.onar3d.com" />
+	
+<!-- #### (10) a comma separated list of keywords describing your library. edit value. #### -->
+	<property name="keywords"  value="Live, Performance, VJ, VJ-ing, OSC" />
+	
+<!-- #### (11) a comma separated list of platforms the library has been tested. edit value. #### -->
+	<property name="tested:platform"  value="Windows" />
+	
+<!-- #### (12) the processing version this library has been tested with. edit value. #### -->
+	<property name="tested:processingVersion"  value="1.0.7" />
+	
+<!-- #### (13) does the library depend on any other library, dll, jnilib, etc. edit value. #### -->
+	<property name="tested:dependencies"  value="?" />
+	
+<!-- #### (14) where can the source code be found? edit value. #### -->
+	<property name="source:host"  value="google code" />
+	<property name="source:url"  value="http://code.google.com/p/processing-mother" />
+	<property name="source:repository"  value="http://code.google.com/p/processing-mother/source/browse/" />
+
+
+
+
+
+
+
+
+	
+	
+	
+	
+	<!-- no changes or adjustments required below -->
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	
+	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
+		<classpath>
+			<pathelement location="./resources/code/ant-contrib-1.0b3.jar"/>
+		</classpath>
+	</taskdef>
+	<property name="jarFile" value="${libraryName}.jar"/>
+	<property name="src" location="src"/>
+	<property name="bin" location="bin"/>
+	<property name="reference" location="reference"/>
+	<property name="dist" location="distribution"/>
+	
+	
+	
+	<target name="init">
+	<echo>Properties initialized.
+	src path			${src}
+	bin path 			${bin}
+	libraryClasspath		${libraryClasspath}
+	processing Libraries	${processing}
+	java version		${javaVersion}
+	</echo>		
+	<echo>building library ...</echo>
+	<!-- Create the time stamp -->
+	<tstamp> 
+		<format property="date" pattern="MM/dd/yyyy" offset="0" unit="hour"/>
+	</tstamp>
+	<mkdir dir="${dist}"/>
+  </target>
+  
+	<!-- compile the library -->
+  <target name="compile" depends="init" description="compile the source" >  	
+		<javac srcdir="${src}" destdir="${bin}" source="${javaVersion}">
+			<classpath>
+				<path refid="library-classpath"/>
+			</classpath>
+		</javac>
+  </target>
+
+	<!-- build the distribution of the library -->
+  <target name="build" depends="compile" description="generate the distribution" >
+  	<!-- delete the previous content of the ${dist} folder -->
+  	<delete dir="${dist}" />
+  	
+  	<!-- build the structure for ${dist} -->
+  	<mkdir dir="${dist}" />
+  	<mkdir dir="${dist}/library" />
+  	<mkdir dir="${dist}/examples" />
+  	<mkdir dir="${dist}/reference" />
+  	<mkdir dir="${dist}/src" />
+  	<jar jarfile="${dist}/library/${jarFile}" basedir="${bin}"/>
+  	<copy todir="${dist}/examples">
+  		<fileset dir="examples"/>
+  	</copy>
+  	<copy todir="${dist}/src">
+  		<fileset dir="src"/>
+  	</copy> 
+  	
+	<!-- create the java reference of the library -->
+ 	<mkdir dir="${reference}" />
+ 	<javadoc bottom="processing library ${libraryName} by ${author}. ${copyright}" 
+ 			 classpath="${libraryClasspath}/core.jar" 
+ 			 destdir="${reference}" 
+ 			 verbose="false" 
+ 			 stylesheetfile="resources/stylesheet.css" 
+ 			 doctitle="Javadocs: ${libraryName}" 
+ 			 public="true" version="false" 
+ 			 windowtitle="Javadocs: ${libraryName}">
+ 		<taglet name="ExampleTaglet" path="resources/code" />
+ 		<fileset dir="${src}" defaultexcludes="yes">
+ 			<!-- #### (9) add packages to be added to reference. #### -->
+			<include name="**/*"/>
+		</fileset>
+ 	</javadoc>
+ 	
+	<copy todir="${dist}/reference">
+		<fileset dir="${reference}" />
+	</copy>
+  	
+  	  	<!-- copy the jar file to processing's libraries -->
+  	  	<mkdir dir="${processing}/${libraryName}" />
+  		<copy todir="${processing}/${libraryName}">
+  			<fileset dir="${dist}"/>
+  		</copy> 
+
+  	<!-- zip the distribution of the library -->
+  	<zip destfile="${dist}/${libraryName}.zip"
+  	       basedir="${dist}"
+  	       excludes="**/_DS.Store"
+	/>
+  	
+  	<!-- <rename src="${dist}/${libraryName}.zip" dest="${dist}/${libraryName}_${versionNumber}.zip" /> -->
+ 	
+  	<!-- organize the ${dist} folder -->
+  	<mkdir dir="${dist}/web" />
+  	<move todir="${dist}/web/reference">
+  		<fileset dir="${dist}/reference" />
+  	</move>
+  	
+  	<move todir="${dist}/web/examples">
+  		<fileset dir="${dist}/examples" />
+  	</move>
+  	
+  	<delete dir="${dist}/library" />
+  	
+  	<copy todir="${dist}/web">
+  		<fileset dir="web" />
+  	</copy>
+  	
+  	<!--
+  	format the index.html file. 
+  	regular expressions are used to parse the web index.html file. 
+  	key words starting and ending with ## are replaced by values 
+  	defined earlier in the beginning of this build file.
+  	-->
+  	
+  	<replaceregexp file="${dist}/web/index.html"
+  	                         match="##yourLibrary##"
+  	                         replace="${libraryName}"
+  	                         flags="g" />
+  	
+  	<replaceregexp file="${dist}/web/index.html"
+							match="##author##"
+							replace="${author}"
+							flags="g" />
+  	
+  	<replaceregexp file="${dist}/web/index.html"
+							match="##versionNumber##"
+							replace="${versionNumber}"
+							flags="g" />
+  	
+	<replaceregexp file="${dist}/web/index.html"
+							match="##yourLink##"
+  							replace="${yourLink}"
+							flags="g" />
+  	
+  	<replaceregexp file="${dist}/web/index.html"
+  							match="##date##"
+  	  						replace="${date}"
+  	  						flags="g" />
+  	  						
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##keywords##"
+  	  						replace="${keywords}"
+  	  						flags="g" />
+  	  						
+  	  						
+  	  						
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##tested:platform##"
+  	  						replace="${tested:platform}"
+  	  						flags="g" />
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##tested:processingVersion##"
+  	  						replace="${tested:processingVersion}"
+  	  						flags="g" />
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##tested:dependencies##"
+  	  						replace="${tested:dependencies}"
+  	  						flags="g" />
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##source:host##"
+  	  						replace="${source:host}"
+  	  						flags="g" />
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##source:url##"
+  	  						replace="${source:url}"
+  	  						flags="g" />
+  	 <replaceregexp file="${dist}/web/index.html"
+  							match="##source:repository##"
+  	  						replace="${source:repository}"
+  	  						flags="g" />
+
+  	
+  	<echo>---------------------</echo>
+  	<antcall target="processExamples" />
+  	<echo>---------------------</echo>
+  	
+  	<replaceregexp file="${dist}/web/index.html"
+  	  							match="##examples##"
+  	  	  						replace=""
+  	  	  						flags="g" />
+  	  	  						
+  	  	  						
+  	<!-- finish organizating library's distribution -->
+  	<mkdir dir="${dist}/web/download" />
+  	<copy file="${dist}/${libraryName}.zip" todir="${dist}/web/download" />
+  	
+  	<copy todir="${processing}/${libraryName}/reference">
+		<fileset dir="${reference}" />
+	</copy>
+  	
+  	<!-- done, finished. -->
+  	<echo>done, finished.</echo>
+ </target>
+ 
+ 
+ 	
+	<!-- parsing the examples folder -->
+	<target name="processExamples">
+		<dirset id="examples.contents" dir="examples" excludes="*/*"/>
+		<property name="examples.list" refid="examples.contents"/>
+		<foreach list="${examples.list}" target="addExamples" param="exampleDir" delimiter=";">
+		</foreach>
+	</target>
+		
+	<target name="addExamples">
+		<replaceregexp file="${dist}/web/index.html"
+	  					match="(##examples##)"
+	  	  				replace="&lt;li&gt;&lt;a href=&quot;examples/${exampleDir}/${exampleDir}.pde&quot;&gt;${exampleDir}&lt;/a&gt;&lt;/li&gt; \1"
+	  	  				flags="g" />
+		</target>
+</project>
+

Foetus/resources/code/ExampleTaglet.class

Binary file added.

Foetus/resources/code/ExampleTaglet.java

+/*
+ * Copyright 2002 Sun Microsystems, Inc. All  Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * -Redistributions of source code must retain the above copyright
+ *  notice, this list of conditions and the following disclaimer.
+ *
+ * -Redistribution in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in
+ *  the documentation and/or other materials provided with the
+ *  distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any
+ * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
+ * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
+ * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
+ * DAMAGES OR LIABILITIES  SUFFERED BY LICENSEE AS A RESULT OF OR
+ * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR
+ * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
+ * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
+ * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
+ * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
+ * THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that Software is not designed, licensed or
+ * intended for use in the design, construction, operation or
+ * maintenance of any nuclear facility.
+ */
+
+import com.sun.tools.doclets.Taglet;
+import com.sun.javadoc.*;
+import java.util.Map;
+import java.io.*;
+/**
+ * A sample Taglet representing @example. This tag can be used in any kind of
+ * {@link com.sun.javadoc.Doc}.  It is not an inline tag. The text is displayed
+ * in yellow to remind the developer to perform a task.  For
+ * example, "@example Hello" would be shown as:
+ * <DL>
+ * <DT>
+ * <B>To Do:</B>
+ * <DD><table cellpadding=2 cellspacing=0><tr><td bgcolor="yellow">Fix this!
+ * </td></tr></table></DD>
+ * </DL>
+ *
+ * @author Jamie Ho
+ * @since 1.4
+ */
+
+public class ExampleTaglet implements Taglet {
+    
+    private static final String NAME = "example";
+    private static final String HEADER = "example To Do:";
+
+    /**
+     * Return the name of this custom tag.
+     */
+    public String getName() {
+        return NAME;
+    }
+    
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in field documentation.
+     * @return true since <code>@example</code>
+     * can be used in field documentation and false
+     * otherwise.
+     */
+    public boolean inField() {
+        return true;
+    }
+
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in constructor documentation.
+     * @return true since <code>@example</code>
+     * can be used in constructor documentation and false
+     * otherwise.
+     */
+    public boolean inConstructor() {
+        return true;
+    }
+    
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in method documentation.
+     * @return true since <code>@example</code>
+     * can be used in method documentation and false
+     * otherwise.
+     */
+    public boolean inMethod() {
+        return true;
+    }
+    
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in method documentation.
+     * @return true since <code>@example</code>
+     * can be used in overview documentation and false
+     * otherwise.
+     */
+    public boolean inOverview() {
+        return true;
+    }
+
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in package documentation.
+     * @return true since <code>@example</code>
+     * can be used in package documentation and false
+     * otherwise.
+     */
+    public boolean inPackage() {
+        return true;
+    }
+
+    /**
+     * Will return true since <code>@example</code>
+     * can be used in type documentation (classes or interfaces).
+     * @return true since <code>@example</code>
+     * can be used in type documentation and false
+     * otherwise.
+     */
+    public boolean inType() {
+        return true;
+    }
+    
+    /**
+     * Will return false since <code>@example</code>
+     * is not an inline tag.
+     * @return false since <code>@example</code>
+     * is not an inline tag.
+     */
+    
+    public boolean isInlineTag() {
+        return false;
+    }
+    
+    /**
+     * Register this Taglet.
+     * @param tagletMap  the map to register this tag to.
+     */
+    public static void register(Map tagletMap) {
+       ExampleTaglet tag = new ExampleTaglet();
+       Taglet t = (Taglet) tagletMap.get(tag.getName());
+       if (t != null) {
+           tagletMap.remove(tag.getName());
+       }
+       tagletMap.put(tag.getName(), tag);
+    }
+
+    /**
+     * Given the <code>Tag</code> representation of this custom
+     * tag, return its string representation.
+     * @param tag   the <code>Tag</code> representation of this custom tag.
+     */
+    public String toString(Tag tag) {
+        return createHTML(readFile(tag.text()));
+    }
+     
+    
+    /**
+     * Given an array of <code>Tag</code>s representing this custom
+     * tag, return its string representation.
+     * @param tags  the array of <code>Tag</code>s representing of this custom tag.
+     */
+    public String toString(Tag[] tags) {
+        if (tags.length == 0) {
+            return null;
+        }
+		return createHTML(readFile(tags[0].text()));
+    }
+    
+    
+    
+    String createHTML(String theString) {
+    	if(theString!=null) {
+        String dd = "<script type=\"text/javascript\">\n" +
+        			"<!--\n"+ 
+        			"document.getElementsByTagName('html')[0].className = 'isjs';" +
+					"function toggle(dt) { var display, dd=dt; do{ dd = dd.nextSibling } while(dd.tagName!='DD'); toOpen =!dd.style.display;" +
+  					"dd.style.display = toOpen? 'block':''; dt.getElementsByTagName('span')[0].innerHTML  = toOpen? '-':'+' ; }\n" +
+  					"-->\n</script>";
+
+		return dd+"\n<div id=\"test\" class=\"toggleList\">" +
+		"<dl><dt onclick=\"toggle(this);\"><span>+</span>Example</dt>" +
+		"<dd><pre>"+theString+"</pre>" +
+		"</dd></dl></div>";
+		} 
+    	return "";
+    }
+    
+    
+    /**
+     * check if the examples directory exists and return the example as given in the tag.
+     * @param theExample the name of the example
+     */
+     String readFile(String theExample) { 
+		String record = "";
+		String myResult = "";
+		int recCount = 0;
+		String myDir = "../examples";
+		File file=new File(myDir);
+		if(file.exists()==false) {
+			myDir = "./examples";
+		}
+        try { 
+			FileReader fr = new FileReader(myDir+"/"+theExample+"/"+theExample+".pde");
+			BufferedReader br = new BufferedReader(fr);
+			record = new String();
+			while ((record = br.readLine()) != null) {
+				myResult += record+"\n";
+			} 
+		} catch (IOException e) { 
+			System.out.println(e);
+			return null;
+		}
+		return myResult;
+     }
+}
+
+

Foetus/resources/code/ant-contrib-1.0b3.jar

Binary file added.

Foetus/resources/code/doc.sh

+# a shell script to create a java documentation 
+# for a processing library. 
+# 
+# make changes to the variables below so they 
+# fit the structure of your library
+
+# the package name of your library
+package=template;
+
+# source folder location
+src=../src;
+
+# the destination folder of your documentation
+dest=../documentation;
+
+
+# compile the java documentation
+javadoc -d $dest -stylesheetfile ./stylesheet.css -sourcepath ${src} ${package}

Foetus/resources/stylesheet.css

+/* Javadoc style sheet */
+/* Define colors, fonts and other style attributes here to override the defaults */
+/* processingLibs style by andreas schlegel, sojamo */
+
+
+body {
+	margin : 0;
+	padding : 0;
+	padding-left : 10px;
+	padding-right : 8px;
+	background-color : #FFFFFF;
+	font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; 
+	font-size : 100%; 
+    font-size : 0.7em;
+	font-weight : normal;
+	line-height	: normal;
+	margin-bottom:30px;
+}
+
+
+
+
+/* Headings */
+h1, h2, h3, h4, h5, th {
+	font-family :Arial, Helvetica, sans-serif; 	
+	font-size:1.2em;
+}
+
+
+p { 
+	font-size : 1em; 		
+	width:80%;
+}
+
+pre, code {  
+	font-family : "Courier New", Courier, monospace; 
+	font-size : 12px; 
+	line-height : normal;
+}
+
+
+
+table {
+	border:0;
+	margin-bottom:10px;
+	margin-top:10px;
+}
+
+
+tr, td {
+	border-top: 0px solid;
+	border-left: 0px solid;
+	padding-top:8px;
+	padding-bottom:8px;
+}
+
+
+
+hr {
+	border:0;
+	height:1px;
+	padding:0;
+	margin:0;
+	margin-bottom:4px;
+
+}
+
+
+
+dd, th, td, font {
+	font-size:1.0em;
+	line-height:1.0em;
+}
+
+
+
+dt {
+	margin-bottom:0px;
+}
+
+
+
+dd {
+	margin-top:2px;
+	margin-bottom:4px;
+}
+
+
+
+a {
+	text-decoration: underline;
+	font-weight: normal;
+}
+
+a:hover, 
+a:active {
+	text-decoration: underline;
+	font-weight: normal;
+}
+
+a:visited,
+a:link:visited {
+	text-decoration: underline;
+	font-weight: normal;
+}
+
+
+img {
+	border: 0px solid #000000;
+}
+
+
+
+/* Navigation bar fonts */
+.NavBarCell1    { 
+	border:0;
+}
+
+.NavBarCell1Rev {
+	border:0;
+}
+
+.NavBarFont1 { 
+	font-family: Arial, Helvetica, sans-serif;  
+	font-size:1.1em;
+}
+
+
+.NavBarFont1 b {
+	font-weight:normal;
+}
+
+
+
+.NavBarFont1:after, .NavBarFont1Rev:after {
+	font-weight:normal;
+	content: " \\";
+}
+
+
+.NavBarFont1Rev { 
+	font-family: Arial, Helvetica, sans-serif;
+	font-size:1.1em;
+}
+
+.NavBarFont1Rev b { 
+	font-family: Arial, Helvetica, sans-serif;
+	font-size:1.1em;
+	font-weight:normal;
+}
+
+.NavBarCell2    { 
+	font-family: Arial, Helvetica, sans-serif; 
+}
+
+.NavBarCell3    { 
+	font-family: Arial, Helvetica, sans-serif;
+}
+
+
+
+font.FrameItemFont {
+	font-family: Helvetica, Arial, sans-serif;
+	font-size:1.1em;
+	line-height:1.1em;
+}
+
+font.FrameHeadingFont {
+	font-family: Helvetica, Arial, sans-serif;
+	line-height:32px;
+}
+
+/* Font used in left-hand frame lists */
+.FrameTitleFont   { 
+	font-family: Helvetica, Arial, sans-serif 
+}
+
+
+.toggleList { 
+	padding:0;
+	margin:0;
+	margin-top:12px;
+}
+
+.toggleList dt {
+ 	font-weight:bold;
+ 	font-size:12px;
+ 	font-family:arial,sans-serif;
+	padding:0px;
+	margin:10px 0px 10px 0px;
+}
+
+.toggleList dt span { 
+	font-family: monospace;
+	padding:0;
+	margin:0;
+}
+
+ 
+.toggleList dd {
+	margin:0;
+	padding:0; 
+}
+
+html.isjs .toggleList dd { 
+  display: none; 
+}
+
+.toggleList pre {
+	padding: 4px 4px 4px 4px;
+}
+
+
+
+
+
+/* COLORS */
+
+pre, code {  
+	color: #000000;
+}
+
+
+body {
+	color : #333333;
+	background-color :#FFFFFF;
+}
+
+
+h1, h2, h3, h4, h5, h6 {
+	color:#555;
+}
+
+a, 
+.toggleList dt {
+	color: #1a7eb0;
+}
+
+a:hover, 
+a:active {
+	color: #1a7eb0;
+}
+
+a:visited,
+a:link:visited {
+	color: #1a7eb0;
+}
+
+td,tr {
+	border-color: #999999;
+}
+
+hr {
+	color:#999999;
+	background:#999999;
+}
+
+
+.TableHeadingColor     { 
+	background: #dcdcdc;
+	color: #555;
+}
+
+
+.TableSubHeadingColor {
+	background: #EEEEFF 
+}
+
+.TableRowColor {
+	background: #FFFFFF 
+}
+
+
+.NavBarCell1    { 
+	background-color:#dcdcdc; 
+	color:#000; 
+}
+
+.NavBarCell1 a { 
+	color:#333;
+}
+
+
+.NavBarCell1Rev {
+	background-color:transparent;
+}
+
+.NavBarFont1    { 
+	color:#333; 
+}
+
+
+.NavBarFont1Rev { 
+	color:#fff; 
+}
+
+.NavBarCell2 { 
+	background-color:#999; 
+}
+
+.NavBarCell2 a { 
+	color:#fff; 
+}
+
+
+
+.NavBarCell3    { 
+	background-color:#dcdcdc;
+}
+

Foetus/src/foetus/Foetus.java

+/*
+Copyright 2008 Ilias Bergstrom.
+  
+This file is part of "Mother".
+
+Mother is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Foobar is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Mother.  If not, see <http://www.gnu.org/licenses/>.
+ 
+onar3d@hotmail.com, www.onar3d.com
+ 
+*/
+
+package foetus;
+
+import processing.core.*;
+
+import java.util.*;
+
+public class Foetus
+{
+	PApplet parent;
+	
+	int[] m_BGColor;
+	
+	Hashtable<String, String> m_Messages;
+	
+	Hashtable<String, Boolean> m_Updating;
+	
+	/**
+	 * For use by Mother, do not alter!
+	 */
+	public boolean standalone = true;
+
+	float m_SpeedFraction = 1;
+	
+	public final String VERSION = "0.4.0";
+	
+	ArrayList<FoetusParameter> m_Parameters;
+	
+	public ArrayList<FoetusParameter> getParameters() { return m_Parameters; }
+	
+	/**
+	 * Constructor
+	 * @param parent
+	 */
+	public Foetus(PApplet parent)
+	{
+		this.parent = parent;
+	
+		m_Parameters = new ArrayList<FoetusParameter>();
+		
+		m_Messages = new Hashtable<String,String>();
+		
+		m_Updating = new Hashtable<String,Boolean>();
+				
+		parent.registerDispose(this);
+		parent.registerPre(this);
+		parent.registerPost(this);
+		
+		m_BGColor = new int[] {128, 128, 128};
+	}
+	
+	/**
+	 * return the version of the library.
+	 * 
+	 * @return String
+	 */
+	public String version() 
+	{
+		return VERSION;
+	}
+
+	/**
+	 * For use by Mother, do not alter!
+	 * @param inSF
+	 */
+	public void setSpeedFraction(float inSF) 
+	{
+		m_SpeedFraction = inSF; 
+	}
+	
+	/**
+	 * For use by Mother!
+	 * @param inSF
+	 */
+	public float getSpeedFraction() 
+	{
+		return m_SpeedFraction; 
+	}
+	
+	/**
+	 * millis() is the same as the Processing millis() function, 
+	 * with the additional feature that it takes the specified speed fraction into account. 
+	 * This is useful when running in non real-time mode, 
+	 * as the f.millis() call returns the time value at a given frame number 
+	 * that it would have if it were running in real-time. 
+	 * @return int
+	 */
+	public int millis() 
+	{
+		double pm = parent.millis();
+	    return (int)(pm/m_SpeedFraction);
+	}
+	
+	/**
+	 * Use this to set the background color of the sketch when it is running in standalone mode,
+	 * i.e. when it is not hosted by Mother.
+	 * @param r
+	 * @param g
+	 * @param b
+	 */
+	public void setBGColor(int r, int g, int b)
+	{
+		m_BGColor[0] = r;
+		m_BGColor[1] = g;
+		m_BGColor[2] = b;
+	}
+	
+	public void dispose()
+	{
+
+	}
+	
+	/**
+	 * Use this method to register your sketches methods with Mother. This means they will 
+	 * then be listed when the sketch is asked for a list of its capabilities.
+	 * @param OSC address
+	 * @param OSC typetag
+	 */
+	public void registerMethod(String address, String typetag)
+	{
+		m_Messages.put(address, typetag);
+		m_Updating.put(address, false);
+	}
+
+	/**
+	 * For use by Mother!
+	 * @return
+	 */
+	public void unregisterMethod(String address)
+	{
+		m_Messages.remove(address);
+		m_Updating.remove(address);
+	}
+	
+	/**
+	 * For use by Mother!
+	 * @return
+	 */
+	public Hashtable<String,String> getSupportedMessages()
+	{
+		return m_Messages;
+	}
+	
+	/**
+	 * For use by Mother, do not alter!
+	 * @return
+	 */
+	public void setUpdatingStatus(String address, boolean status)
+	{
+		synchronized(m_Updating)
+		{
+			m_Updating.put(address, status);
+		}
+	}
+	
+	/**
+	 * For use by Mother!
+	 * @return
+	 */
+	public boolean getUpdatingStatus()
+	{
+		synchronized(m_Updating)
+		{
+			if(m_Updating.containsValue(true))
+			{
+				return true;
+			}
+			else
+			{
+				return false;
+			}
+		}
+	}
+	
+	/**
+	 * For use by Mother!
+	 * @return
+	 */
+	public void pre()
+	{
+		if (standalone)
+			parent.background(m_BGColor[0],m_BGColor[1],m_BGColor[2]);
+		
+		//System.out.println("Pre: " + parent.toString());
+	}
+	
+	/**
+	 * For use by Mother!
+	 * @return
+	 */
+	public void post()
+	{
+		
+		//System.out.println("Post: " + parent.toString());
+	}
+	
+	
+	public void addParameter(FoetusParameter f)
+	{
+		m_Parameters.add(f);	
+	}
+}

Foetus/src/foetus/FoetusParameter.java

+package foetus;
+
+
+import megamu.shapetween.Shaper;
+import megamu.shapetween.Tween;
+
+import processing.core.PApplet;
+
+public class FoetusParameter
+{
+	float m_Value;
+	float m_LastValue;
+	float m_NewValue;
+	float m_Factor;
+	
+	String m_Address;
+	
+	boolean m_Splerp = true;
+
+	Foetus r_f; 
+			
+	Tween ani;
+	
+	/**
+	 * Allows spline interpolation for individual floating point synth parameters.
+	 * @param f
+	 * @param value
+	 * @param address
+	 * @param typetag
+	 */
+	public FoetusParameter(Foetus f, float value, String address, String typetag )
+	{
+		r_f 					= f;		
+		m_Value 				= value;
+		m_NewValue				= value;
+		m_LastValue				= value;
+
+		m_Address = address;
+		
+		if(r_f!=null)
+			r_f.registerMethod(address, typetag);
+		
+		r_f.addParameter(this);
+
+		timeStarted = System.currentTimeMillis();
+		
+		ani = new Tween(null/*r_f.parent*/, r_f.getSpeedFraction(), Tween.SECONDS, Shaper.COSINE);
+	}
+
+	
+/*	public void setFactor(Float factor)
+	{
+		m_Factor = factor;
+		
+		if(m_Factor>=1.0f)
+		{
+			r_f.setUpdatingStatus(m_Address, false);
+		}
+		else
+		{
+			r_f.setUpdatingStatus(m_Address, true);	
+		}
+	}*/
+	
+	
+	/**
+	 * Returns the interpolated value held by the parameter at the current time.
+	 * @return
+	 */
+	public float getValue()
+	{
+		if(m_Splerp)
+		{
+			m_Value = PApplet.lerp(m_LastValue, m_NewValue, ani.position());
+			//System.out.println(m_Value + ", " + ani.position());
+		}
+		
+		if(ani.position()>=1.0f)
+		{
+			r_f.setUpdatingStatus(m_Address, false);
+		}
+		else
+		{
+			r_f.setUpdatingStatus(m_Address, true);	
+		}
+		
+		//System.out.println("Last: " + m_LastValue + " New: " + m_NewValue + " Factor: " + m_Factor);
+		//System.out.println(m_Value + ", " + PApplet.lerp(m_LastValue, m_NewValue, ani.position()));
+		
+		return m_Value;
+	}
+	
+	long timeStarted;
+	
+	/**
+	 * Set a new value for the parameter. This will trigger an interpolation with the 
+	 * new value as target.
+	 * @param val
+	 */
+	public void setValue(float val)
+	{
+		long elapsed;
+		long elapsedTime = System.currentTimeMillis() - timeStarted;
+		
+	    m_LastValue = m_Value;
+	    m_NewValue  = val;
+		    
+	    elapsed = (long)(elapsedTime/r_f.getSpeedFraction());
+	  
+	//    System.out.println(elapsed/1000f);
+	    
+	    ani.end();
+	    
+	    if(elapsed<(500/r_f.getSpeedFraction()))
+	    {
+	    	m_Splerp 	= false;
+	    	m_LastValue = val;
+	    	m_Value 	= val;
+	    	r_f.setUpdatingStatus(m_Address, false);
+	    }
+	    else
+	    {
+	    	m_Splerp = true;
+	    	
+	    	if(elapsed>(3000/r_f.getSpeedFraction()))
+	    		elapsed = (long)(3000/r_f.getSpeedFraction());
+	  	    	
+	    	ani.setDuration(elapsed/1000f * r_f.parent.frameRate*r_f.getSpeedFraction(), Tween.FRAMES);
+	    //	ani.setDuration(elapsed/1000f , Tween.SECONDS);
+	    	
+	    	ani.start();
+	    	
+	    	timeStarted = System.currentTimeMillis();
+	    }
+	}
+	
+	public void tick()
+	{
+		if(ani.isTweening())
+		{
+			ani.tick();
+		}
+ 		//System.out.println("tick " + ani.position());
+	}
+}

Foetus/web/examples/Gradient/Gradient.pde

+import oscP5.*;
+import netP5.*;
+import processing.opengl.*;
+
+import foetus.*;
+import processing.core.*;
+import processing.core.PApplet.RegisteredMethods;
+
+import java.util.*;
+import javax.media.opengl.*;
+import javax.media.opengl.glu.*;
+
+// Messages:
+// "/Gradient/TopColor" iii
+// "/Gradient/BottomColor" iii
+
+public Foetus f;
+
+FoetusParameter m_TopR;
+FoetusParameter m_TopG;
+FoetusParameter m_TopB;
+FoetusParameter m_BotR;
+FoetusParameter m_BotG;
+FoetusParameter m_BotB;
+	
+void setup()
+{
+  // When run as a synth, setup() is never called!
+  // put the necessary initialization code in a method named initializeFoetus().
+  // The necessary Processing initialization calls are called by Mother, and so should be left out from
+  // initializeFoetus().
+  // Finally, for the synth to work as a processing sketch within the PDE, call initializeFoetus() from within
+  // setup().
+
+  size(400, 300, OPENGL);
+  frameRate(24);
+
+  initializeFoetus();
+}
+
+void initializeFoetus()
+{
+  noStroke();
+
+  // Instantiate foetus object here
+  f = new Foetus(this);
+
+  // Register messages that synth responds to (see OSC documentation)
+  // This is here done automatically by the FoetusParameter constructors.
+  m_TopR = new FoetusParameter(f, 1.0, "/TopRed", 	"f");
+  m_TopG = new FoetusParameter(f, 0, "/TopGreen", 	"f");
+  m_TopB = new FoetusParameter(f, 0, "/TopBlue",        "f");
+  m_BotR = new FoetusParameter(f, 0, "/BotRed", 	"f");
+  m_BotG = new FoetusParameter(f, 0, "/BotGreen", 	"f");
+  m_BotB = new FoetusParameter(f, 0, "/BotBlue", 	"f");
+}
+
+// Uncomment this before exporting Gradient.jar for use with Mother!
+
+void init()
+{
+  sizeMethods 		= new RegisteredMethods();
+  preMethods 		= new RegisteredMethods();
+  drawMethods 		= new RegisteredMethods();
+  postMethods 		= new RegisteredMethods();
+  mouseEventMethods 	= new RegisteredMethods();
+  keyEventMethods 	= new RegisteredMethods();
+  disposeMethods 	= new RegisteredMethods();
+}
+
+
+void draw()
+{
+  pushMatrix();
+		
+  beginShape(QUADS);
+			
+  fill(m_TopR.getValue()*255, m_TopG.getValue()*255, m_TopB.getValue()*255);
+  vertex(0, 0);
+  vertex(width - 1, 0);
+		
+  fill(m_BotR.getValue()*255, m_BotG.getValue()*255, m_BotB.getValue()*255);
+  vertex(width - 1, height - 1);
+  vertex(0, height - 1);
+
+  endShape();
+			
+  popMatrix();
+}
+
+/**
+ * This method is called when an OSC message is received by the synth.
+ */
+void oscEvent(OscMessage theOscMessage)
+{
+  if (theOscMessage.checkAddrPattern("/TopRed") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopR.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/TopGreen") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopG.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/TopBlue") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_TopB.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  } 
+  else if (theOscMessage.checkAddrPattern("/BotRed") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_BotR.setValue(theOscMessage.get(0).floatValue());
+      return;
+    }
+  }
+  else if (theOscMessage.checkAddrPattern("/BotGreen") == true)
+  {
+    /* check if the typetag is the right one. */
+    if (theOscMessage.checkTypetag("f"))
+    {
+      m_BotG.setValue(theOscMessage.get(0).floatValue());
+      return;