James Katungyi – Project 06 – Abstract Clock

Abstract Clock

jameskatungyi-project06-abstractclock

//James Katungyi
//Section A 0900
//jkatungy@andrew.cmu.edu
//Assignment-Project-06

function setup(){
    createCanvas(300,300);
    
}
function draw(){
    background(227,218,186);
    stroke(208,169,97);
    strokeWeight(1);
    HourBar();//hour bar function
    MinuteLine();//minute line function
    SecondBall();//second ball function
}
function HourBar(){
    var BarH = height/24;
    var H = hour(); //link to computer clock hour
    var M = minute();//link to computer clock minutes
    var HBarX = map(M,0,59,0,width);//link x position to minute
    var HBarY = map(H,0,23,0,height);//link Y position to hour
    stroke(208,169,97);
    if ((HBarY > height*6/24) & (HBarY < height*18/24)){//fill color bar with light color from 6am to 6pm 
        fill(245);
    } else {
        fill(180);//otherwise make hour bar dark
    }
    rect(0,HBarY,HBarX,BarH);//hour bar
    for (var y = 0; y < HBarY; y += 12.5){
        if ((y > height*6/24) & (y < height*18/24)){//fill bars with light shade from 6am to 6pm 
            fill(245);
        } else {
            fill(180);
        }
        rect(0,y,width-1,BarH);
    }  
}
function MinuteLine(){
    var M = minute();//computer clock minute
    var S = second(); //computer clock seconds
    var LineY = map(S,0,59,0,height);//link x position to seconds
    var LineX = map(M,0,59,0,width);//link x position to minutes
    stroke(208,169,97);
    strokeWeight(1);
    line(LineX,0,LineX,LineY);//minute line
    for (var x = 0; x < LineX; x += 5){
        line(x, 0, x, height);
    }
}
function SecondBall(){
    var diam = 20;
    var S = second();//computer clock seconds
    var M = minute();
    var BallX = map(S, 0, 59, 0, width); //link seconds to x position of the ball
    var BallY = map(M, 0, 59, 0, height); //link ball position of y to minutes
    stroke(208,169,97);
    strokeWeight(1);
    if ((BallY > height*7/24) & (BallY < height*19/24)){//fill ball with dark shade from 6am to 6pm 
            fill(180);
        } else {
            fill(245);
        }
    ellipseMode(CENTER);
    ellipse(BallX,BallY,diam,diam); //draw ball
}


As the hours and minutes build up, the canvas fills with boxes and lines. Each day is a fresh start on a clean slate. Each hour starts out less clattered than towards its close.

The seconds are marked by a ball which was supposed to bounce off the sides evoking the ‘tick-tock’ associated with clocks. However, the reverse direction did not work out. In a way, the single direction is better because each second is fresh, not recycled.

The hours relate to the minutes in that one can tell the hour and minute by just looking at the hour indicator. The same with the minutes and seconds. And ofcourse one can tell the night hours from the day hours – a feature that is perhaps only useful in casinos where one never sees the sky.

Project 06 – Abstract Clock

Abstract Clock

jameskatungyi-project06-abstractclock

As the hours and minutes build up, the canvas fills with boxes and lines. Each day is a fresh start on a clean slate. Each hour starts out less clattered than towards its close.

 

The seconds are marked by a ball which was supposed to bounce off the sides evoking the ‘tick-tock’ associated with clocks. However, the reverse direction did not work out. In a way, the single direction is better because each second is fresh, not recycled.

 

The hours relate to the minutes in that one can tell the hour and minute by just looking at the hour indicator. The same with the minutes and seconds. And ofcourse one can tell the night hours from the day hours – a feature that is perhaps only useful in casinos where one never sees the sky.

GarrettRauck-Project-6

sketch

//Garrett Rauck
//Section C
//grauck@andrew.cmu.edu
//Project-06-Abstract Clock

