Project 10: Sonic Story

For this project, I reintroduce three characters from a cartoon TV show called We Bare Bears. With images I used online, I created a story of the three bears enjoying the company of each other. In the first scene, the Panda is alone and on his phone. Once Grizzly comes into the second scene, the music begins to play with birds chirping in the background. Then for the rest of the story, Ice (polar bear) also joins and has fun with the two other bears by taking selfies.

sketch – Copy
//Rachel Kim
//15-104(Section C)
//rachelki@andrew.cmu.edu
//Project 10


//NOTE
//when submitting to autolab use ideate links
//to test sounds on your own computer put in local server

//images
var grizzlyBearWave;
    var grizzlyX1 = 600;
    var grizzlyY1 = 200;

var polarBear;
    var iceX1 = 600;
    var iceY1 = 200;

var pandaBear;
var phonePanda;
var selfiePanda;

var tree;
var cloud;
    var cloudX = 3.0;
    var cloudX1 = 230;
    var cloudY1 = 50;
    var cloudX2 = 420;
    var cloudY2 = 90;
    var cloudX3 = 20;
    var cloudY3 = 3;

var bird;
    var birdX = 3.0;
    var birdX1 = 200;
    var birdY1 = 80;

//sounds
var morningTune;

//extra
var frameCount = 0;
var grizzlyWalking = true;
var iceGliding = true;



function preload() {
    //images of characters
    pandaBear = loadImage("https://i.imgur.com/QZ4Xc1z.png"); 
    phonePanda = loadImage("https://i.imgur.com/6uzoWNj.png");
    selfiePanda = loadImage("https://i.imgur.com/Nf2uQ1H.png");
    
    grizzlyBearWave = loadImage("https://i.imgur.com/c7NYxSP.png"); 
    posingGrizzly = loadImage("https://i.imgur.com/PEW3RSR.png");

    iceBear = loadImage("https://i.imgur.com/tg3n57a.png"); 
    glidingIce = loadImage("https://i.imgur.com/05dhxMV.png");
    posingIce = loadImage("https://i.imgur.com/MCEiihm.png");


    //images of extras
    tree = loadImage("https://i.imgur.com/cRiGrz5.png");
    cloud = loadImage("https://i.imgur.com/UjxNnu7.png");
    bird = loadImage("https://i.imgur.com/me1Zdik.png");

    //sounds in story for submission
    morningTune = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/morningsong-1.wav");
    
    //sounds in story for self testing --- localserver
    //morningTune = loadSound("sounds/morningsong.wav");
}


function setup() {
    createCanvas(600, 420);
    useSound();
    frameRate(10);
}


function soundSetup() { 
    morningTune.setVolume(0.5);

}


function draw() {
    
    frameCount++;

    switch (frameCount) {
        case 61: morningTune.play(); break; //to start playing song when panda is no longer alone
    }

    //story frames
    //partA
    if (frameCount >= 0 & frameCount < 60) {
        pandaOnPhone();

        //movement of clouds
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

    }

    //partB
    if (frameCount >= 60 & frameCount < 130) {
        grizzlySaysHi();

        //movement of clouds
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

        //grizzly says hi
        if (grizzlyWalking) {
            grizzlyX1 -= 5;
        } else if (grizzlyX1 <= width/2 + 50) {
            grizzlyWalking = false; 
        }

    }


    //partC
    if (frameCount >= 130 & frameCount < 180) {
        selfieTimeA();
        
        //movement of clouds
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

        //movement of bird
        if (birdX > width) {
            birdX = 0;
        }
    }


    //partD
    if (frameCount >= 180 & frameCount < 240) {
        iceBearStares();

        //movement of clouds
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

        //movement of bird
        if (birdX > width) {
            birdX = 0;
        }

    }

    //partE
    if (frameCount >= 240 & frameCount < 410) {
        iceBearJoins();

        //movement of clouds 
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

        //movement of bird
        if (birdX > width) {
            birdX = 0;
        }

        //ice bear joins by gliding
        if (iceGliding) {
            iceX1 -= 5;
        } else if (iceX1 <= 200) {
            iceGliding = false;
        }

    }

    //partF
    if (frameCount >= 410 & frameCount < 460) {
        selfieTimeB();

        //movement of clouds
        if (cloudX1 > width) {
            cloudX1 = 0; 
        } else if (cloudX2 > width) {
            cloudX2 = 0; 
        } else if (cloudX3 > width) {
            cloudX3 = 0;
        }

        //movement of bird
        if (birdX > width) {
            birdX = 0;
        }
              
    }

    if (frameCount >= 460) {
        background("black");
        fill(255);
        textSize(50);
        textFont('Georgia');
        text('The End', 300, 300);
    } 

}


//separate functions for each scene
//PART A
function pandaOnPhone() {
    background(175, 206, 255); 
    sun();  
    grass(); 
    
    clouds();

    image(tree, 5, 5, 350, 350);

    image(phonePanda, 150, 240, 150, 150); 
}

