Project 05 Wallpaper

sketch

//Tim Nelson-Pyne
//tnelsonp@andrew.cmu.edu
//Section C
//Project-05-Wallpaper


//controls the spacing of the pattern
var cellSize;
//controls the width of the eyes
var eyeWidth;
//controls the height of the eyes
var eyeHeight;
//controls the x position of the patten elements
var x;
//controls the y position of the pattern elements
var y;

function setup() {
    createCanvas(600, 600);
    background(255);
    cellSize = width / 4
}


//tileA draws everything to do with the eyes

function tileA(x, y, cellSize) {

    eyeHeight = cellSize / 7;
    eyeWidth = cellSize / 4;

    //clown makeup
    
    stroke(248, 24, 148);
    fill(255, 204, 239);
    strokeWeight(4);
    bezier(x + eyeWidth / 4, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + cellSize / 2 - 10);
    bezier(x - eyeWidth / 4, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + eyeHeight + 5, x, y + cellSize / 2 - 10);
    bezier(x + eyeWidth / 4, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - cellSize / 2 + 10);
    bezier(x - eyeWidth / 4, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - eyeHeight - 5, x, y - cellSize / 2 + 10);
    //eye shadow
    for (i = 0; i < 20; i += 1) {
        noFill();
        strokeWeight(.5);
        stroke(248, map(i, 0, 20, 24, 255), map(i, 0, 20, 148, 255));
        ellipse(x, y, eyeWidth + i, eyeHeight + i);
    }

    // eye
    fill(255);
    strokeWeight(3);
    stroke(245, 230, 0);
    ellipse(x, y, eyeWidth, eyeHeight);
    fill(0, 0, 255);
    ellipse(x, y, 20, eyeHeight);
    fill(255);
    noStroke();
    arc(x, y, 20, eyeHeight, radians(220), radians(250))

}

//tileB draws the mouth
function tileB(x, y, cellSize) {
    noFill();
    strokeWeight(5);
    stroke(248, 24, 148);
    arc(x, y, cellSize / 3, cellSize / 10 + 10, radians(0), radians(180));
    arc(x, y, cellSize / 3, cellSize / 10, radians(0), radians(180));
}

//tileC draws the nose
function tileC(x, y, cellSize) {
    fill(248, 24, 148);
    noStroke();
    ellipse(x, y - cellSize / 4, cellSize / 4, cellSize / 4);
    fill(255, 204, 239);
    ellipse(x, y - cellSize / 4, cellSize / 5, cellSize / 5);
}

function draw() {
    for (x = cellSize / 2; x < width; x += cellSize){
        for (y = cellSize / 2; y < height; y += cellSize){
            tileA(x, y, cellSize);
        }
    }
    for (x = cellSize; x < width; x += cellSize){
        for (y = cellSize; y < height; y += cellSize){
            tileB(x, y, cellSize);
            tileC(x, y, cellSize);

        }
    }
    noLoop();

}

I made a clown face wallpaper. The walls have eyes, and they’re clowning you.

Project 04: String Art

sketch

//Tim Nelson-Pyne
//tnelsonp
//Section C

//shape 1
var ax1;
var ay1;
var ax2;
var ay2;

//shape 2
var by1;
var bx1;
var by2;
var bx2;

//shape 3
var cy1;
var cx1;
var cy2;
var cx2;

var numLines = 2;
var angle = 0;

//controls green value
var g = 0;
var gMod = 0;

//controls blue value
var b = 0;
var bMod = 0;

function setup() {
    createCanvas(400, 300);
    background(0);
    
    //shape 1
    ax1 = (100)/numLines;
    ay1 = (0)/numLines;
    ax2 = (100)/numLines;
    ay2 = (0)/numLines;

    //shape 2
    bx1 = (0)/numLines;
    by1 = (0)/numLines;
    bx2 = (0)/numLines;
    by2 = (0)/numLines;

    //shape 3
    cx1 = (100)/numLines;
    cy1 = (0)/numLines;
    cx2 = (0)/numLines;
    cy2 = (0)/numLines;
    
}

function draw() {

    //if you hold down the mouse it makes the canvas rotate around your mouse position
    if (mouseIsPressed == true){
        translate(mouseX, mouseY);
        rotate(radians(angle));
        angle += 1;
    }
    

    //brings green levels up and down based on sin() graph
    //maped between zero and 255
    gMod += 0.01;
    g = sin(gMod);
    g = map(g, -1, 1, 0, 255);

    //brings blue levels up and down based on cos() graph
    //maped between zero and 255
    bMod += 0.01;
    b = cos(bMod);
    b = map(b, -1, 1, 0, 255);


    //set stroke color and weight
    stroke(255, g, b);
    strokeWeight(.25);

    var x1 = min(mouseX, width);
    var y1 = min(mouseY, 246);
    var x2 = 0;
    var y2 = 0;

    //shape 1
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += ax1;
        y1 += ay1;
        x2 += ax2;
        y2 += ay2;
    }


    //green to zero for shape 2
    g = 0;
    stroke(255, g, b);

    var x1 = width;
    var y1 = map(mouseY, 0, height, 250, height);
    var x2 = 0;
    var y2 = map(mouseY, 0, height, 250, height);

    //shape 2
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += bx1;
        y1 += by1;
        x2 += bx2;
        y2 += by2;
    }

    
    //set blue to zero for shape 3 and return green to sin() based value
    b = 0;
    g = sin(gMod);
    g = map(g, -1, 1, 0, 255);
    stroke(255, g, b);

    var x1 = min(mouseX, width);
    var y1 = constrain(mouseY, 150, 246);
    var x2 = width;
    var y2 = 150;

    //shape 3
    for (var i = 0; i <= numLines; i += 1) {
        line(x1, y1, x2, y2);
        x1 += cx1;
        y1 += cy1;
        x2 += cx2;
        y2 += cy2;
    }
    


}

