Category: Assignment-04-Chaos

Chaos v.s order

So oddly enough, when I was young i used to have this super vivid dream whenever I had a fever and somehow my Dad gets the same dream. Weird, right? The only way i can describe it is an atmosphere an environment that is super smooth and calm, black and white, and then suddenly chaotic and choppy and scary. I tried to make it here.

 
  void setup() {
    size(600, 200);
  }
  void draw () {
    background(255);
  
    float randomness = map(mouseX, 0, width, 0, 1);
    randomness = constrain(randomness, 0, 1); 
  
    // float rX= random(width/2, width);
    // float rWidth= random(width/2, width);
  
    for (int i=1; 1<30; i++) {
      float rX= (i*20) + randomness * random (-15, 15);
      float rWidth= (i*20) + randomness *random (-15, 15);
  
      //if (mouseX>300) {
      line(rX, 0, rWidth, height);
    }
  }

A Diet of Bones

Screen Shot 2014-09-22 at 17.49.58

This is an experiment in generated grammar and poetics. the display is a blank black screen, and clicking generates a phrase that will slowly rise on the page.  The type of phrase is based off of this, and are delineated into 3 types:

Left: A grammatically correct english phrase

Middle: a semi-random phrase in disyllabic trimeter (each line has 6 syllables).

Right: a randomised set of words that are in iambic pentameter (each line consists of 4 sets of iambs, which consist of one weak-stress syllable, and one strong-stress syllable).

Screen Shot 2014-09-22 at 19.14.30

//class containgng pertinent information abot a word
class Word {
  String sing;
  String plur;
  int syllables;
  int[] metre;
 
  Word(String tempSing, String tempPlur, 
       int tempSyl, int[] tempMet) {
    sing = tempSing;
    plur = tempPlur;
    syllables = tempSyl;
    metre = tempMet;
  }
}
 
// word tupole class - needed for a function return
class WordTuple {
  Word x;
  Word y;
  WordTuple(Word tempX, Word tempY) {
    x = tempX;
    y = tempY;
  }
}
 
// class that contains the phrases (built from Words) that appear
// on the display
class Phrase {
  String contents;
  int x;
  int y;
  Phrase(String tempConts, int tempX, int tempY){
    contents = tempConts;
    x = tempX;
    y = tempY;
  }
  //phrases rise after generation
  void update(){
    y = y-1;
  }
  void display(){
    fill(250,250,250);
    textAlign(CENTER);
    text(contents,x,y);
  }
  Boolean finished(){
    return y < -50;
  }
}
 
//word declaration - I have to hard-code the words right now,
//but processing automitically seems possible, if difficult
Word confessional;
Word studio;
Word Lebanon;
Word diet;
Word timber;
Word along;
Word bee;
Word bone;
Word of;
Word forWord;
Word a;
Word redouble;
 
 
Word[] nouns;
Word[] allWords;
 
//rythm patterns for iambic tetrameter and trimeter - 0 is a soft
//stress, 1 a hard stress. tetram is the only one currently in use
//since makeTrimet only follows the syllable restriuction
//Note: this is oversimplified - actually 4 levels of stress in
//english.
int[] tetramPattern = {0,1,0,1,0,1,0,1};
int[] trimetPattern = {0,1,0,1,0,1};
 
ArrayList<Phrase> phrases;
 
//makes a gramatically correct english phrase of one of a set of 
//structures and randomly selected nouns
String makePhrase(){
  float chooser = random(0,360);
  int word1 = floor(random(nouns.length));
  int word2 = floor(random(nouns.length));
  String result; 
  if (chooser < 120) {
    // a noun for noun
    result = "a " + nouns[word1].sing + " for " 
              + nouns[word2].plur;
  } else if (chooser < 240) {
    // the noun noun
    result = "the " + nouns[word1].sing + " " + nouns[word2].sing;
  } else {
    // noun for noun
    if (chooser < 300) {
      result = nouns[word1].sing + " for " + nouns[word2].plur;
    } else {
      result = nouns[word1].plur + " for " + nouns[word2].plur;
    }
  }
  return result;
}
 
//adds a word's metre to the main pattern
int[] addWord( int[] pattern, Word newWord, int patternLen){
  /*println("adding" + newWord.sing + 
            "from " + patternLen + "to:");
  printArray(pattern);*/
  for(int i = 0; i < newWord.syllables; i++) {
    pattern[patternLen + i] = newWord.metre[i]; 
  }
  /*println("result:");
  printArray(pattern);*/
  return pattern;
}
 