//In this clock, the hour is represented by the greyscale tone of the background,
//the minute is represented by the rotation of the line, and the second is
//represented by the inflection of the line which is a 6-bit binary representation
//of the integer value of the second.

/////////////////////////////////
// GLOBAL VARS
/////////////////////////////////
//canvas
var canvasWidth, canvasHeight;
//time
var h, m, s;
//geometry
var x = []; //x pts of line
var y = []; //y pts of line
var nBits, ptsPerBit, nPts, ptSpacing;
var bitVal, bit0Amplitude, bit1Amplitude;
var rotationAngle;
var seeTime;
var mBallSize, sBallSize, cBallSize;
//color
var cBackground, cStroke;

/////////////////////////////////
// HELPER FNS
/////////////////////////////////
function drawWave() {
    for (var i = 0; i < x.length-1; i++) {
        stroke(cStroke);
        push(); //rotation for minute
            translate(canvasWidth/2, canvasHeight/2); //translate to origin
            rotate(rotationAngle); //rotate based on current minute
            translate(-canvasWidth/2, -canvasHeight/2); //translate back to position.
            line(x[i], y[i], x[i+1], y[i+1]); //draw line
        pop();
    }
}

function drawSBall() {
    var armLength = canvasWidth/4-sBallSize/2;
    var theta = s*(TWO_PI/60) - HALF_PI;
    var cx = canvasWidth/2 + armLength*cos(theta);
    var cy = canvasHeight/2 + armLength*sin(theta);
    stroke(0);
    noFill();
    ellipse(cx, cy, sBallSize);
}

function drawMBall() {
    var armLength = canvasWidth/2-mBallSize/2;
    var theta = rotationAngle;
    var cx = canvasWidth/2 + armLength*cos(theta);
    var cy = canvasHeight/2 + armLength*sin(theta);
    noStroke();
    fill(0);
    ellipse(cx, cy, mBallSize);
}

function drawCBall() {
    noStroke();
    fill(0);
    ellipse(canvasWidth/2, canvasHeight/2, cBallSize);
}

function drawTime() {
    var h = hour()%12;
    var m = minute();
    var s = second();
    noStroke();
    fill(cStroke);
    text("" + nf(h,2,0) + ":" + nf(m,2,0) + ":" + nf(s,2,0), canvasWidth/2, 3*canvasHeight/4);
}

//adapted from fernandosavio's function on Stack Overflow
//http://stackoverflow.com/questions/9939760/how-do-i-convert-an-integer-to-binary-in-javascript
function getBinString(n){
    //return binary string for input number with specified number of digits
    return nf((n >>> 0).toString(2), nBits); 
}

function updateTime() {
    h = hour();
    m = minute();
    s = second();
}

function updatePts() {
    //clean pts lists
    x = [];
    y = [];
    //get binary string for seconds count
    binString = getBinString(s); //convert second to binary, return string
    //get x and y values for pts
    for (i = 0; i < nBits; i++) { //for each bit
        bitVal = int(binString[i]);
        for (j = 0; j < ptsPerBit; j++) { //for each pt in bit
            x.push(i*ptsPerBit*ptSpacing+j*ptSpacing); //x value
            if (bitVal == 0) {
                yMax = bit0Amplitude;
                yMin = -bit0Amplitude;
            }
            else {
                yMax = bit1Amplitude;
                yMin = -bit1Amplitude;
            }
            y.push(canvasHeight/2 + random(yMax, yMin)) //y value
        }
    }
}

function updateRotation() {
    rotationAngle = m*(TWO_PI/60) + HALF_PI;
}

function updateColors() {
    cStroke = color(h*(255/24)); // greyscale tone, hr0 = 0, hr24 = 255
    cBackground = color(255-h*(255/24)); //greyscale tone, hr0 = 255, hr24 = 0
}

function updateModel() {
    updateTime();
    updatePts();
    updateRotation();
    updateColors();
}