//PART B
function grizzlySaysHi() {
    background(175, 206, 255); 
    sun();  
    grass();

    clouds();

    image(tree, 5, 5, 350, 350);

    image(pandaBear, 150, 200, 150, 230);
    image(grizzlyBearWave, grizzlyX1, grizzlyY1, 150, 200); 
}

//PART C
function selfieTimeA() {
    background(175, 206, 255); 
    sun();  
    grass();

    clouds();
    birdie();

    image(tree, 5, 5, 350, 350);

    image(posingGrizzly, 120, 180, 200, 250);
    image(selfiePanda, 250, 150, 200, 320);
}

//PART D
function iceBearStares() {
    background(175, 206, 255); 
    sun();  
    grass();

    clouds();
    birdie();

    image(tree, 5, 5, 350, 350);

    image(posingGrizzly, 120, 180, 200, 250);
    image(selfiePanda, 250, 150, 200, 320);
    image(iceBear, 550, 200, 85, 130);

}

//PART E
function iceBearJoins() {
    background(175, 206, 255); 
    sun();  
    grass();

    clouds();
    birdie();

    image(tree, 5, 5, 350, 350);

    image(glidingIce, iceX1, iceY1, 170, 150);
    image(posingGrizzly, 120, 180, 200, 250);
    image(selfiePanda, 250, 150, 200, 320);     
}

//PART F
function selfieTimeB() {
    background(175, 206, 255); 
    sun();  
    grass();

    clouds();
    birdie();

    image(tree, 5, 5, 350, 350);

    image(posingIce, 50, 200, 150, 200); 
    image(posingGrizzly, 120, 180, 200, 250);
    image(selfiePanda, 250, 150, 200, 320);    
}



//EXTRA --- "background"
function sun() { //yellow circle in partA
    strokeWeight(1);
    stroke(0);
    fill(255, 242, 147);
    circle(500, 70, 80);
}

function grass() { //green rectangle in partA
    strokeWeight(1);
    stroke(0);
    fill(133, 182, 57);
    rect(0, 250, 600, 170);
}

function clouds() { //clouds in partA
    image(cloud, cloudX1, cloudY1, 150, 80);
    image(cloud, cloudX2, cloudY2, 150, 80);
    image(cloud, cloudX3, cloudY3, 150, 80);
    cloudX1 += cloudX; //speed of clouds
    cloudX2 += cloudX;
    cloudX3 += cloudX;
}

function birdie() { //bird in partA
    image(bird, birdX1, birdY1, 150, 150);
    birdX1 += birdX; //speed of bird
}




Project 10

For my sonic story I wanted to create a looped animation involving a water droplet falling into a pond, fish getting caught by a hook and flung out of the water, and the “fish” returning back into the water in the form of a droplet. Logistically, I couldn’t get the animation to flow the way I intended to, but I used sound to create a sense of mood in an otherwise modern positive color story.

I created storyboards in Illustrator prior to “animating” in p5.js to plan out the scenes. They illustrate what my animation is supposed to communicate.

sketch wordpress

//FISH STORY
/*PREMISE: Water drops into a pond, where ripples form.
            Pans down to swimming fish. 
            A fishing hook descends and a fish takes the bait. 
            The fish is yanked out of the water.
            The animation loops.
            */
//global variables
var x; // translate multipliers
var y; 
var sx = 1; //scale multipliers
var sy =1;

function preload() {
    //sounds downloaded from freesound.org
    drop = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/waterdrop.wav");
    ambience = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/ambience.wav");
    looming = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/looming.wav");
}

function setup() {
    createCanvas(480, 480);
    useSound();
    frameRate(40);
}

function soundSetup() { 
    drop.setVolume();
    ambience.setVolume(1.5);
    looming.setVolume(1.2);
}

function draw() {
    background(247, 242, 223); //cream

    //play sound
    print(frameCount.toString());

    if (frameCount == 50) {
      drop.play();
    } else if (frameCount == 100) {
      ambience.play();
    } else if (frameCount == 180) {
      looming.play();
    } else if (frameCount == 400) {
      looming.stop();
    }

    //animate visual assets
     if (frameCount >=0 & frameCount<50) {// water drops
        waterbody(0,0);
        waterdrop(0,frameCount*2);
    } else if (frameCount >= 50 & frameCount <80) {//ripples form
        waterbody(0,0);
        ripple(0,0);
    } else if (frameCount >= 80 & frameCount <100){
        translate(0, -3* frameCount)
        push();
        waterbody(0,0);
        pop();
        ripple(0,0);
    } else if (frameCount >= 100 & frameCount <250) {//teal fish keeps swimming
        waterbody(0, -260);
        //pink fish
        fill(255, 75, 130);
        fish(-frameCount,0);
        //teal fish
        push();
        fill(28, 158, 175);
        translate(300, 250);
        scale(.6);
        fish(-frameCount, 0);
        pop();
        if (frameCount >= 180 & frameCount <250) {//hook descends
        //waterbody(0, -260);
        //main fish
        fill(255, 75, 130);
        fish(-frameCount,0);
        hook(0, frameCount-200);
        }
    /*} else if (frameCount >= 100 & frameCount <180) {//fishes swim by
    /*} else if (frameCount >= 180 & frameCount <250) {//hook descends
        //waterbody(0, -260);
        //main fish
        fill(255, 75, 130);
        fish(-frameCount,0);

        hook(0, frameCount-200);
        */
    } else if (frameCount >= 250 & frameCount <350) {//hook ascends with fish
        waterbody(0,-260);

        hook(0, 100+(-2* frameCount));

        fill(255, 75, 130);
        fish(0,0);

        //teal fish
        push();
        fill(28, 158, 175);
        translate(300, 250);
        scale(.6);
        fish(-frameCount -100, 0);
        pop();

    }
    //loop animation
    if (frameCount> 400){
        frameCount =0;
    }

}
//draw visual assets