//test wether a metre pattern follows the main pattern up to 
//the given size
Boolean followsMetre(int[] pattern, int[] testPattern, int size){
  for(int i = 0; i < size; i++){
    if (pattern[i] != testPattern[i]) {
      return false;
    }
  } 
  return true;
}
 
 
//maked a nonsense iambic tetrameter
String makeTetram(){
  int[] testPattern = new int[tetramPattern.length];
  int[] resultPattern = new int[tetramPattern.length];
  int currentLen = 0;
  int tryI = 0;
  int counter = 0;
  String result = ""; 
  Word tryWord;
 
  while (currentLen < tetramPattern.length) {
    tryI = floor(random(allWords.length));
    tryWord = allWords[(tryI + counter) % allWords.length];
    if ((currentLen + tryWord.syllables) <= tetramPattern.length){
      testPattern = addWord(resultPattern, tryWord, currentLen);
      if (followsMetre(tetramPattern, testPattern,
          currentLen + tryWord.syllables)) {
        resultPattern = testPattern;
        currentLen += tryWord.syllables;
        result = result + tryWord.sing + " ";
        counter = 0;
      } else { 
        testPattern = resultPattern;
      }
    }
    counter += 1;
    if (counter >= allWords.length) {
      /*println(currentLen);
      printArray(resultPattern);*/
      return result + "pain "; //code failure
    }
  }
  return result;
}
 
//chooses 2 words with total syllable cound of sylSum
WordTuple getWords(int sylSum){
  Word word1 = allWords[floor(random(allWords.length))];
  int[] nul = {};
  Word word2 = new Word("","",0,nul);
  int goalSyl = sylSum - word1.syllables;
  if(goalSyl == 0){
    return new WordTuple(word1, word2);
  }
  int tryI = floor(random(allWords.length));
 
  for(int i=0; i < allWords.length; i++){
    word2 = allWords[(tryI + i) % allWords.length];
    if(word2.syllables == goalSyl){
      return new WordTuple(word1, word2);
    }
  }
  return new WordTuple(word1, word2);
}
 
// makes a disyllabic trimeter loosely based off of the 
// phrase patterns
String makeTrimet(){
  float chooser = random(0,360);
  WordTuple choices;
  String result; 
  if (chooser < 120) {
    choices = getWords(4);
    result = "a " + choices.x.sing + " for " 
              + choices.y.plur;
  } else if (chooser < 240) {
    choices = getWords(5);
    result = "the " + choices.x.sing + " " + choices.y.sing;
  } else {
    choices = getWords(5);
    if (chooser < 300) {
      result = choices.x.sing + " for " + choices.y.plur;
    } else {
      result = choices.x.plur + " for " + choices.y.plur;
    }
  }
  return result;
}
 
void setup() {
  //sets up words - hard coding
  int[] feed4 = {0,1,0,1};
  confessional = new Word("confessional", 
                          "confessionals", 4, feed4);
 
  int[] feed3 = {1,0,1};
  studio = new Word("studio", "studios", 3, feed3); 
  Lebanon = new Word("Lebanon", "Lebanon", 3, feed3);
  int[] feed3a = {0,1,0};
  redouble = new Word("redouble", "redoubles", 3, feed3a);
 
  int[] feed2 = {1,0};
  diet = new Word("diet", "diets", 2, feed2); 
  timber = new Word("timber", "timber", 2, feed2); 
  int[] feed2a = {0,1};
  along = new Word("along", "along", 2, feed2a); 
 
  int[] feed1 = {1};  
  bee = new Word("bee", "bees", 1, feed1); 
  bone = new Word("bone", "bones", 1, feed1); 
  int[] feed1a = {0};
  of = new Word("of", "ofs", 1, feed1a); 
  forWord = new Word("for", "fors", 1, feed1a); 
  a = new Word("a", "a", 1, feed1a); 
 
  nouns = new Word[7];
  nouns[0] = studio;
  nouns[1] = bee;
  nouns[2] = Lebanon;
  nouns[3] = diet;
  nouns[4] = bone;
  nouns[5] = timber;
  nouns[6] = confessional;
  //nouns = {studio, bee, Lebanon, diet, bone, timber};
  allWords = new Word[12];
  allWords[0] = bee;
  allWords[1] = redouble;
  allWords[2] = Lebanon;
  allWords[3] = of;
  allWords[4] = diet;
  allWords[5] = confessional;
  allWords[6] = bone;
  allWords[7] = forWord;
  allWords[8] = studio;
  allWords[9] = timber;
  allWords[10] = along;
  allWords[11] = a;
 
  phrases = new ArrayList<Phrase>();
 
  size(800,500);
  frameRate(24);
 
  /*println(makePhrase());
  println("");
  println(makeTetram());
  println("");
  println(makeTrimet());*/
}
 
void draw() {
  background(0);
  Phrase phrase;
  for (int i = phrases.size()-1; i >= 0; i--) {
    phrase = phrases.get(i);
    phrase.update();
    phrase.display();
    if (phrase.finished()) {
      phrases.remove(i);
    }
  }
}
 