/////////////////////////////////
// EVENTS
/////////////////////////////////
function keyPressed() {
    if (seeTime == false) seeTime = true;
    else seeTime = false;
}
/////////////////////////////////
// RUN
/////////////////////////////////
function setup() {
    // INIT VARS
    //canvas
    canvasWidth = canvasHeight = 400;
    //time
    h = hour();
    m = minute();
    s = second();
    //geometry
    nBits = 6; //max second count will be 59, which is 111011 in binary, 6 bits
    ptsPerBit = 25; //density of "bits" represented graphically
    nPts = nBits*ptsPerBit;
    ptSpacing = canvasWidth/nPts;
    bit0Amplitude = 5;
    bit1Amplitude = 50;
    seeTime = false;
    mBallSize = 15;
    sBallSize = 8;
    cBallSize = 5;
    
    //canvas setup
    createCanvas(canvasWidth, canvasHeight);
    ellipseMode(CENTER);

    //initial list setup
    // rotateMinuteHand();
    updateModel();
}

function draw() {
    //update model
    updateModel();
    //draw background
    background(cBackground);
    //draw wave
    drawWave();
    //draw minute ball
    drawMBall();
    //draw minute ball
    drawSBall();
    //draw center ball
    // drawCBall();
    //draw actual time
    if (seeTime == true) {
        drawTime();
    }
}

The aesthetic of this clock was inspired by an exhibit by Martin Messier, which I had the chance to experience at Pittsburgh’s Wood Street Galleries over the summer. I wanted to explore creating a visual drama through the activation of a single line. I used randomness to generate “noise” in the line to give a sense of constant movement, time passing. The “bands” that form within the line change every second and are a 6-bit binary representation of the second count, from 0 to 59; the bands with the larger amplitude represent 1’s, while the bands with the smaller amplitude represent 0’s. The minute is complete when the line returns to flat, then the binary counting begins again. The minute is represented by the rotation of the line and the ball at the end, while the hour is represented by the grey-scale tone change throughout the 24-hour period–white at 00:00, black at 23:00.

mreyes-Jean Tinguely

Jean Tinguely‘s Drawing Machines

Various Kinetic Sculptures

jean

Jean Tinguely was an artist working in the 50s and 60s who became famous for his playful kinetic sculptures.  Some of his more interesting works were actually drawing machines witch produced semi random images that were drawn from machines and not people. These drawings were of course abstract and somewhat crude but had a certain rhythm to them because of the machines limited movement ability. When viewing his work people often comment on the juxtaposition of using a machine (witch is often associated with precision) to create these un-precise images.

Hannah K-Looking Outwards-06

This week for my Looking Outwards, I looked at Gerhard Richter’s 4900 Colours: Version II. It was created in 2007 and is composed of 196 panels, and each of these panels have 25 squares. Two things stood out to me about this work. First, even though it is comprised of many parts, you tend not to see these different parts because you only the larger picture. Also, even though it was randomly generated, the colors and patterns they seem to create seem less than random.

This work was inspired by past work (grid paintings) that the artist had done, and the work was created through a “specially developed computer programme,” but I could not find other information specific to the process of creating this work.

https://www.gerhard-richter.com/en/art/paintings/abstracts/colour-charts-12/4900-colours-14891/?&referer=search&title=4900&keyword=4900 4900 Colours: All in One Piece

LookingOutwards-Randomness-sehenry

While searching through different forms of random art, I happened to stumble upon one that peaked my interest. I always believed that random art could mean something to someone and mean something different to a different person. So when I was browsing through all the neat and wonderful art that was generated through the theme of randomness, I was impressed to say the least. The one that I found and was really interested by is called Tsunami by Hailei Wang. She talks about how she uses python to create her artwork and just looking through her different pieces of art makes me want to be more expressive and more random and less “planned out” in certain circumstances.
tsunami_1
tsunami_2

tsunami_3

tsunami_4

tsunami_5

tsunami_6

Painting :Tsunami
Artist: Hailei Wang