//ABOVE WATER
function waterbody(x,y){
    noStroke();
    //waterbody
        push();
        translate(x,y);
        stroke(255); //white outline
        fill(148, 213, 213); //light teal
        rect(0, 260, width, height);
        pop();
    }
function fullwaterbody(x,y){
    noStroke();
    //waterbody
        push();
        translate(x,y);
        stroke(255); //white outline
        fill(148, 213, 213); //light teal
        rect(0, 0, width, height);
        pop();
    }
function ripple(x, y){
    translate(x,y);
    scale(sx,sy);
    noStroke();
    //ripple1
        push();
        fill(28, 158, 175); //dark teal
        ellipse(width/2, 383, 620, 242);
        pop();
    //ripple2
        push();
        stroke(255);
        fill(255, 75, 130); //pink
        ellipse(width/2, 350, 382, 121);
        pop();
    //ripple3
        push();
        fill(96, 201, 224); //light blue
        ellipse(width/2, 350, 189, 60);
        pop();
    //ripple4 (center)
        push();
        stroke(255);
        fill(247, 242, 223); //cream
        ellipse(width/2, 350, 99, 31);
        pop();
    }
function waterdrop(x,y){
    noStroke();
    //waterdrop
        push();
        translate(x,y);
        fill(255, 75, 130); //pink
        ellipse(width/2, 176, 38);
        triangle(width/2, 135, width/2+16, 166, width/2-16, 166);
}

//UNDER WATER
function hook(x,y){
    //hook
    push();
    translate(x,y);
    noFill();
    stroke(28, 158, 175); //dark teal
    strokeWeight(5);
    strokeCap(SQUARE);
    line(width/2 +20, 92-20, width/2 +20, -300);
    arc(width/2, 92-20, 40, 50, 0, PI, OPEN);
    pop();
}

function fish(x,y){
noStroke();
push();
translate(x,y);
ellipse(width/2, height/2, 38);
triangle(width/2+40, height/2, width/2 +10, height/2 -16, width/2 +10, height/2 +16);
triangle(width/2+40, height/2, width/2 +60, height/2 -10, width/2 +60, height/2 +10); //tail
pop();
}

Project 10: Sonic Story

AnimationHCDownload
//hayoonc
//Hayoon Choi
//Section C

var crash;
var aaah;
var birdSound;
var car;
var oops;
var bg;
var car1;
var cary = -120; var carPlus = 0.2;
var car2;
var car2x = 70; var car2dx = 30;
var person1;
var person1x = 350; var person1y = 305;
var p1x = 0; var p1dx = 30; var p1y = 0; var p1dy = 30; var pr = 0;
var person2;
var p2x = 200; var p2dx = 30; var p2y = 50;
var p2dy = 10; var p2s = 1; var p2ds = 0.02;
var bird;
var birdx = 600; var birddx = -15;
var clouddx = 5; var cloudx = 600;
var count = 0;

function preload(){
    //Sounds
    wind = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/wind-1.wav");
	crash = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/crash.wav");
    aaah = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/aaah.wav");
    birdSound = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bird-1.wav");
    car = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/car-1.wav");
    oops = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/oops.wav");
    //Images
    bg = loadImage("https://i.imgur.com/l8Qc6Md.png?1");
    car1 = loadImage("https://i.imgur.com/5mLAaw5.png?1");
    car2 = loadImage("https://i.imgur.com/bxJJmCI.png?1");
    person1 = loadImage("https://i.imgur.com/LjpJvmr.png?1");
    person2 = loadImage("https://i.imgur.com/FyITsh6.png?1");
    bird = loadImage("https://i.imgur.com/pQXMNIy.png?1");
}

function setup() {
    createCanvas(600, 400);
    useSound();
    imageMode(CENTER);
    frameRate(10);
}

function soundSetup(){
	crash.setVolume(0.5);
    wind.setVolume(0.6);
    car.setVolume(1.4);
    aaah.setVolume(0.6);
}