//what kind of phrase is selected based off of the mouse position
//when clicked3
void mousePressed() {
  println("mouse press:" + mouseX + "in" + width);
  if(mouseX < (width/3)){
    phrases.add(new Phrase(makePhrase(),mouseX, mouseY));
    println("phrase added");
  } else if(mouseX < 2*(width/3)){
    phrases.add(new Phrase(makeTrimet(),mouseX, mouseY));
    println("trimet added");
  } else {
    phrases.add(new Phrase(makeTetram(),mouseX, mouseY));
    println("tetram added");
  }
}

 

Control/Chaos x SelfPortrait

Screen Shot 2014-09-12 at 4.11.01 PM Screen Shot 2014-09-12 at 4.02.25 PMSPF1SPF2

For the selfPortrait assignment, I had a lot of trouble figuring out how to insert images. That being said, I decided to continue working on it for the order chaos assignment. The mouseX position is used to control randomly changing bars that cover my image. As you move the mouse to the right side of the window, the bars move away from the face. Moving back to the left covers the face in chaos via quickly changing colored ellipses/rectangles. The mouseY position makes it more likely for the bars and ellipses to be thinner as you approach the bottom of the window.

Unfortunately, the code for this assignment was reverted to my first 30 minutes of work when my computer died.

Assignment 4: Chaos/Order/Faces Experiments

My Chaos vs. Order and Face projects kind of merged together in terms of what ideas they explore, so I’ve combined them into one blog post here…

I decided to research chaos and faces through visual distortion and face detection algorithms. I was inspired greatly by this blog post about “machine pareidolia”.

For the Chaos/Order project, I took an image of a human face and slowly distorted it until it was not recognizable by a face detection algorithm. Each step of the program increments a chaos constant which controls the amount of distortion that is passed into a shader that uses a perlin noise texture to transform the texture coordinates of a quad textured with the face image. Here are the results:

The face was obviously detected at step 0, where chaos=0…

0

At step 30, the face begins to look slightly “off”, but is still recognized.

30

Step 57 is still considered a face…

57

The face stays a face until step 162.

162

It’s interesting to see that step 161, the previous step, is only so slightly different enough from step 162 that it is still a machine-readable face!

161

On a similar note, my Generative Face project was about finding more faces from distorted faces (meta pareidolia?). I started with a basic geometric machine-recognisable face and incremented a similar chaos variable. Here are the results (detected faces are highlighted by squares):

Chaos = 5

chaos5

Chaos = 10

chaos10

Chaos = 50

chaos50

The Enemies

the enemies virus
New Version

 

chaos and order

The Enemy
When given the theme of working with chaos and order, for some reason my mind immediately went back to viruses. I wanted to create a program where on the surface the objects appeared to be ordered and calm but when the user interacted with it became a chaotic frenzy. With that in mind I set out to create the ‘enemies’, viruses that would scramble as the user pressed the screen and moved the mouse from the top of it to the bottom. Honestly my biggest obstacle was creating the actual shape of the virus. I used the createShape() function but really had a difficult time picturing where I would plot the points that made my shape come together. It was a lot of guess work which I found troublesome, especially because for some reason, the tweak mode on processing wasn’t working for my computer. After that I created a loop that repeated the image of the virus over an increment of 100 on the y value, in order to space it out. Then I mapped the movement of the y value on the mouse so that as the user when down it became more chaotic. I used a constraint to make the top of the screen the most static. I also made it so that as long as the mouse wasn’t pressed the viruses won’t move. I did this by creating an if statement that was dependent on the Boolean move which functioned to make the viruses move only if the mouseisPressed function was true.

*EDITED: I created a gif of the project working and also resized the viruses so they are smaller and there are more of them. This change can be seen in the gif and in the code below.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//order mouseX= left chaos mouseX is right
float x=0;
float y=0;
float xmove;
float trying;
float trying2;
boolean moving= false;
 
void setup(){
  size(400,405); 
 
}
 