Painting With Code

rgriswol_LookingOutwards-06

Are internet memes art? Well, according to Oxford Dictionary, which defines art as “the expression or application of human creative skill and imagination” – yes, they are. While it seems silly to classify them as such, comedy in and of itself is an art form, and internet memes are used almost solely for comedic purposes.
The tumblr blog “memelovingbot” was created by Nora Reed, a generative artist in New Mexico. She’s created multiple bots on tumblr as well as over 60 on twitter. While she does sometimes change the frequency of the bot’s posting and updates the bot when new memes get popular, the rest is completely up to the bot. It can’t do things like answer asks or respond to messages sent by other tumblr users, and it doesn’t have the ability to learn, but even with its rather simple format it still generates some pretty hilarious meme combinations.

Some examples of what the bot has come up with - as you can see from the number of notes, some posts are more popular than others.
Some examples of what the bot has come up with – as you can see from the number of notes, some posts are more popular than others.

The creator also open sourced the code, and it was made using Cheap Bots Done Quick which uses Tracery. All of this information (and more) can be found on the tumblr bot’s FAQ page. While you do have to be rather familiar with these memes to find this kind of meme-distortion funny, the blog is still worth a look regardless.

mreyes-project-06

mreyes-06


//Mercedes Reys

//Section C 

//mreyes@andrew.cmu.edu

//Project-06


var m;
var s;
var h;

var dSM = 360/60;//to devide minutes and seconds into 60 points on circle 

function setup() {
    background(255);//draw second backgrond for shodow/ghost effect
    
    createCanvas(400, 400);

}

function draw() {
     
    background(190, 136, 252,50)// draw tranparent backgrond for shodow/ghost effect
    angleMode(DEGREES)

    //time varibales
    m = minute();
    s = second();
    h = hour();

    var cx = 0;//center x cordinate 
    var cy = 0;//center y cordinate   

    //seconds variables
    var sRadius = width/3; // orbit of seconds circle
    var sx = cos(dSM*s)*sRadius;//x cordinate of circle center
    var sy = sin(dSM*s)*sRadius;//y cordinate of circle center 
    
    // minutes variables
    var mRadius = sRadius+35//orbit 
    var mx = cos(dSM*m)*mRadius;//x
    var my = sin(dSM*m)*mRadius;//y

    push()
    translate(width/2,height/2);
    rotate(90);//start at bottom 
    noStroke();
    
    //seconds ellipse
    var b = map(s, 0,60, 0, 255);
    var g = map(s,0,60,0,255);
    fill(0,g,b,50)//fade from black to cyan in tune with seconds passing by 
    ellipse(sx+cx,sy+cy,5,5);

    //hours ellipse
    var b = map(h, 0,24, 0, 255);
    fill(255,255,b);//fade from yellow to white in tune with hours passing by 
    ellipse(cx,cy,h*10,h*10);//grow larger as hours go by 

    //minutes ellipse
    var g = map(m, 0,60, 0, 255);//fade from magenta to white
    noStroke();
    fill(255,g,255);
    ellipse((-mx)+cx,(-my)+cy,m,m);//negative cordinates to start at top rather than bottom
    pop();

    
 
} 





for this I just tied to incorporate the functions we were using to make the clock assignment to make shires that orbit and grow depending on the time. Here is the sketch.

screen-shot-2016-10-07-at-11-23-06-pm

Diana Connolly – Project 6

lunar

var x = 0;
var cloudX = 0;

function setup() {
    createCanvas(600, 350);
}

function draw() {
    noStroke();
    if (hour() >= 12) { //makes background go from dark blue to orange every other half cycle
        var colors1 = nigth2day();
        background(colors1[0], colors1[1], colors1[2]);
    } else if (hour() < 12) { //makes background go from orange to dark blue every other half cycle
        var colors2 = day2night();
        background(colors2[0], colors2[1], colors2[2]);
    }
    theSun(); //calls sun function
    theMoon(); //calls moon function
    ground(); //calls ground function
    mountains(); //calls mountain function
    shootingStar();
    cloud();
}