function draw() {
    background(136, 203, 237); //sky color
    count ++;
    //Animation
    if (count > 0 & count < 80){
        //drawing the image as the background for the first scene
        image(bg, 300, 200, width, height);
    }
    if (count > 0 & count < 45){
        //making cloud move
        cloud(cloudx, 100);
        cloudx = cloudx - clouddx;
        if (cloudx == 400){
            clouddx = 0;
        }
    }
    if (count >= 45 & count < 80){
        //car entering
        cloud(400, 100);
        carScale(300, 200);
    }
    if (count >= 80 & count < 90){
        //car moving in the second scene
        carMove(600, 430);
        image(person1, person1x, person1y, width * 0.8, height * 0.8);
    }
    if (count >= 90 & count < 115){
        //person gets hit
        image(car2, 350, 430, width, height);
        personHit(person1x, person1y);
    }
    if (count >= 115 & count < 170){
        //person gets thrown into the air
        personFly(300, 200);
    }
    if (count >= 170){
        //showing the car again
        image(bg, 300, 200, width, height);
        cloud(400, 100);
        push();
        scale(1.5);
        image(car1, 200, 200, width, height);
        pop();
    }
    if (count > 190 & count <= 240){
        //bird flying
        image(bird, birdx, 0, width * 0.6, height * 0.6);
        birdx += birddx;
    }
    //Sound
    if (count == 1){
        wind.play();
    }
    if (count == 45){
        car.play();
    }
    if (count == 90){
        car.stop();
        crash.play();
    }
    if (count == 110){
        aaah.play();
    }
    if (count == 180){
        oops.play();
    }
    if (count == 190){
        birdSound.play();
    }
}

function cloud(x, y){
    //drawing cloud
    push();
    translate(x, y);
    noStroke();
    fill(255);
    ellipse(0, 0, 60, 40);
    ellipse(40, 0, 70, 50);
    pop();
}

function carScale(x, y){
    //car moving in the first scene
    push();
    translate(x, y);
    scale(carPlus);
    image(car1, 0, cary, width, height);
    pop();
    carPlus += 0.1;
    cary += 9;
}

function carMove(x, y){
    //car moving in the second scene
    push();
    translate(x, y);
    image(car2, car2x, 0, width, height);
    pop();
    car2x -= car2dx;
    if (car2x <= -250){
        car2dx = 0;
    }
}

function personHit(x, y){
    //making the person get hit
    push();
    translate(x, y);
    rotate(radians(pr));
    image(person1, p1x, p1y, width * 0.8, height * 0.8);
    pop();
    p1x -= p1dx;
    p1y -= p1dy;
    pr -= 1;
}

function personFly(x, y){
    //making the person fly
    push();
    translate(x, y);
    rotate(radians(pr));
    scale(p2s);
    image(person2, p2x, p2y, width * 0.8, height * 0.8);
    pop();
    p2x -= p2dx;
    p2y -= p2dy;
    pr -= 15;
    p2s -= p2ds;
    if (p2s <= 0){
        p2ds = 0;
    }
}

For this project, I wanted to include a car. Because I couldn’t find any pictures I that go well with the story, I drew them instead.

Looking Outwards 10: Computer Music

House Party was created by Neil Mendoza for a personal project. It is a musical installation with all of its materials, from furniture to computers, scavenged from trash. Even Arduino Zero, which controls the actuators in the installation, was found in the trash as well. How this works is that each screen is connected to a computer running software written in openFrameworks and the MIDI composition data was sent to Arduino and an OF control program. Then the control program sent the data to other computers over ethernet as OSC. As a result, the control program read the data and triggered the screens and Arduino. When I first saw this project, I was surprised that it didn’t use any greenscreen effect and all the materials were physically present and working. It was even more shocking that all the materials were previously trash. I admire that Neil used his unique artistic sense to create a musical installation that performs in its “natural” habitat.

Project 10 Sonic Story

My process for this project was too make a nature story, I started with a buzzing bee that flies through the screen, a chirping bird that gets sad from not finding any friends, a sun that gives off an angelic sound, and a rising moon that brings out nighttime bugs.

sketch
var bee={x:0,y:100,h:20,w:40,dx:83,r:255,g:255,b:0};
var tree={x:75,y:150,w:25,h:250,lw:155,lh:75,r:210,g:105,b:30,gg:255,z:0};
var robin={x:-5,y:-5,dx:15,dy:28,c:255,z:0,r:212,g:124,b:47,
  rr:48,gg:46,bb:59,r3:105,g3:107,b3:102};
var sun={x:-50,y:200,w:100,dx:50,dy:-28,c:255,z:0}
var moon={x:450,y:200,w:100,dx:-50,dy:-28,c:0,r:203,g:234,b:246,
  c1:20,c2:20,c3:25,c4:40}
    //objects
function setup() {
    createCanvas(400, 400);
    useSound();
    frameRate(1);
}

function preload(){   //preloading the sounds
	buzz=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bee-3.wav");
  chirp=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/birdsound-1.wav");
  ahh=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/sunsound-1.wav");
  moonsounds=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/nightsounds-1.wav");
}