void draw(){
  smooth();
  background(255,15,72);
 
 
  xmove= map(0,mouseY,1,height,0);
  xmove= constrain( xmove,1,0);
 
  for( x=0; x< =width*20; x+=100){
    for( y=0; y<=height*20; y+=200){
 
 
        trying= x + xmove*random(-30,30);
        trying2= y+ xmove*random(-30,30);
 
 
if (mousePressed==true){//will run the code as long as the mouse is held down
 
           x=trying;
         y=trying2;
        }
 
  stroke(5);
 
  fill(132,199,44);
  //headvirus
 
 
beginShape();
//triangle 1 top
vertex((x)/3,(y+50)/3);//outsidebeginingline
vertex((x+50)/3,(y+15)/3);
vertex((x+100)/3,(y+50)/3);
vertex((x)/3,(y+50)/3);
 
//triangle2bottom
 
vertex((x+50)/3,(y+100)/3);
vertex((x+100)/3,(y+50)/3);
 
endShape();
line((x+50)/3,(y+15)/3,(x+50)/3,(y+100)/3);
 
fill(0,0,182);
//bottom virus;
beginShape();
vertex((x+25)/3,(y+100)/3);
vertex((x+75)/3,(y+100)/3);
vertex((x+75)/3,(y+200)/3);
vertex((x+25)/3,(y+200)/3);
vertex((x+25)/3,(y+100)/3);
endShape(); 
 
stroke(0,0,0);
line((x+25)/3,(y+200)/3,(x+15)/3,(y+215)/3);
line((x+45)/3,(y+200)/3,(x+35)/3,(y+215)/3);
line((x+55)/3,(y+200)/3,(x+65)/3,(y+215)/3);
line((x+75)/3,(y+200)/3,(x+85)/3,(y+215)/3);
    }//inloop
  }//ousideloop
 
 
}//end draw

 

Jingle Balls

Not really music to anyone’s ears…

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import ddf.minim.*;
import ddf.minim.ugens.*;
 
Minim       minim;
AudioOutput out;
Oscil       wave;
 
void setup(){
  size(1000,500); 
  minim = new Minim(this);
  out = minim.getLineOut();
  wave = new Oscil( 300, 0.5f, Waves.SINE );
  wave.patch( out );
}
 
void draw(){
  background(255);
  smooth(); 
 
 //golan's randomness
  float randomness = map(mouseX, 0,width, 0,1);
  randomness = constrain(randomness, 0,1);
 
  for (int i=1; i<width /50; i++){
    float rand1 = randomness * random(-15,15); 
    float rand2 = randomness * random(-15,15);
    float freq = 200+ randomness* random(0, 680);
    wave.setFrequency( freq );
    fill(0+randomness*255);
    ellipse (i*50,height/2+rand1,20+rand1,20+rand2);
  }
}

Financial Seismograph

Based on your control and data ripped from live stock trades the financial seismograph is meant to disorient and remind the user of the fragile nature of their financial system by allowing them to control the chaotic state of their world’s digital representation.

(The live data doesn’t work yet, but it will soon…)

Stock stockValue;
 
int prevSign = 0;
 
int centerScreenX;
int centerScreenY;
 
void setup() {
  size(1200,500);
  background(100);
  stockValue = new Stock();
  centerScreenX = displayWidth/2 - (width/2);
  centerScreenY = displayHeight/2 - (height/2);
  ellipseMode(CENTER);
 
}
 
 
void draw() {
  background(100);
  drawBackground();
  drawTicker();
  if (frameCount % 1 == 0) {
    makeStock();
  }
  makeLines();
  updateStock();
  frame.setLocation(centerScreenX,centerScreenY + stockValue.change);
  drawSeismo();
  //drawStock(); 
}
 
void drawBackground() {
    for (int x = 0; x < width; x += width/10) {
        stroke(127);
        line(x,0, x,height);
    }
    for (int y = 0; y < height; y += height/10) {
        line(0, y, width, y);
    }
}   
 
void mousePressed() {
  stockValue.y = height/2;
}
 
void drawSeismo() {
  line(width,height/2, stockValue.x,stockValue.y);
  fill(0);
  ellipse(width,height/2,height/20,height/20);
}
 
void drawTicker() {
  strokeWeight(2);
  stroke(color(map(stockValue.average, height/2, height, 0, 155)+100, 0,0));
  line(0,stockValue.average, int(width), stockValue.average);
}
 
void makeLines() { 
  for (int i = 0; i &lt; circleList.size(); i++) {
    if (i &gt; 0) { 
      Circle left = circleList.get(i-1);
      Circle right = circleList.get(i);
      Line currLine = new Line(left.x,left.y,right.x, right.y,right.fillColor);
      currLine.drawMe();
    }
  }
}
 
 
void makeStock() {
  circleList.add(new Circle(stockValue.x,stockValue.y));
}
 
void updateStock() {
  int total = 0;
  for (Circle circ: circleList) {
    circ.move(circ.velX, circ.velY);
    circ.formatPos();
    total += circ.y;
    circ.update();
  }
 
  for (int i =0; i &lt; circleList.size(); i++) {
    if (!(circleList.get(i).alive)) {
      circleList.remove(i);
    }
  }
  stockValue.update();
  stockValue.average = total /(circleList.size()+1);
}
 
void drawStock() {
  for (Circle circ: circleList) {
    circ.drawMe();
  }
}
 
 
class Stock {
  int change;
  int x;
  int y;
  float average;
  int prevSign;
  int prevVal;
  int valChange;
 
  Stock() {
    this.x = int(width * .9);
    this.y = int(height * .5);
    this.change = 0;
    this.valChange = this.y;
    this.prevSign = 1;
    this.prevVal = this.y;
  }
 