//SHAPES:
function theSun() {
    push();
    translate(width/2, height);
    rotate(radians(hour()*15)); //rotates sun from 180˚ starting point, in a full circle every day
    fill("yellow");
    ellipse(0, height-50, 60,60); //sun rotates in a circle of diam=height-50
    pop();
}

function theMoon() {
    push();
    translate(width/2, height);
    rotate(radians(180+hour()*15)); //rotates moon from 0˚ starting point, in a full circle every day
    fill("lightBlue");
    ellipse(0, height-50, 60,60); //moon rotates in a circle of diam=height-50
    pop();
}

function shootingStar() {
    push();
    frameRate(width);
    if (second() <= 60) { //makes the shooting star go across screen per second
        x = x+10;
    }
    if (x>=width) { //makes shooting star start over again
        x = 0;
    }
    fill(255);
    ellipse(x, 30, 10,10);
    pop();

}

function cloud() {
    push();
    frameRate(width);
    if (minute() <= 60) { //makes cloud go across screen per minute
        cloudX = cloudX+(10/60);
    }
    if (cloudX>=width) { //makes cloud start over again
        cloudX = 0;
    }
    fill(255, 80);
    ellipse(cloudX-15, 110, 50,20);
    ellipse(cloudX, 100, 30,20);
    ellipse(cloudX+25, 107, 40,25);
    ellipse(cloudX+35, 115, 30,20);
    ellipse(cloudX+45, 110, 40,20);
    ellipse(cloudX, 110, 40,20);
    pop();

}

function ground() {
    if (hour() >= 12) { //makes ground go from purple to pink every other half cycle
        var colors3 = purple2pink();
        fill(colors3[0], colors3[1], colors3[2]);
    } else if (hour() < 12) { //makes ground go from pink to purple every other half cycle
        var colors4 = pink2purple();
        fill(colors4[0], colors4[1], colors4[2]);
    }
    rect(0, height/2 + 72, width, height/3);
}

function mountains() {
    //Middle mountain
    beginShape();
    fill(150);
    vertex(50, height/2+100);
    vertex(240, 130);
    vertex(width-60, height/2+100);
    endShape(CLOSE);

    //Right mountain
    beginShape();
    fill(225);
    vertex(width, height/2+35);
    vertex(width-30, height/2+10);
    vertex(width-50, height/2+20);
    vertex(width-88, 130);
    vertex(width-125, 170);
    vertex(width-140, 160);
    vertex(width/2-70, height-65);
    vertex(width, height-65);
    endShape(CLOSE);

    //Left mountain
    beginShape();
    fill(0);
    vertex(0, height/2+70);
    vertex(80, height/2);
    vertex(95, height/2+10);
    vertex(120, height/2-10);
    vertex(width/2+50, height-40);
    vertex(0, height-40);
    endShape(CLOSE);
}


//FILLS:
function nigth2day() { //dark blue to orange color gradient
    var colR1 = map(hour(), 0,12, 243, 44);
    var colG1 = map(hour(), 0,12, 135, 17);
    var colB1 = map(hour(), 0,12, 107,106);
    return [colR1, colG1, colB1];
}

function day2night() { //orange to dark blue color gradient
    var colR2 = map(hour(), 12,24, 44, 243);
    var colG2 = map(hour(), 12,24, 17, 135);
    var colB2 = map(hour(), 12,24, 106, 107);
    return [colR2, colG2, colB2];
}

function purple2pink() { //purple to pink color gradient
    var colR3 = map(hour(), 0,12, 192, 46);
    var colG3 = map(hour(), 0,12, 82, 73);
    var colB3 = map(hour(), 0,12, 105, 104);
    return [colR3, colG3, colB3];
}