function soundSetup(){    //setting up sounds
  buzz.setVolume(0.25);
  chirp.setVolume(0.75);
  ahh.setVolume(0.8);
  moonsounds.setVolume(0.8);
}

function draw() {
  background(0,155,255);
  if(frameCount>23){    //have the sun rise
    movingsun();
  }
  if(frameCount>23 & frameCount<30){    //story
    text('The sun comes up',250,250);
  }
  if(frameCount==28){   //sun stops
    sun.dx=0;
    sun.dy=0;
  }
  if(frameCount==30){   //sounds plays
    ahh.play();
  }
  if(frameCount>=30 & frameCount<=34){    //story
    text('And shines its light',250,250);
  }
  if(frameCount>34 & frameCount<=38){   //sun sets and story
    sun.dx=50;
    sun.dy=28;
    sun.x+=sun.dx;
    sun.y+=sun.dy;
    text('And then sets',250,250);
  }
  if(frameCount>=39){   //it becomes night time
    background(0);
    movingmoon();
  }
  if(frameCount>=39 & frameCount<43){   //story
    text('The moon rises',250,250);
  }
  if(frameCount>=43 & frameCount<50){   //moon stops and story
    moon.dx=0;
    moon.dy=0;
    moonsounds.play();    //sound plays
    text('And the creatures come out',250,250);
  }
  if(frameCount>50 & frameCount<55){    //moon sets, sound stops and story
    moon.dx=-50;
    moon.dy=28;
    moon.x+=moon.dx;
    moon.y+=moon.dy;
    moonsounds.stop();
    text('The moon then sets',250,250);
  }
  if(frameCount>=55){   //story ends
    text('Goodnight!',250,250);
  }
  bark();   //call tree
  flyingbee();    //call bee
  bird();   //call bird
  print(frameCount);
  if(frameCount>0 & frameCount<=3.1){   //play bee sound
    buzz.play();
  }
  if(frameCount<=8.1){    //story
    text('The bee flew by the tree',250,250);
  }
  if(frameCount>=8){    //brid lands on tree
    robin.dx=0;
    robin.dy=0;
  }
  if(frameCount>9 & frameCount<13){   //bird song
    chirp.play();
  }
  if(frameCount>9 & frameCount<18){   //story
    text('The bird calls for a friend',250,250);
  }
  if(frameCount>18 & frameCount<23){    //bird flies away and story
    robin.dx=15;
    robin.dy=-28;
    robin.x+=robin.dx;
    robin.y+=robin.dy;
    text('He gets sad and leaves',250,250);
  }
}

function flyingbee(){   //bee helper function
  fill(bee.r,bee.g,bee.b);
  ellipse(bee.x,bee.y,bee.w,bee.h);
  stroke(0);
  push();
  strokeWeight(5);
  line(bee.x-5,bee.y-7,bee.x-5,bee.y+7);
  line(bee.x+5,bee.y-7,bee.x+5,bee.y+7);
  pop();
  bee.x+=bee.dx;
}

function bark(){    //tree helper function
  fill(tree.r,tree.g,tree.b);
  rect(tree.x,tree.y,tree.w,tree.h);
  fill(tree.z,tree.gg,tree.z);
  ellipse(tree.x+tree.w/2,tree.y,tree.lw,tree.lh);
}
function bird(){    //bird helper function
  fill(robin.r,robin.g,robin.b);
  circle(robin.x,robin.y,50);
  fill(robin.rr,robin.gg,robin.bb);
  circle(robin.x+25,robin.y-13,25);
  fill(robin.r3,robin.g3,robin.b3);
  triangle(robin.x-35,robin.y-5,robin.x+5,
    robin.y-5,robin.x-25,robin.y+25);
  fill(robin.c,robin.c,robin.z);
  triangle(robin.x+25,robin.y-13,robin.x+30,
    robin.y-13,robin.x+25,robin.y-8);
  robin.x+=robin.dx;
  robin.y+=robin.dy;
}
function movingsun(){   //sun helper function
  fill(sun.c,sun.c,sun.z);
  circle(sun.x,sun.y,sun.w);
  sun.x+=sun.dx;
  sun.y+=sun.dy;
}
function movingmoon(){    //moon helper function
  push();
  fill(moon.r,moon.g,moon.b);    //moon
  circle(moon.x,moon.y,moon.w);
  fill(moon.c);
  circle(moon.x-5,moon.y-5,moon.c1);   //moon craters
  circle(moon.x-30,moon.y+7,moon.c2);
  circle(moon.x+25,moon.y+25,moon.c3);
  circle(moon.x-4,moon.y-20,moon.c4);
  moon.x+=moon.dx;
  moon.y+=moon.dy;
  pop();
}

Looking Outwards 10