  void update() {
    this.change = this.checkChange();
    this.y += change;  
  }
 
  int checkChange() {
    float changeConstant = .2; //Value between 1 and 0, higher numbers = rapid changes
    float upperBound = height * changeConstant ;
    int ratio = int(map(mouseX, 0,width,0,upperBound));
 
    int sign;
    int check;
 
    float a1 = height * .1;
    float a2 = height * .2;
    float b2 = height * .8;
    float b1 = height * .9;
 
    if (stockValue.y &lt; 0) {
      check = 0;
    } else if (stockValue.y &lt; a1) {
      check = 1;
    } else if (stockValue.y &lt; a2) {
      check = 3;
    } else if (stockValue.y &gt; height) {
      check = 10;
    } else if (stockValue.y &gt; b2) { 
      check = 9;
    } else if (stockValue.y &gt; b1) {
      check = 7;
    } else {
      check = 5;
    }
 
    float randomNum = random(0,10);
    if (randomNum &lt; check) {
      sign = -1;
    } else {
      sign = 1;
    }
 
    if (sign != this.prevSign) {
      this.valChange = this.prevVal + int(map(this.y,0,height,height/2,0)) - height/2;
    }
 
    float smallestChange = random(ratio/5.0);
    int largestChange = ratio;
 
    return sign * (int(random(smallestChange,largestChange)));
  }
}
 
class Shape {
  int x;
  int y;
  int regX;
  int regY;
  color fillColor = color(0);
  int sWeight = 1;
  boolean alive = true;
  int diameter;
  int velX;
  int velY;
 
  Shape(int x, int y) {
    this.regX = x;
    this.regY = y;
    this.formatPos();
  }
 
  void move(int xVel,int yVel) {
    this.regX += xVel;
    this.regY += yVel;
  }
 
  void check() {
    if ((this.x + this.diameter) &lt; 0) {
      this.alive = false;
    }
  }
 
  void update() {
    this.check();
  }
 
  void formatPos() {
    this.y = this.regY + stockValue.change;
    this.x = this.regX;
  }
}
 
class Circle extends Shape {
  int size;
  int velY;
  int velX;
  int diameter;
 
  Circle(int x, int y) {
    super(x,y);
    this.size = 5;
    this.velY = 0;
    this.velX = -1;
    this.diameter = this.size;
    this.fillColor = this.chooseColor();
  }
 
  void drawMe() {
    fill(this.fillColor);
    noStroke();  
    ellipse(this.x, this.y, this.size, this.size);
  }
 
  color chooseColor() {
    return color(map(this.y, height/2, height, 0, 155)+100, 0,0);
  }
}
 
class Line extends Shape {
  int x1;
  int y1;
  int x2;
  int y2;
  color strokeColor;
 
  Line(int x1, int y1, int x2, int y2, color strokeColor) {
    super(x1,y1);
    this.x1 = x1;
    this.y1 = y1;
    this.x2 = x2;
    this.y2 = y2;
    this.strokeColor = strokeColor;
  }
 
  void drawMe() {
    stroke(this.strokeColor);
    line(this.x1, this.y1, this.x2, this.y2);
  }
}

Generated PseudoEnglish

I created a sentence generator which chooses which letter comes next based on the most likely letter to follow it in English words. When the mouse is on the left side (order), the probability is always taken into account, and the words generated fall within normal linguistic patterns of English. As the mouse moves further to the right, however, the next character becomes random, and symbols from outside of the alphabet begin to appear.
chaosnorda