function pink2purple() { //pink to purple color gradient
    var colR4 = map(hour(), 12,24, 46, 192);
    var colG4 = map(hour(), 12,24, 73, 82);
    var colB4 = map(hour(), 12,24, 104, 105);
    return [colR4, colG4, colB4];
}

For this week’s project, I wanted to create my abstract clock incorporating the moon and the sun. I wanted to use the time of day to correspond with having either the moon or the sun being in the sky. And with this, I wanted the sky to reflect the position of the sun by changing color. I then decided to add in mountains to make a landscape. This all represents time of day using the hour() function. To represent minutes, I added in a translucent cloud, that takes a minute to cross the screen. To represent seconds, I added in a shooting star, that takes a second to cross the screen. Below is my sketch for my project idea.

14572587_10154539645504330_479536189_o

Hannah K-Project-06

sketch-47.js

var txtOffset = 25;
var offset = 100;

// Using ellipse and rectangle to create cup
var cupW = 300;
var cupH = 400;

// White part of cup handle
var wHandleL = 150; // length
var wHandleW = 110; // width
var wHandleXpt = 400 // x-pos
var wHandleYpt = 250; // y-pos

// Background colored part of cup handle
var bHandleL = 90; // length
var bHandleW = 22; // width
var bHandleXpt = 410; // x-pos
var bHandleYpt = 205; // y-pos

function setup() {
    createCanvas(500, 600);
}

// Fills up the cup with coffee as the day goes on!
function draw() {
    // Get the current time
    var H = hour();
    var M = minute();
    var S = second();

    // Calculating heights of rectangles corresponding to H, M, S values
    // Looked at course code example for reference with mapping
    var hourBar = map(H, 0, 23, cupH, 0);
    var minuteBar = map(M, 0, 59, cupH, 0);
    var secondBar = map(S, 0, 59, cupH, 0);
    var barW = cupW/3;

    background(135, 206, 250);
    noStroke();
    // Main part of cup
    fill(255);
    rect(offset, offset, cupW, cupH);
    // Ellipse to draw white part of cup handle
    ellipse(wHandleXpt, wHandleYpt, wHandleW, wHandleL);
    // Ellipse to draw background color part of cup handle
    fill(135, 206, 250);
    rect(bHandleXpt, bHandleYpt, bHandleW, bHandleL, 5);

    // Fills up cup in relation to seconds
    fill(99, 49, 0);
    rect(offset, offset, barW, secondBar);

    // Fills up cup in relations to minutes
    fill(139, 115, 85);
    rect(offset+barW, offset, barW, minuteBar);

    // Fills up cup in relations to hours
    fill(139, 90, 43);
    rect(offset+2*barW, offset, barW, hourBar);
    
    // Display current time (24-hr time)
    fill(0);
    textAlign(RIGHT);
    text("Current hour: " + H, width-txtOffset, 25);
    text("Current minute: " + M, width-txtOffset, 35);
    text("Current second: " + S, width-txtOffset, 45);

    fill(255);
    textAlign(CENTER);
    text("No more coffee = Day is over! :) ", width/2, height-txtOffset);
}

When I learned that the project for this week was an abstract clock, one of the first ideas I had was to create an hourglass like representation of time using a cup of coffee. I personally love coffee and really enjoy drinking it (it’s not even for the caffeine)! I thought it would be interesting to represent the start of the day as a full cup of coffee and to show that the end of the day occurred when there was no more coffee left (aka the entire cup is white).

As usual, I drew out a picture before starting my project in order to help visualize coordinates of the elements of my coffee cup clock but definitely improvised more than usual along the way.

There were a couple of things I wanted to accomplish with this project but could not figure out. First, I wanted the bars representing the seconds, minutes, and hours to fill up from the top and drain towards the bottom. Secondly, I tried to figure out a way to combine all three elements of a day (the seconds, minutes, and hours) into a singular element to create a more realistic hourglass-like clock, but I was unable to do it.

Nonetheless, I enjoyed this project a lot.

20161007_231159-1