Since my looking outwards 04 was about a new musical instrument I decided to focus on computational music for this looking outwards. A piece that I found interesting is called Blue Jeans and Bloody Tears. This piece is a eurovision song sung by Izhar Cohen and produced by Avshalon Ariel. This piece was created using AI that was fed hundred of eurovision songs to give outputs to create a final product and song. I admire this piece because it was able to produce a cool and good song based on an AI algorithm with just other songs inputted. This shows how smart AI is becoming that it is able to create a good catchy song meaning that AI has to potential for even more in the future.

Project 10: BOOOOOO

sketch
//A ghost is floating around, waiting to catch a unknowing passerby by surprise! Wait a bit and BOO!!!! The ghost has caught you ;)
var ghost1;
var ghost2;
var ghost3;
var ghost4;
var ghost5;
var ghost6;
var ghost7;
var ghost8;
var ghost9;
var ghost10;
var ghost11;
var ghost12;
var laughnoise;
var windsound;

function preload() {
    ghost1 = loadImage('https://i.imgur.com/X4dZ0hI.jpg' );
    ghost2 = loadImage('https://i.imgur.com/oEPEO2h.jpg' );
    ghost3 = loadImage('https://i.imgur.com/YdezjuH.jpg' );
    ghost4 = loadImage('https://i.imgur.com/ql1EG2S.jpg' );
    ghost5 = loadImage('https://i.imgur.com/XwlxdCa.jpg' );
    ghost6 = loadImage('https://i.imgur.com/fBUZvTM.jpg' );
    ghost7 = loadImage('https://i.imgur.com/kdNl0ob.jpg');
    ghost8 = loadImage('https://i.imgur.com/ZIooGoA.jpg' );
    ghost9 = loadImage('https://i.imgur.com/c0UNjMv.jpg' );
    ghost10 = loadImage('https://i.imgur.com/IucRj0z.jpg' );
    ghost11 = loadImage('https://i.imgur.com/zmzgLi5.jpg' );
    ghost12 = loadImage('https://i.imgur.com/ZeqmZnM.jpg' );
    laughnoise = loadSound('https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/laughnoise-1.wav');
    windsound = loadSound('https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/spookywind-1.wav');

}

function setup(){
    createCanvas(600, 600);
    frameRate(2);
    useSound();
}

function soundSetup(){
    laughnoise.setVolume(1);
    windsound.setVolume(1);
}

function draw(){
    background(0);
     if(frameCount == 1){
      image(ghost1,0,0);
      windsound.play();
    }
    if(frameCount == 2){
      image(ghost2,0,0);
    }
    if(frameCount == 3){
      image(ghost3,0,0);
    }
    if(frameCount == 4){
      image(ghost4,0,0);
    }
    if(frameCount == 5){
      image(ghost5,0,0);
    }
    if(frameCount == 6){
      image(ghost6,0,0);
    }
    if(frameCount == 7){
      image(ghost7,0,0);
    }
    if(frameCount == 8){
      image(ghost8,0,0);
    }
    if(frameCount == 9){
      image(ghost9,0,0);
      windsound.stop();
      laughnoise.play();
    }
    if(frameCount == 10){
      image(ghost10,0,0);
    }
    if(frameCount == 11){
      image(ghos11,0,0);
    }
    if(frameCount >= 12){
      image(ghost12,0,0);
    }
}

LO: Sonic Computational Art

Game of Skill 2.0 is a piece created by deaf sound artist Christine Sun Kim that explores the relationship between labor and listening. With the use of magnets, velcro strips, and custom electronic pieces driven by a sound/position tracking code, Kim is able to represent the subjectivity in an activity that seems so instinctual and simple for those without hearing disabilities. 

As the computational electronic system produces a radio sound that responds to the players’ direction and speed, Kim’s piece lends another perspective to the world in which we exist. This begs the question, “how much harder do those hard-of-hearing or deaf need to work in order to reap an experience that the hearing community takes for granted?” Through the use of an interactive installation experience, Kim is able to create a space in which everyone has to work just as hard to produce radio noise, all while drawing parallels between a game of skill and a ‘natural’ daily activity. 

Custom electronic radio box.

While exploring Kim’s work and specifically her piece Game of Skill 2.0,  I began to question the ability for us to use computational art and diving into a wide range of mediums and elements in order to transform our artwork into tools to create a more equitable society. Although the coding that goes on behind the scenes may be far more complicated than the actual activity of dragging a stemmed-radio-machine along a velcro strap gives itself to be, it creates opportunity to help offer a range perspectives and open minds in an approachable environment. 

Project-10-Sonic Story

sketch
//Chris Han
//project 10
//section C

// var song;
var groundhog;
var groundhog1;
var groundhog2;
var groundhog3;
var grass;
var cloud;
var dy = 2; 
var y = 270;
var dy1 = 1;
var y1 = 250;
var y2 = 250;
var dy2 = 1;
var y3 = 300;
var dy3 = 2;
var dx = 0; //speed of clouds