var alphabet_frequency=[
[0.00054485,0.0510151,0.0580552,0.040663,0.0048463,0.00881796,0.0328487,0.00402902,0.0316156,0.00093198,0.0116282,0.128943,0.0390858,0.131682,0.000903304,0.0380678,0.00111838,0.112784,0.0654106,0.167312,0.0186826,0.0160301,0.0105099,0.00404336,0.0153705,0.00506137],
[0.129907,0.038315,0.00380942,0.00452714,0.137857,0.00160106,0.000662508,0.00171148,0.127588,0.00358858,0.000441672,0.202783,0.00380942,0.00226357,0.119969,0.00138022,0,0.0868437,0.0331806,0.00734279,0.0792801,0.00176669,0.00143543,5.5209e-05,0.0098824,0],
[0.155535,8.33519e-05,0.0181429,0.000333407,0.107218,0,2.7784e-05,0.123833,0.0809902,0,0.0705157,0.0422872,0.00013892,0.000416759,0.178262,0.00013892,0.00177817,0.0608469,0.0119749,0.0777951,0.0549567,0,5.55679e-05,0,0.0139475,0.000722383],
[0.0722412,0.00679154,0.00389324,0.029156,0.299044,0.00415279,0.0180819,0.00506121,0.22278,0.00510447,0.000389324,0.0432582,0.00947355,0.0109443,0.0758749,0.00359043,0.000389324,0.050093,0.0644115,0.00198988,0.0449885,0.00575334,0.00748367,4.32582e-05,0.0147943,0.000216291],
[0.0469106,0.00774005,0.0366144,0.121346,0.0261955,0.013016,0.0124638,0.00397738,0.0103576,0.00123718,0.00194268,0.0503052,0.0297026,0.104997,0.00840465,0.0196109,0.00304694,0.214871,0.19389,0.043015,0.00581782,0.0120855,0.00860914,0.0158789,0.00653354,0.00143145],
[0.0935906,0.00167411,0.000637755,0.000956633,0.125159,0.0940689,0.000478316,0.00159439,0.190689,0.000159439,7.97194e-05,0.111767,0.000398597,0.000637755,0.125159,0.000717474,0,0.0752551,0.0160236,0.0361129,0.100606,0,0.000478316,0,0.0237564,0],
[0.106661,0.00315032,0.000337534,0.00123762,0.19712,0.00208146,0.0475923,0.0594622,0.121737,0.000225023,0.000281278,0.0831458,0.0100135,0.0409541,0.0604748,0.0010126,0,0.118081,0.0607561,0.00343159,0.0567057,0,0.00315032,0,0.0221647,0.000225023],
[0.166889,0.00472716,0.00107903,0.00174699,0.260097,0.00344261,0.000308293,0.00174699,0.167711,0.000359675,0.000565204,0.014387,0.0128455,0.00909465,0.165451,0.00184976,0.000102764,0.0341692,0.0216833,0.0395129,0.0414654,5.13822e-05,0.00565204,0,0.0450622,0],
[0.040713,0.0151524,0.0845031,0.0309301,0.0781405,0.0200071,0.0265658,0.000588444,0.000514889,0.000281963,0.00369004,0.0549828,0.0307094,0.251474,0.0721703,0.0191122,0.00196148,0.0264187,0.0998517,0.0747937,0.00410685,0.0296429,0.000318741,0.00288093,0.000110333,0.0303784],
[0.21563,0,0.000570451,0,0.183115,0,0,0,0.0798631,0.0022818,0.000570451,0,0,0.00171135,0.222476,0,0,0,0,0,0.293782,0,0,0,0,0],
[0.0626646,0.0124775,0.00166366,0.00388188,0.328989,0.00651601,0.00110911,0.0109524,0.218494,0.00124775,0.00374324,0.0561486,0.00956606,0.0399279,0.0239845,0.00582282,0,0.0137252,0.133509,0.00748648,0.013032,0.00110911,0.0116456,0,0.0323028,0],
[0.12659,0.00328085,0.00617823,0.015893,0.210912,0.0055391,0.00374955,0.00134217,0.17985,4.26085e-05,0.00696649,0.108076,0.00643388,0.00479346,0.0926522,0.00541128,0.000127825,0.00119304,0.0339377,0.0214321,0.0381346,0.00619954,0.00144869,4.26085e-05,0.119623,0.00014913],
[0.182454,0.0537876,0.00103998,0.000540788,0.204376,0.00307833,0.000124797,0.000665585,0.182287,0.000124797,0.000374392,0.0044511,0.0449686,0.00927659,0.113191,0.0951787,0.000166396,0.00137277,0.0445526,0.000831981,0.044095,0.000665585,0.000915179,0,0.0114813,0],
[0.0689707,0.0037413,0.061119,0.0700948,0.128093,0.0146296,0.201577,0.00510024,0.0798423,0.00236557,0.0140928,0.00669407,0.00434527,0.0183542,0.0491066,0.00520091,0.00226491,0.00515057,0.0981294,0.126751,0.0144115,0.00914353,0.00317087,0.000503313,0.00568744,0.00145961],
[0.0190439,0.0194142,0.0342262,0.0271376,0.0106152,0.0104918,0.0393927,0.00246866,0.0217242,0.000652431,0.0100862,0.0706389,0.0596533,0.198903,0.0432897,0.0414558,0.00118143,0.134542,0.0535699,0.049091,0.0793497,0.0268202,0.030241,0.00705331,0.00620691,0.00275079],
[0.111661,0.00190773,0.00171306,0.000973331,0.173564,0.00155733,0.000506132,0.0757251,0.104575,0.000389332,0.0010512,0.0767374,0.00249173,0.00249173,0.111154,0.0544287,0,0.139926,0.0438777,0.0394394,0.0433716,0,0.00179093,0,0.0106288,3.89332e-05],
[0.00175747,0,0,0,0.000585823,0,0,0,0.00410076,0,0,0,0,0,0.00117165,0,0,0.000585823,0.000585823,0.00117165,0.990041,0,0,0,0,0],
[0.14237,0.0128776,0.0199195,0.0267658,0.206938,0.00650399,0.0139697,0.00414038,0.141947,0.000717231,0.011655,0.0119158,0.0245489,0.0193326,0.100641,0.0111334,0.000619427,0.0249238,0.11241,0.0397248,0.03014,0.00774284,0.00329274,8.15036e-05,0.025315,0.000374916],
[0.0464025,0.00307246,0.0525474,0.00172563,0.122204,0.00349334,0.00147309,0.0778636,0.0935836,0.00039984,0.0128159,0.0279046,0.0317136,0.0170037,0.0435826,0.0453082,0.00553463,0.00157832,0.120415,0.217324,0.0501063,0.000315663,0.0108588,0,0.0127317,4.20884e-05],
[0.0922844,0.00317177,0.0107627,0.000908767,0.214326,0.00383108,0.00153243,0.0574661,0.24052,0.000142552,8.90948e-05,0.0208125,0.00427655,0.00340342,0.0824483,0.00158589,0,0.0856379,0.0676051,0.0350143,0.0357092,0.000160371,0.00625445,1.7819e-05,0.0297398,0.00229865],
[0.0395311,0.0382787,0.0418433,0.0305074,0.0370263,0.0123635,0.0249839,0.000256904,0.037219,0.000674374,0.00324342,0.103629,0.0685292,0.165607,0.0083815,0.0379576,0.000160565,0.123507,0.129865,0.0855491,0.000545922,0.00289017,0.000192678,0.0029544,0.000706487,0.00359666],
[0.146568,0,0.000103072,0.000206143,0.537724,0,0.000103072,0,0.210163,0,0,0.000309215,0,0.000618429,0.0809112,0,0,0.00247372,0.000927644,0.000309215,0.012987,0.00226757,0,0,0.00412286,0.000206143],
[0.213868,0.0116868,0.00324633,0.0142839,0.172445,0.00636281,0.00155824,0.0715491,0.165303,0.000129853,0.00818076,0.0323335,0.00454486,0.0533697,0.132191,0.00532398,0,0.0379172,0.0499935,0.00493442,0.00259707,0,0.00168809,0,0.00545384,0.00103883],
[0.0733795,0.00203832,0.0815328,0,0.174888,0.00407664,0.00122299,0.0281288,0.191602,0,0,0.00693029,0.00244598,0.00122299,0.0501427,0.156135,0.00122299,0,0.0057073,0.134937,0.0432124,0.00203832,0.0044843,0.00366898,0.0309825,0],
[0.0685694,0.0222764,0.0584755,0.0320223,0.100592,0.00922381,0.0191438,0.0076575,0.0938044,0.00121824,0.00156631,0.0640446,0.0718761,0.0536025,0.0499478,0.0824922,0,0.045771,0.144796,0.0323703,0.00556909,0.00226244,0.0182736,0.00487296,0,0.00957188],
[0.137139,0.000494193,0.000494193,0.000247097,0.484804,0,0.000494193,0.00123548,0.187546,0.000247097,0.000988386,0.0308871,0.00197677,0.000247097,0.058809,0.00247097,0.00074129,0,0.000247097,0.000988386,0.00790709,0.00148258,0.000988386,0,0.0180381,0.0615271]
];