I chose to make some interactive string art. Moving the cursor around changes the drawing and clicking and dragging changes it even more. I also decided to incorporate shifting colors to make the drawing change a bit more over time.

Looking Outwards: 04

ORGANVM PERCEPTVS

By Happy Valley Band

“Organvm Perceptvs” is an album by Happy Valley Band consisting of covers of pop classics. These songs are written by feeding the original songs into a custom built machine learning software that spits them back out in an altered re-written state. The band then plays the music that the software has regurgitated. I think this is a cool example of a collaboration between the AI and the human musicians. The AI doesn’t directly synthesize the sounds, but rather there is a level of human interpretation by playing the music that the AI writes. I also think that the output is wonderfully uncanny. The artificial intelligence remixes the music in a way that I doubt any person would think of doing, giving a complex and novel result. 

https://happyvalleyband.bandcamp.com/

Looking Outwards 3

The Free Universal Construction Kit

by F.A.T. Lab and Sy-Lab

The Free Universal Construction Kit is a set of 3D printable blocks that enable compatibility between ten different popular children’s construction toys. These blocks are not necessarily algorithmically generated, but I think that they are a particularly exciting example of computational fabrication. I think the way that they hijack existing toy systems is brilliant. With a fairly simple set of models this project activates a nearly endless set of new hybrid formal possibilities generated by a network of children at play. I also think it is really interesting how this piece subverts the strictly protected intellectual property of these toy systems. It is super playful, but also opens up an interesting conversation about how intellectual property laws can actually exclude possibilities for creativity rather than supporting it. It also speaks to a radical vision of the future where a robust open source commons combined with publicly accessible digital fabrication technology can provide an alternative means of production to corporate control.

video describing the project

http://fffff.at/free-universal-construction-kit/

Project 3: Dynamic Drawing

For this project I wanted to mess around with 3D geometries. I used the mouse position to change the size, and color of various objects as well as the color and the position of a point light source.

sketch 3

//Tim Nelson-Pyne
//Section C

var diameterA = 5;
var diameterB = 0;

function setup() {
    createCanvas(450, 600, WEBGL);
}

function draw() {
    noStroke();

    //sets the background color and changes it based on mouse position
    background((mouseY/width)*255, 0, 255-(mouseX/width)*255);

    //sets the material for all 3d objects and allows the color to be changed based on mouse position
    specularMaterial(255-(mouseX/width)*255, (mouseY/width)*255, (mouseX/width)*255); 
    ambientLight(255);
    //creates a point light and moves it and changes its color based on mouse position
    pointLight((mouseY/width)*255, 0, 255-(mouseX/width)*255, mouseX, mouseY, mouseY);
    shininess(0);



    //changes the size of the spheres based on mouseX position
    diameterA = 100 * sin(PI *mouseX/450);

    //changes the size of the boxes based on mouseX position
    //also changes the diameter of the torus
    diameterB = 100 * cos(PI *mouseY/600);



    

    



    
    //draws top right sphere and box
    push();
    translate(width/4, height/4);
    sphere(diameterA);
    box(diameterB);
    pop();


    //draws bottom right sphere and box
    push();
    translate(width/4, -height/4);
    sphere(diameterA);
    box(diameterB);
    pop();

    //draws top left sphere and box
    push();
    translate(-width/4, height/4);
    sphere(diameterA);
    box(diameterB);
    pop();

    //draws bottom left sphere and box
    push();
    translate(-width/4, -height/4);
    sphere(diameterA);
    box(diameterB);    
    pop();

    //draws middle sphere and torus
    sphere(diameterA);
    specularMaterial(0,0,(mouseX/width)*255);
    torus(2*diameterB, mouseY/4);


    






    
    

}


function mousePressed() {
    

}

Variable Face

I thought it would be interesting to make a face that would display a range of emotions principally through the eyebrows and mouth. I also included variability in the size of and distance between the eyes as a kind of variable cuteness metric.

proj-02



var eyeSize = 20;      // determines the size of the eyes
var faceWidth = 100;   // determines the height of the face
var faceHeight = 150;  // determines the width of the face
var eyeWidth = 0.25;   // determines spacing between eyes
var browRaise = 20;    // determines eyebrow height above eyes
var mood = 10;         // determines eyebrow slant as well as mouth curvature
var moodMod = 3;       // determines the intensity of the mouth curvature

function setup() {
    createCanvas(300, 300);
}