function preload(){
	//images
     groundhog = loadImage("https://i.imgur.com/ghMIFqq.png");
     groundhog1 = loadImage("https://i.imgur.com/ghMIFqq.png");
     groundhog2 = loadImage("https://i.imgur.com/ghMIFqq.png");
     groundhog3 = loadImage("https://i.imgur.com/ghMIFqq.png");
     grass = loadImage("https://i.imgur.com/OQ7giMC.png");
     cloud = loadImage("https://i.imgur.com/ZtLcxL9.png");

     //sound
     song = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/clockticksound.wav");
// // }
}

function setup() {
    createCanvas(400,400);
    // useSound();
}

// function soundSetup(){
// 	song.setVolume(0.8);
// }

function draw() {
	noStroke();
	fill(135, 206, 250);
    rect(0,0,400,400);
	fill(210,105,30);
	rect(0,300,400,100);
	groundhog.resize(200,0); //the biggest one
	//movement for the front big groundhog
	if( dy >= 0 & y >= 360){ //the movement for groundhog
		r = random(1, 100);
		if(int(r) == 15){
			dy = -2
		} else {
			dy = 0
		}
	}
	if(dy <= 0 & y <= 270){
		dy = 2
	}
	y += dy;

	//movement for groundhog1 (the middle one)

    if( dy1 >= 0 & y1 >= 300){ //the movement for groundhog1
		r = random(1, 100);
		if(int(r) == 15){
			dy1 = -1
		} else {
			dy1 = 0
		}
	}
	if(dy1 <= 0 & y1 <= 250){
		dy1 = 1
	}
	y1 += dy1;

	//movement for groundhog2 (the back one)
	 if( dy2 >= 0 & y2 >= 300){ //the movement for groundhog1
		r = random(1, 100);
     if(int(r) == 15){
			dy2 = -1
		} else {
			dy2 = 0
		}
	}
	if(dy2 <= 0 & y2 <= 250){
		dy2 = 1
	}
	y2 += dy2;

	//movement for groundhhog3 (the very front one)
     if( dy3 >= 0 & y3 >= 400){ //the movement for groundhog1
		r = random(1, 100);
     if(int(r) == 15){
			dy3 = -1
		} else {
			dy3 = 0
		}
	}
	if(dy3 <= 0 & y3 <= 350){
		dy3 = 1
	}
	y3 += dy3;


    groundhog.resize(200,0); //the biggest one
    image(groundhog2, 160, y2); //furthest back one 
	rect(180,308,90,70);// the rectangle in between back grass and back whacka
	image(grass, 0, 230, 230,100); //furthest back grass

	image(groundhog, 0, y);
	groundhog1.resize(100,0);
    image(groundhog1, 250, y1);//middle groundhog
    rect(260,320,90,50);
    image(grass, 220, 250, 200,100);
	image(grass, -10, 300, 460, 110);
	groundhog2.resize(100,0);
	groundhog3.resize(120,0);
	image(groundhog3, 260, y3); //very front kinda small
	cloud.resize(100,0);

	//clouds moving
	image(cloud, -250 + dx, 40);
	image(cloud, -100 +dx, 100);
	image(cloud, 180 + dx, 40);
	image(cloud, 20 + dx, 30);
	image(cloud, 100 + dx, 100);
	image(cloud, 300 + dx, 100);
	dx += 0.2;

}

My project for this week is a story of different moles popping up and down in a field.

Project-10-Sonic-Story

For this project, I wanted to create a weird but delightful story with many fun little elements. I spent a lot of time thinking about how to make the transition between each scene smooth and fun. One of the solutions I came up with was creating an unexpected interaction between the background and the water in the fish tank.

Basically, my story goes like this:

Cat girl walked into the frame (walking sound). She blowed up her chewing gum (blowing balloon sound) and gradually shrined(venting balloon sound) it down to a size of a fish tank. As the water in the background flowed into the fish tank hat (filling water sound), a goldfish appeared, bubbling(bubble sound).

sketch new
//jiaqiwa2; Jiaqi Wang; Section C
//Story: a cat girl walked into the frame while chewing a gum. 
//She blowed up the gum and shrinked it down to the size of a fish tank.
//water started filling up the tank and a goldfish appeared.
//She enjoyed the goldfish bubbling infront of her eyes.
var CatGirlImage = [];   // an array to store the images
var fish;
var count=0;
var xC=700;
var yoff=0.0;
var yC=5;
var stepC=40;
var fC=0;


var blowing=false;
var diam=5;
var shrink=0;

var arcS=90;
var arcE=90;

var rise=0;
var filling=false;

var fishSX=175;
var fishSY=455;
var fishXoff=0.0;

var secondHalf=false;

//sound file variable
var walkingSound;
var GrowingSound;
var shrinkingSound;
var fillingSound;
var bubbleSound;

 
function preload(){

    var filenames = [];
    filenames[0] = "https://i.imgur.com/Em6d4RR.png";
    filenames[1] = "https://i.imgur.com/lWdTJLj.png";
    filenames[2] = "https://i.imgur.com/sdhFyfz.png";
    filenames[3] = "https://i.imgur.com/HEiFHNA.png";
    filenames[4] = "https://i.imgur.com/bJF8rmQ.png";
    filenames[5] = "https://i.imgur.com/D8MFSK6.png";
 
    for (var i = 0; i<filenames.length; i++) {
        CatGirlImage[i] = loadImage(filenames[i]);
    }
    fish=loadImage("https://i.imgur.com/UzyMgov.png");

   walkingSound=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bubbleSound.wav");
   GrowingSound=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bubbleSound.wav");
   shrinkingSound=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bubbleSound.wav");
   fillingSound=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bubbleSound.wav");
   bubbleSound=loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bubbleSound.wav");
}