function myChar(c){
  c = String.fromCharCode(constrain(c.charCodeAt(0), 'a'.charCodeAt(0), 'z'.charCodeAt(0)));
  var letterFound = false;
  var result = 'z';
  var maxFreq = 0;
  while(letterFound === false){
    for(var i = 0; i < 26; i++){
      var newFreq = alphabet_frequency[(c.charCodeAt(0) - 'a'.charCodeAt(0))][i];
      if(random(1) <= newFreq){
        letterFound = true;
        if(maxFreq < newFreq){
          maxFreq = newFreq;
          result = String.fromCharCode(i + 'a'.charCodeAt(0));
        }
      }
    }
  }
  return result;
}
var s;
var wordlength;
function setup(){
  createCanvas(800,100);
  background(255);
  s = " ";
  wordlength = 0;
  textSize(20);
}
function draw(){
  if(frameCount % 5 === 0){
    if(s.length > 80){
      s = s.substring(1);
    }
    if(s.charAt(s.length-1) == " "){
      s = s + String.fromCharCode(floor(random(26))+'a'.charCodeAt(0));
    }
    else if(random(floor(map(mouseX, 0, width, 10, 100))) > wordlength){
      wordlength++;
      var newChar;
      if(random(1) > map(mouseX, 0, width, 1, 0)){
        newChar = String.fromCharCode(floor(random(500))+20);
      }else newChar =  myChar(s.charAt(s.length-1));
      s = s + newChar;
    }else{
      wordlength = 0;
      s = s + " ";
    }
  }
  println(String.valueOf('a'));
  background(0);
  strokeWeight(1);
  stroke(255);
  textSize(20);
  text(s,0,25);
  strokeWeight(5);
  stroke(map(mouseX, 0, width, 0, 255), map(mouseX, width, 0, 0, 255), map(mouseX, width, 0, 0, 255));
  line(0,75,mouseX,75);
  stroke(255);
  strokeWeight(1);
  textSize(12);
  text("order",0,75);
  text("chaos",width-40,75);
}

