Project 06

For my abstract clock, the day/night period is from 7 am to 7 pm & vice versa. This means that the sun rises & sets at 7 am & 7 pm, respectively. The number of stars displayed on screen references what minute it is, and one complete rotation of a star = 1 minute. The half-circle path that the sun/moon takes can be used to tell the hour.

sketch
//Lily van Veen, section B, lvanveen@andrew.cmu.edu, project 6
var r; //red value
var g; //green value
var b; //blue value
var h; //hour
var m; //min
var s; //sec
var x = []; //x value of top point of stars
var y = []; //y value of top point of stars
var t = 0; // rotation/turn of stars

function setup() {
	frameRate(30);
    createCanvas(480, 480);
    background(235, 205, 124);
    for(var i = 0; i < 60; i++){ 
    	x[i] = random(30, width-30);
    	y[i] = random(30, height-240);
    }
}

function draw() {
	let h = hour();
    let m = minute();
    let s = second();
	if(h > 7 & h < 19){ //"sunrise" and "sunset" will happen @ 7 am & 7 pm respectively
    	r = 235; //yellow
    	g = 205;
    	b = 124;
    	background(r, g, b);
    }else if(h < 7 || h > 19){
    	r = 48; //blue
    	g = 68;
    	b = 133;
    	background(r, g, b);
    }else if(h == 7){
    	r += .01; // w/ .01 change in color @ 30 fps, will take abt 2 min to fully shift from day to night (also about the same time a sunset/sunrise takes :) )
    	g += .01;
    	b -= .01;
    	background(min(r, 235), min(r, 205), max(b, 124));
    }else if(h == 19){
    	r -= .01;
    	g -= .01;
    	b += .01;
    	background(max(r, 48), max(g, 68), min(b, 133));
    }

    for(var i = 0; i < m; i++){ // i is used to count the # of minutes; this is the section to draw the star - initally was going to put this under a function called drawStar(); but didn't function properly
    	push();
        translate(x[i], y[i]);
        rotate(radians(s*6));
    	fill(255, 249, 201); //light yellow
	    strokeWeight(0);
	    triangle(0, -5, -5, 5, 5, 5);
	    triangle(-5, 5, -7.5, 10, 0, 7.5);
	    triangle(5, 5, 7.5, 10, 0, 7.5);
	    triangle(0, 7.5, -5, 5, 5, 5);
	    triangle(-5, 5, -10, 0, 0, 0);
	    triangle(5, 5, 10, 0, 0, 0);
	    pop();
    }
    	push(); //creates path of sun to better indicate hour of the day, "sun" visible from 7 am -> 7 pm
    	translate(240, 480);
    	rotate(radians((((h-7)*60)+m)*(360/1440)));
    	strokeWeight(0);
    	fill(255, 248, 189);
    	ellipse(-215, 0, 50, 50);
    	pop();

    	push(); //creates path of sun to better indicate hour of the day, "sun" visible from 7 pm -> 7 am
    	translate(240, 480);
    	rotate(radians((((h-7)*60)+m)*(360/1440)+180));
    	strokeWeight(0);
    	fill(255, 248, 189);
    	ellipse(-215, 0, 50, 50); //so the ellipse to carve out moon shape is the same as bg :)
    	if(h > 7 & h < 19){ //"sunrise" and "sunset" will happen @ 7 am & 7 pm respectively
      	    r = 235;

Project: 06 – Abstract Clock

Crop Circles

I was inspired by crop circles for my clock. Each node is one hour in a day. The crops in the background grow with the mouse.

Sketch
sketch
/* Evan Stuhlfire
** estuhlfi@andrew.cmu.edu, section B
** Project 06: Abstract Clock  */

var r = 90; // radius of center circle, noon
var deg = 360; // degrees in a circle
var nodeCount = 24; // 24 hours, each node is one hour
var c = []; // color array
var x = []; // x position of circle
var theta = []; //angle
var size = []; // diam of the circles
var defaultColor;
var tempSize = 0; // allows the nodes to grow with time
var pSize = 25;

function setup() {
    createCanvas(480, 480);
    background(127, 198, 164);
    fillArray(); // fill arrays with start values

}

function draw() {
    var thetaRotate = 40; // canvas rotation

    background(127, 198, 164);
    drawCrops();

    // build color array
    buildColorArray();

    stroke(93, 115, 126);
    // settings to draw circles (nodes)
    push(); // save settings
    translate(width/2, height/2); // reset origin to center
    rotate(radians(thetaRotate)); // rotate canvas to draw at an angle

    // call function to draw the nodes
    drawNodes();
    pop(); // restore settings

    // make crops reactive to mouse location and time
    pSize = mouseX/hour();
}

function drawCrops() {
    var rows = width/30;
    var cols = height/30;
    var incr = width/16;
    
    var s1 = width/16;
    var s2 = height/16;
    var len = pSize;
    var a = len/4; 

    // loop over double for loop to add colums and rows of crops
    for(var i = 0; i < rows; i++) {
        for(var j = 0; j < cols; j++) {
            push();
            translate(s1/2, s2/2);
            drawOne(len, a); 
            pop();
            s2 += 2 * incr;
        }
        s1 += 2 * incr;
        s2 = incr;
    }
}

function drawOne(len, a) {
    // function to draw on plant for crops
    stroke(93, 115, 126, 60);
    line(0, -a, 0, len);
    line(-a, -a, 0, len/2);
    line(a, -a, 0, len/2);
}

function buildColorArray() {
    // set the default color
    defaultColor = color(242, 245, 234);

    // fill array with colors
    for(var i = 0; i < x.length; i++){
        if(i < 3) {
            c[i] = color(93, 115, 126);    
        } else if(i < 6) {
            c[i] = color(118, 129, 179);
        } else if(i < 9) {
            c[i] = color(214, 248, 214);
        } else if(i < 11) {
            c[i] = color(163, 213, 255);
        } else if(i < 14) {
            c[i] = color(250, 243, 62);
        } else if (i < 16) {
            c[i] = color(163, 213, 255);
        } else if (i < 19) {
            c[i] = color(214, 248, 214);
        } else if (i < 22) {
            c[i] = color(118, 129, 179);
        } else if (i < 25) {
            c[i] = color(93, 115, 126)
        }
    }
}

function fillArray() {
    var angle = 30; // nodes are positioned 30 degrees apart
    var angle2 = 150; // starting point for second set of nodes
    var dist = 65; // nodes begin at dist from center
    var offset = 1.2 // distance offset 
    var offset2 = .8 
    var minSize = 15; // can be no smaller than minSize

    // fill arrays with start values
    x.push((-deg/2) + 10);
    theta.push(180);
    size.push(r * offset2); // 80% size of center

    // fill array with first 12 nodes
    for(var i = 1; i < nodeCount/2; i++) {
        x[i] = dist;
        theta[i] = angle * i;
        size[i] = max(r * i/18, minSize);

        dist = dist + i * offset;
    }

    // push center circle into array
    x.push(deg/2 - 10);
    theta.push(0);
    size.push(r);

    dist = dist - i * offset; // undo last dist calc
    // fill array with last 12 nodes
    // loop backward so that decreasing i can be used to decrease size
    for(i = x.length; i > 2; i--) {
        x.push(dist);
        theta.push(angle2);
        size.push(max(r * i/22, minSize));

        dist = dist - i * offset2;
        angle2 -= angle;
    }

    // push last circle into array, midnight
    x.push(0);
    theta.push(0);
    size.push(r * offset2); // 80% size of center
}

function drawNodes() {
    var h = hour();
 
    stroke(93, 115, 126);
    // draw line behind center node so that it is behind
    line(0, 0, deg/2, 0);

    // draw the satellite nodes
    push();

    translate(x[0], 0); // reset origin to top circle
    loopAndDraw(0, x.length/2, h);

    // draw top midnight circle
    fill(c[0]);
    circle(0, 0, r * .8);
    pop();

    push();
    translate((deg/2) -10, 0);
    loopAndDraw(int(x.length/2) + 1, x.length, h);

    pop();
}

function loopAndDraw(start, end, h) {
    var dx;
    var dy;
    var current = false; // identify the current node

    // iterate over arrays
    for(var i = start; i < end; i++) {
        dx = x[i] * cos(radians(theta[i]));
        dy = x[i] * sin(radians(theta[i]));

        // midnight
        if(h == 0) {
            h = 24;
        }
        // if the hour has passed or is the current hour use fill
        if(i < h){
            fill(c[i]);
        } else if (i == h) {
            current = true;
            fill(c[i]);
        } else {
            fill(defaultColor);
        }

        stroke(93, 115, 126);
        line(0, 0, dx, dy);
        circle(dx, dy, size[i]);

        if(current) {
            currentHour(i, dx, dy);
        }

        current = false;
    }
}

function currentHour(i, dx, dy) {
    // add time elements to nodes to track time
    // subtract to adjust for rotation of canvas
    var s = second() * 6 - 140;
    var m = minute() * 6 - 140;
    var h = hour() * 30 + minute()/2 - 140; 

    fill(c[i]); // use the color stored in the array
    push();
    translate(dx, dy);
    // make current circle bigger
    tempSize = size[i] * 1.32;
    circle(0, 0, tempSize);

    // have a second hand orbit the current hour
    if(i > 3 & i < 23) {
        fill(c[i - 3]); //use previous color.
    } else {
        fill(defaultColor);
    }
    // mark hours
    var hx = size[i] * .6 * cos(radians(h));
    var hy = size[i] * .6 * sin(radians(h));
    circle(hx, hy, tempSize * .25);

    // mark minutes
    var mx = size[i] * .3 * cos(radians(m));
    var my = size[i] * .3 * sin(radians(m));
    
    circle(mx, my, tempSize * .2);

    // mark seconds
    var armX = size[i] * .55 * cos(radians(s));
    var armY = size[i] * .55 * sin(radians(s));
    strokeWeight(1);
    circle(armX, armY, tempSize * .15);
    pop();
}

Looking Outwards: 06

Vera Molnar is a pioneer in computational and generative art work. She began writing computer code that introduced randomness to her art in the mid to late 1960s. Even earlier she was creating manual rules and algorithms to generate computational art by hand. She began writing code in Fortran back at a time when they used punch cards to feed a program into the computer. The randomness, she explained, gives her ideas and allows her to try out endless variations of her work. This enables her to create works that she may never have thought of on her own. She explains that the computer is not taking the place of the artist; it is simply a tool.
For this project I became intrigued with her Variations exposition at the Beall Center at the University of California in Irvine. The art works presented are generative both through computer programming and also from her manual algorithms. The piece that resonated with me most is called Interruptions and is presented below. This work is a series of short random lines. She worked with this program and introduced the removal of lines in the randomness algorithm as well. The gaps give the work its name, Interruptions. I really enjoy that she plays with the removal of what is already there. Each iteration of the program creates a unique image. It is compelling to see what gets left behind in the empty spaces.

Interruptions

Looking Outwards 06

Randomly Generated Poetry

Although the world of random visual art is vast, as is the genre of randomly generated music, I found that I was drawn toward the idea of randomly generated poetry. In a recent project from two students at Bard College, an algorithm was written that created randomly generated poetry based on the stylistic choices of a chosen poets such as Dickenson and Shakespear. In terms of their process, they begin by writing an algorithm that reads poetry from the writer and creates a numerical value based on how often the word s used(its usage probability). Next, the bot randomly chooses a word from the list. The choice is truly random but constrained to words used by the writer. The algorithm then goes on to gauge the probability of other words used in conjunction with the first word, and chooses the next word accordingly, and so on. So although it is not truly random, the code is not always choosing the words that are most likely to be used together. I really admire this work because it is created for the public by students like ourselves, and the poetry generated is really beautiful.

Project 06

Abstract Clock

For my clock, I attempted to represent time using the method of burning candles. As we progress into the hour, the candle will become shorter and shorter until the 59th minute is reached. Then, the candle will reset to the original height. The light stripes in the background represent the hour of day on a 24-hour basis.

sketch
// Theresa Ye
// Section E
// thye@andrew.cmu.edu
// Project-06

var x = [16,16,8,12,14,15,16,16,24,28,16,16];
var y = [0,0,-8,-24,-16,-12,-24,-32,-20,-8,0,0];

function setup() {
    createCanvas(400, 400);
    frameRate(7);
}

function draw() {
    background(179,217,217);

    // make background stripes (light stripes = hour)
    strokeWeight(10);
    stroke(102,179,179);
    for (var i = 1; i < hour(); i++) {
        line(0,i*height/hour(),width,i*height/hour());
    }

    translate(width/2 - 16, 400 - 16);

    //make candle :> (candle burning = minutes)
    fill('yellow');
    stroke(0);
    strokeWeight(2);
    rect(6,0,20,-300 + 5*minute()+ 3)
    ellipse(16,-300 + 5*minute() + 3,20,10);

    //make flame :>
    var npoints = x.length;
    fill('pink');
    beginShape();
    for (var i = 0; i < 12; i++) {
        curveVertex(x[i] + random(-3,3),-300 + 5*minute() + y[i] + random(-3,3));
    }
    endShape(CLOSE);
}

Looking Outwards 06

Randomness.

I find the architect, Michael Hansmeyer’s work to be especially interesting. Hansmeyer is an architect who creates generative design through what he calls “happy accidents” that result from randomness. He uses computer algorithms to generate and fabricate architectural forms that are then 3d-printed. He believes that the combination of randomness, computation, and fabrication allows for inventive ways to convey space and sensations. 

“Architecture should surprise, excite and irritate”. The complexity of modern architecture does not long for a meticulous drawing by hand, but rather an abstract, open-minded, computational approach. Hansmeyer’s works are all extremely fine and beautiful, with new and unique objects and ways of assembly. Structures, surfaces, and interactions between them are highly detailed and create extreme visual stimulation. 

Looking Outwards-06 Randomness in Art

Untitled (Collage with Squares Arranged according to the Law of Chance)

During World War 1, in Zurich Germany, artist Jean Hans Arp created a collage that uses a principle of randomness to dictate the artwork. The artwork, Untitled (Collage with Squares Arranged according to the Law of Chance) interests me because it is a rare and good example of dadaist art. Dadaist art stems from the dada movement; a movement that promoted randomness, nonsense, and satire. The movement itself had been created in reaction to the horrific trauma of the war. Themes of authorship and control were associated with authoritarian and controlling powers, and thus the random and accidental nature of Dadaist art most likely reflects freedom, liberation, and choice. 

In this artwork, Arp demands for a movement of new art; thinking outside the box without intention. She tore up heavyweight fine art papers with torn fiber edges, held them up in air, and then released them, letting the pieces land on the ground wherever gravity and the surrounding atmosphere took it. Then, she would mark the spot that it landed on and accordingly paste the piece in that exact arrangement. 

The use of randomness in Arp’s artwork is an example of Real randomness. While tasks like flipping a coin may be martingale random, or functions like random(); may be pseudo random, dropping papers and letting them land wherever is real random as there is no provable sequence or range involved. However, a factor of the artwork that may take away from the randomness is that it likely had a canvas which the pieces needed to fall on. Thus, she probably only chose pieces which were within the range and bounds of the canvas.

Looking Outwards 06 :  Randomness

The work of MARK J. STOCK, the “The Yin and Yang Are Fractal #4” have inspired me with its random, dynamic motion that represents the concept of Yin and Yang in Tai Chi, which is a part of Chinese culture. It’s inspiring to see how the concept of Yin and Yang changing and interacting with each other in various layers and various sizes, and it gave me a sense of special beauty from the dynamic ink painting. The algorithms that generate its randomness also interest me with its simple code that forms the complicated structure and shapes of the art itself. According to Mark, the “color is passed from pixel to pixel in a regular grid using a very specific set of instructions.” The code generates randomness among pixels within a limited range, while it tries to adhere to a general shape, like a circle, at the beginning. Then the pixels randomly interact with nearby pixels in a certain range to create the art we saw. The creator’s artistic sensibilities manifest in the final form of random Yin and Yang interactions in the form of generated ink art, where Yin and Yang seem to be randomly blended together.

Videos: “The Yin and Yang Are Fractal #4” by MARK J. STOCK, produced in 2015

“The Yin and Yang Are Fractal #4” by MARK J. STOCK, produced in 2015
Link: Mark J. Stock (markjstock.com)

Link: Mark J. Stock (markjstock.com)

Generated 3D Scene

I am interested in David Mignot’s work in using python codes to generate a series of objects in Blender. The randomness is expressed through the random function to vary the type, height, and material of objects. Each time the function creates a different rendered scene that would take days to model by hand. David expressed his artistic sensibilities in attempting to control the randomness of variables so that the final result looks harmonic. It showcases how randomness needs to be controlled in computational art so that the generated work still looks “designed” rather than messy and purely random.

Generated scenes by David using inbuilt python codes in Blender

The work intrigues me in terms of creating generative art in 3d forms. Typically, Blender is used for 3d modeling individual objects for the CG industry. However, David opened up a new possibility in utilizing randomness to generate 3d scenes by coding, which might be a helpful method to create large repetitive scenes quickly.

Looking outwards 6

For this week I looked at Brian Eno’s use of generative algorithms in music production. I didn’t know that he literally invented generative music and was doing it in the 90’s. This is exciting for me because I’m a fan of him and it makes me more impressed with him as an artist as well as interested in the application of coding. He used a moire pattern, which is two grids of sound layered on top of another and overylaying them into what he calls ambient music. He had a lot of interesting methods using hardware and homemade contraptions to produce and alter his music in really unique ways. This is a link to a talk he gave on his generative music.

https://inmotionmagazine.com/eno1.html

Some of his albums useing genrative production methods are ambient music 1 through 4, and Apollo.