function setup() {
    createCanvas(400,600);
    frameRate(10);
    background(144,181,232);
    useSound();

}

function draw() {
	//scale up to the top left area for the second half of the story
	if(secondHalf){
    	scale(1.75,1.75);
	    translate(-20,-40);
	}
    //start dropping water in the background
	if(filling){
		fill(229,147,147);
		rect(0,0,400,min(115,rise*2));
	}
	else{
        fill(144,181,232);
        rect(0,0,400,600);
    }
	
//---------------------------------catGirl walking into the frame and stopped---------------------

	if(count<20){
		catGirlWalking();
	}
    else if(count<303){
    	 catGirlStopped();
    }
   
	
//---------------------------------the gum grows and shrinks to a fish tank----------------------
	gumGrowing(count);
//---------------------------------water filling+ goldfish appears-------------------------------
	waterFilling(count);      
	        
//-----------------------------------bubble popping----------------------------------------------
	bubble(count);

	if(count>=250){
	   noLoop();
	}



   count++;
   print(count);


}  



function mousePressed(){
	print(count);
	
	noLoop();
}

//update the x&y position of the catGirl walking into the frame
function catGirlWalking(){
		//sound
		if(fC==0||fC%3==0){
			walkingSound.play();
		}
		
		//keep the frame of catGirl animation looping
		if(fC%5==0&fC!=0){
		   fC=0;
	    }
	    //keep moving to the left if catGirl does not reach the stopping point
	    if(xC>=50){
		   xC-=stepC;
	    }

	//keep moving up and down to feel more lively
		yoff=yoff+0.01;
		if(fC%3==0){
        	yC+= noise(yoff);
		}
		else if(yC>0){
			yC-= noise(yoff);
		}
		//draw the catGirl
   		image(CatGirlImage[fC],xC,yC,400,600);
   		fC++;
}
function catGirlStopped(){
	//keep the frame of catGirl animation looping
		if(fC%5==0&fC!=0){
		   fC=0;
	    }
	    //keep moving up and down to feel more lively
		yoff=yoff+0.01;
		if(fC%3==0){
        	yC+= noise(yoff);
		}
		else if(yC>0){
			yC-= noise(yoff);
		}
		image(CatGirlImage[fC],0,yC,400,600);
   		fC++;

}

function gumGrowing(count){
	//gum growing bigger
	if(count>=20&count<45){
	   	fill(229,147,147,170);
	   	noStroke();
	   	diam+=count;
	    ellipse(200,380,diam,diam);
	    if(count%3==0){
	    	GrowingSound.play();
	    }


	}
	
	if(count>=45){
		shrink++;
	    fill(229,147,147,170);
	    if(count==49){
			
			shrinkingSound.play();
		}
		 //if size of gum gets down to 500, stop changing
	    if(diam-shrink*15<510&shrink>10){
	        ellipse(250,240,460,460);
				
	    }
	    else{
	        ellipse(250,240,diam-shrink*15);
	    }
	}

}

function waterFilling(count){
	if(count>=75){
		if(count==75){
	    	fillingSound.play();
	    }

		filling=true;
		rise+=1.08;
		fill(144,181,232,130);
	    arcS-=rise*0.1;
	    arcE+=rise*0.1;
	    
	    //fish appears
	    if(count>100){

	        	image(fish,fishSX-100*(noise(fishXoff)),max(110,fishSY-rise*3),min(100,40+(rise*0.8)),min(150, 60+(rise*1.2)));
	    }
	    if(count<130){
	        	arc(250,240,460,460,radians(arcS),radians(arcE), OPEN);
	    }
	    else{
	        	arc(250,240,460,460,-1.0471975511965976 +random(-0.003,0.0003),4.1887902047863905+random(-0.003,0.0003), OPEN);
	    }
	    fishXoff+=0.04;
	}

}

function bubble(count){
	   if(count>=160){
	   	    secondHalf=true;
	   		
	   	if(count%24==0){
	   		bubbleSound.play();
	   	}
	   	fill(144,219,232,220);
	   	//generating bubbles
	   	for(var i=0;i<5;i++){
	   		ellipse(fishSX-100*(noise(fishXoff))+random(30+i),max(110,fishSY-rise*3)-random(40+i),random(10-i));
	   		ellipse(fishSX-100*(noise(fishXoff))+random(5+i),max(110,fishSY-rise*3)+random(40+i),random(20-i));
	   	}


	   }
}
Sketching characters
Storyboard sketch