chaos versus order : cellular matter

ribosomes leaving

Thank you Miles Peyton for helping me to understand trig and arrays.
Initially I had wanted for the tiny particles to be moving around in a circle, continuously, and for there to be a reaction from the cell when the particles leave .
I though of Chaos and Order in terms of cells and their functioning parts. Parts of wholes that are so incredibly important, if we lose them, higher structures and larger ideas cannot be maintained. Even something as tiny as the ribosomes missing would undermine the system.

int numDots;
 
float[] dot_rotation;
float[] dot_intialRadius;
float[] dot_radius;
float dotSize = 5;
float MAX_RADIUS = 90;
 
 
void setup () {
  size (600, 300);
 
  numDots = int(random(90, 120));
  dot_rotation = new float[numDots];
  dot_intialRadius = new float[numDots];
  dot_radius = new float[numDots];
 
  for (int i = 0; i < numDots; i++) {
    dot_intialRadius[i] = random(40, 100);
    dot_rotation[i] = random(0, TWO_PI);
  }
}
 
void draw () {
  background (250);
  smooth ();
 
   noFill ();
  stroke (170);
  ellipse (300, 150, 200, 200);
  ellipse (300, 150, 120, 120);
 
 
 
  float mouseNormalized = float(mouseX) / float(width);
 
 
  pushMatrix();
  translate(width/2, height/2);
  fill (120);
  noStroke ();
 
  for (int i = 0; i < numDots; i++) {
    dot_radius[i] = MAX_RADIUS * mouseNormalized + dot_intialRadius[i];
    float thisDot_x = cos(dot_rotation[i]) * dot_radius[i];
    float thisDot_y = sin(dot_rotation[i]) * dot_radius[i];
    ellipse(thisDot_x, thisDot_y, dotSize, dotSize);
  }
 
  popMatrix();
 
 
  fill (240);
  ellipse (300, 150, 95, 95);
  fill (230); 
  ellipse ( 300, 150, 70, 70);
 
  fill (190);
  noStroke ();
  ellipse (290, 130, 20, 17);
  ellipse (320, 165, 15, 9);
  ellipse (285, 175, 27, 20);
 
 
}

Either Chaos to Calm or Calm to Chaos

This is nothing like my original idea, which was that the particles would be randomly moving around and as mouseX increased they would come together to form the shape of a folding chair. This is as far as I got, just the particle system. The noise field is made from fiddling around with the noise function in the velocity of the points. Noise fields are really great for experimenting with, because no matter what you put, it comes out looking sweet.

//cc charlotte stiles
//studied this http://www.openprocessing.org/sketch/10475 to understand particle systems
 
ArrayList points = new ArrayList();
boolean drawing = true;
 
void setup(){
  smooth();
  size(600,600);
 
  background(255);
}
 void draw(){
   fill(255,50);
   rect(0,0,width,height);
   //magic if statement, dont touch
  if(drawing == true){
    //pvector comes with x and y
    PVector pos = new PVector();
    pos.x = random(width);
    pos.y = random(height);
    //velocity
    PVector vel = new PVector();
    vel.x = (0);
    vel.y = (0);
 
    Point punt = new Point(pos, vel);
    points.add(punt);
  }
 
   //draws the points
  for(int i = 0; i &lt; points.size(); i++){
   Point localPoint = (Point) points.get(i);
 
   localPoint.update();
   localPoint.draw();
  } 
}
 
 
class Point{
  PVector pos, noiseVec,vel;
  float noiseFloat;
 
 
  public Point(PVector _pos, PVector _vel){
    //these are for the punt
    pos = _pos;
    vel = _vel;
 
  }
 
  void update(){
        //This is what gives the curvy shape
    noiseVec = new PVector();
    noiseVec.x = mouseX/100*( noise(pos.x/100)-.06);
    noiseVec.y = mouseX/100*(noise(pos.y/100)-.06);
    pos.add(noiseVec);
       //warping, so it get heavier over time
    if(pos.x &lt; 0 || pos.x &gt; width || pos.y &lt; 0 || pos.y &gt; height){
         pos.x = random(width);
         pos.y = random(height);
    }
       //all that for this
       ellipse(pos.x, pos.y, 3, 3);
 
  }
 
  void draw(){   
    fill(0);
    noStroke();
 
  }
}