function draw() {
    background(180);
    strokeWeight(2 * eyeSize);
    stroke(255);
    ellipse(width / 2, height / 2, faceWidth,  faceHeight); // draws head
    strokeWeight(1);
    stroke(0);
    var eyeLX = width / 2 - faceWidth * eyeWidth - eyeSize / 2;
    var eyeRX = width / 2 + faceWidth * eyeWidth + eyeSize / 2;
    fill(0);
    arc(eyeLX, height / 2, eyeSize, eyeSize / 2, 0, 3); //left eye
    arc(eyeRX, height / 2, eyeSize, eyeSize / 2, 0, 3); //right eye
    fill(255);
    arc(eyeLX, height / 2, eyeSize, eyeSize / 2, .5, 1); //left eye highlight
    arc(eyeRX, height / 2, eyeSize, eyeSize / 2, .5, 1); //right eye highlight
    var browAngle = browRaise + mood;
    line(eyeLX - (eyeSize / 2), height / 2 - browRaise, eyeLX + (eyeSize / 2), height / 2 - browAngle); // Draws left eyebrow
    line(eyeRX + (eyeSize / 2), height / 2 - browRaise, eyeRX - (eyeSize / 2), height / 2 - browAngle); // Draws left eyebrow
    var mouthY = (height / 2) + (faceHeight / 4);
    var mouthShape = mouthY + moodMod * mood;
    curve(50, mouthShape, eyeLX, mouthY, eyeRX, mouthY,  width - 50, mouthShape); // draws mouth
    




}


function mousePressed() {
    // when the user clicks, these variables are reassigned
    // to random values within specified ranges. For example,
    // 'faceWidth' gets a random value between 75 and 150.
    faceWidth = random(75, 150);
    faceHeight = random(100, 200);
    eyeSize = random(10, 50);
    eyeWidth = random(.1, .4);
    browRaise = random(10, 30);
    mood = random(-browRaise, browRaise);
    moodMod = random(1, 4);

}

Looking Outwards 02 – Learning to see

“Learning to See” is an ongoing work by Memo Akten. The artist describes this work as using machine learning algorithms to reflect the way that human perception reconstructs the world around us based on our own beliefs and experiences rather than “accurately” representing the world around us. I think this is a really interesting idea for a project and that the “vision” of the machine learning algorithms makes for a powerful metaphor for the aritst to make his point. I also find the real time fluid interation between the image generated by the algorithm and the input objects inspiring. It is a really interesting hybridization of intuitive manual gestures and an algorithmic art making process. I don’t know a whole lot about Generative Adversarial Networks (GAN), which is the type of algorithm being used in this piece. However, I do know that it has to be trained on a database of imagery which determines the sort of images that it creates. We can also asume that there is somewhere within the process a video feed is being fed into the algorithm to allow for the output to be manipulated in real time.

Learning to See (2017-)

Project 1: Self Portrait

project-01

function setup() {
    createCanvas(600, 900);
    background(255);
    text("p5.js vers 0.9.0 test.", 10, 15);
}

function draw() {
    background(2, 3, 200);
    fill(255);
    triangle(400, 650, 475, 850, 325, 850);
    rect(50, 50, 500, 600);
    stroke(0);
    strokeWeight(5);
    noFill();
    triangle(400, 850, 450, 900, 350, 900);
    curve(70, 220, 100, 170, 250, 165,  280, 222);
    curve(270, 222, 300, 165, 450, 170,  480, 220);
    fill(0);
    arc(150, 170, 60, 40, 0, 3);
    arc(350, 170, 60, 40, 0, 3);
    fill(255);
    arc(150, 170, 60, 40, .5, 1);
    arc(350, 170, 60, 40, .5, 1);
    fill(255, 173, 226);
    noStroke();
    ellipse(175, 300, 50, 100);
    ellipse(375, 300, 50, 100);
    fill(250, 160, 210);
    ellipse(175, 300, 40, 40);
    ellipse(375, 300, 40, 40);
    stroke(0);
    strokeWeight(5);
    fill(0);
    curve(200, mouseY/2, 225, 400, 325, 400,  350, mouseY/2);
    noFill();
    curve(70, 100-(mouseY/2), 120, 100, 220, 100,  280, 100+(mouseY/2));
    curve(270, 100+(mouseY/2), 320, 100, 420, 100,  480, 100-(mouseY/2));

}

Tweaking the numbers to get object into the right place on the canvas was pretty tedious and unintuitive at first, but once I had a couple shapes down for reference it got much easier.

LO: Inspiration

Mi.Mu Gloves by Imogen Heap

This project is a set of gloves developed by the musician Imogen Heap that allow her to interact gesturally with her music production software on her computer. The gloves are primarily an interesting piece of hardware, however computation was certainly involved in the process of translating sensor inputs into musical outputs. I think this project is a really interesting way to explore gesture in electronic music, a genre that is typically produced through a very limited set of gestures like turning knobs, and pressing buttons. I think this project is particularly interesting for both its potential to open up new ways of creating music, and the possibility to link performative gestures such as dance to sonic experiences.

Imogen Heap Performing Using the Gloves