Project 10: Sonic Story

sketch
//Jessie Chen
//D
//Project 10
//Sonic Story

//Description: A girl in her room, 
//whistling and playing guitar as the wind howls. 
//Rain follows after the wind, darkening the room and the sky. 


var windows = [];
var girl = [];
var animation = 0;
var wind;
var guitar;
var whistle;
var rain;

function preload() {
    //load window animation
    var windowFrames = [];
    windowFrames[0] = "https://i.imgur.com/znUBSxa.png";
    windowFrames[1] = "https://i.imgur.com/znUBSxa.png";
    windowFrames[2] = "https://i.imgur.com/6CCPRvu.png";
    windowFrames[3] = "https://i.imgur.com/6CCPRvu.png";
    windowFrames[4] = "https://i.imgur.com/WL8WfFv.png";
    windowFrames[5] = "https://i.imgur.com/WL8WfFv.png";
    windowFrames[6] = "https://i.imgur.com/WL8WfFv.png";
    windowFrames[7] = "https://i.imgur.com/6CCPRvu.png";
    windowFrames[8] = "https://i.imgur.com/6CCPRvu.png";
    windowFrames[9] = "https://i.imgur.com/znUBSxa.png";
    windowFrames[10] = "https://i.imgur.com/znUBSxa.png";

    for (var i = 0; i < windowFrames.length; i++) {
        windows[i] = loadImage(windowFrames[i]);
    }

    //load girl animation
    var girlFrames = [];
    girlFrames[0] = "https://i.imgur.com/cJf8oUc.png";
    girlFrames[1] = "https://i.imgur.com/StszbDY.png";
    girlFrames[2] = "https://i.imgur.com/1AHGiCS.png";
    girlFrames[3] = "https://i.imgur.com/BB829DI.png";
    girlFrames[4] = "https://i.imgur.com/6T6wsTS.png";
    girlFrames[5] = "https://i.imgur.com/KQz7nSy.png";
    girlFrames[6] = "https://i.imgur.com/BF26KsD.png";
    girlFrames[7] = "https://i.imgur.com/YGI1D50.png";
    girlFrames[8] = "https://i.imgur.com/GzWvcdv.png";
    girlFrames[9] = "https://i.imgur.com/LADpf8C.png";

    for (var i = 0; i < girlFrames.length; i++) {
        girl[i] = loadImage(girlFrames[i]);
    }

    //load sounds
    wind = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/wind.wav");
    rain = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/rain-2.wav");
    whistle = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/whistle.wav");
    guitar = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/guitar-1.wav");
}


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


function soundSetup() {
    wind.setVolume(0.25);
    rain.setVolume(1.5);
}


function draw() {
    //sets background to light peach
    background(212, 187, 168);
    //background becomes darker as rain starts
    if (animation >= 50) {
        background(148, 139, 132);
    }

    //dots in the background
    circles();

    //color of the sky
    sky();

    //wind and rain animation and sound
    windNrain();

    //girl whistling and guitar
    playingguitar();

    animation ++;

    //stop animation when sounds end
    if(frameCount === 145) {
        noLoop();
    }
 }

function windNrain() {
    image(windows[animation%windows.length], 275, 175, 320, 350);
    //plays wind at the beginning
    if (animation == 0) {
        wind.play();
    //after wind, comes the rain
    } else if (animation == 50) {
        rain.play();
    }
}

 function playingguitar() {
    frameRate(4);
    image(girl[animation%girl.length], 150, 250, 300, 290);
    //girl is whistling
    if (animation == 1) {
        whistle.play();
    //after whistling, she starts singing and playing guitar
    } else if (animation == 6) {
        guitar.play();
    }
 }

 function sky() {
    noStroke();
    fill(153, 165, 166);
    //sky darkens with rain
    if (animation >= 50) {
        fill(85, 90, 95);
    }
    //constrain inside the window
    rect(230, 55, 100, 170);
 }

 function circles() {
    for (var x = 0; x <= width; x += 20) {
        for (var y = 0; y<= height; y += 20) {
            noStroke();
            fill(242, 220, 203, 120);
            ellipse(x, y, 10, 10);
        }
    }
}

 

I wanted to make a girl strumming a guitar so I drew frames for the animation using Procreate. I also made a separate animation for the window, to add extra sounds to the project (the wind and the rain). All the sounds I used were found on freesound.org (including the guitar.) Also, as the rain starts, the sky and the room darken.

Screenshot before the rain
Screenshot during the rain

LO 10

EMMY
Composer: David Cope

“EMMY” is a program developed by David Cope, a classical composer with a deep interest in the role which computers and AI can play in music. His experiments in music intelligence allowed him to create EMMY, a program which can be fed examples of work from specific musicians and composers and in turn produce new pieces based on the characteristics of the music it studies. I find it fascinating that EMMY is able to break down and learn aspects of what makes a specific composer’s work unique and recreate it in a way that is not necessarily copying, but familiar and new. Moreover, Cope theorized that “what made a composer properly understandable, properly “affecting”, was in part the fact of mortality.” Interestingly, this led him to unplug EMMY in 2004, after it had produced over 11,000 pieces.

A Bach-Style Chorale written by EMMY

Project 10 – Sonic Story

My story is a little western horse racing film. In the first scene, the gun goes off. Then the horses start galloping as the crowd cheers.

Sonic Story – Maggie
//Maggie Ma
//Section D
//Sonic Story

//STORYLINE: a little western horseracing film. 
//In the first scene, the start gun goes off.
//Then, the horses start galloping.
//Finally, the crowd cheers.

var horseImage = [];   // an array to store the images
var horse = []; //array to hold horse

//frame counter 
var frameCount = 0;

//crowd image
var crowd;

//gun image
var gun;

//race gun x position
var gunX = -200;

//horse background of first scene
var horsebg; 

//crowd scene zoom in and out
var zoomx = 0; 
var zoomy = 0;

//sounds
var neigh;
var shot;
var gallop;
var crowdcheer;

function preload(){

    neigh = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/neigh.wav");
    shot = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/gunshot-1.wav");
    gallop = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/gallop-1.wav");
    crowdcheer = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/crowd.wav");
    
    //horse running image files
    var filenames = [];
    filenames[11] = "https://i.imgur.com/Kpc8OBb.gif";
    filenames[10] = "https://i.imgur.com/G6TaUvT.gifg";
    filenames[9] = "https://i.imgur.com/lbhzzYr.gif";
    filenames[8] = "https://i.imgur.com/wuAUUaw.gif";
    filenames[7] = "https://i.imgur.com/083HFuW.gif";
    filenames[6] = "https://i.imgur.com/VpQvDCP.gif";
    filenames[5] = "https://i.imgur.com/4G68Ubf.gif";
    filenames[4] = "https://i.imgur.com/hE8DQXc.gif";
    filenames[3] = "https://i.imgur.com/6WcJ0gS.gif";
    filenames[2] = "https://i.imgur.com/T1Xwkkj.gif";
    filenames[1] = "https://i.imgur.com/2PDeXWh.gif";
    filenames[0] = "https://i.imgur.com/shnBbse.gif";

    crowd = loadImage('https://i.imgur.com/9tu2YoL.jpg');
    gun = loadImage('https://i.imgur.com/lmEa4Kh.png');
    horsebg = loadImage('https://i.imgur.com/Q9r6TGv.png');

 
    for (var i = 0; i < filenames.length; i++) {
        horseImage[i] = loadImage(filenames[i]);
    }
}

function stepCharacter() { //update function
    this.imageNumber+=1;

    //reset image cycle when reach the end of array
    if (this.imageNumber>11) {
        this.imageNumber =0; 
    }
}

function drawCharacter() {
    //making the dude walk
    image(horseImage[this.imageNumber], this.x, this.y);
}

function makeCharacter(wx, wy, wdx, wdy) { //character constructer
    w = {
        x: wx,
        y: wy, 
        dx: wdx,
        dy: wdy, 
        imageNumber: 0,
        stepFunction: stepCharacter,
        drawFunction: drawCharacter
        }
    return w;
}

function setup() {
    createCanvas(480, 350);
    useSound();
    imageMode(CENTER);
    for (var i=0; i<1; i++) { 
        var w = makeCharacter(240,170,0,0);
        horse.push(w); 
    }
    frameRate(10);
}

function soundSetup () {
    neigh.setVolume(0.8);
    shot.setVolume(0.5);
}
function draw() {
    background(255);

    frameCount++;
    if (frameCount >= 0& frameCount < 160) { //race gun goes off scene
        image(horsebg, 240, 196, width, height); //background
        image(gun, 200 + gunX, height-250, width, height); //gun image
        if (frameCount >= 0 & frameCount < 70){ 
            gunX += 7; //gun slides in
        } else if (frameCount >= 90 & frameCount <160) {
            gunX -=12; //gun slides out
        } 
    }
   
    else if (frameCount >=100 & frameCount <300) { //horse galloping scene
        for (var i=0; i<1; i++) { //three people walking
            var w = horse[i];
            push();
            w.stepFunction();
            w.drawFunction();
            pop();
        }

    } else if (frameCount >=300 & frameCount < 400) { //crowd cheering scene
        image(crowd, 240, 196, width + zoomx, height + zoomy);
        zoomx +=3; //zoom in x
        zoomy += 3; //zoom in y 

    } else if (frameCount >= 400 & frameCount <450) { //end scene
        background(0);
        fill(255);
        textFont('Courier New Italic')
        textSize(16);
        text('the great race.', width-200, height-75);
    
    }else if (frameCount >= 450) {
        background(0);
        noLoop();
    }

    //sound play
    if (frameCount == 88) {
        shot.play();
    } else if (frameCount == 130){
        gallop.play();
    } else if (frameCount == 200){
        neigh.play();
    } else if (frameCount == 270) {
        crowdcheer.play();
    } else if (frameCount > 400) {
        crowdcheer.stop();
    }
}   

Project 10 – Sonic Story + Media Files

For my sonic story, I made an animation of a series of animals chasing each other. I first started with a gif of a dog running, then split it into several frames to animate. I then decided to make it get chased by a bee (also a gif), then have the dog chase a cat who chases a mouse. The full frame is too long to display here, but this is a screenshot of what it looks like when all four characters are in frame:

sonic story
// STORYLINE: A bee chasing a dog chasing a cat chasing a mouse.



var dogWalk = [];   // an array to store the images of a dog walking
var beeFly = []; // array to store images of bee flying
var catRun = []; // images of cat running
var mouse;
var mx = 920; // x position of mouse
var fence;
var barking;
var buzz;
var meow;
var squeak;




function preload(){

    // images of dog walking
    var dogs = [];
    dogs[0] = "https://i.imgur.com/Obg7kQd.gif";
    dogs[1] = "https://i.imgur.com/vUkgpet.gif";
    dogs[2] = "https://i.imgur.com/jvjCknz.gif";
    dogs[3] = "https://i.imgur.com/yFxMHG1.gif";
    dogs[4] = "https://i.imgur.com/oPxOfcq.gif";
    dogs[5] = "https://i.imgur.com/i0WRXiO.gif";
    dogs[6] = "https://i.imgur.com/338YDhl.gif";
    dogs[7] = "https://i.imgur.com/W62WgdJ.gif";
    dogs[8] = "https://i.imgur.com/2GhHX5W.gif";
    dogs[9] = "https://i.imgur.com/VgfCha4.gif";
    dogs[10] = "https://i.imgur.com/MbUowkT.gif";
    dogs[11] = "https://i.imgur.com/CnQCi0T.gif";
    dogs[12] = "https://i.imgur.com/rWgGUWm.gif";
    dogs[13] = "https://i.imgur.com/WPaT5V0.gif";
    dogs[14] = "https://i.imgur.com/y8qx8WE.gif";
    dogs[15] = "https://i.imgur.com/Vp1xVPc.gif";

    for (var i = 0; i < dogs.length; i++) {
        dogWalk[i] = loadImage(dogs[i]);
    }

    //images of bee flying
    var bees = [];
    bees[0] = "https://i.imgur.com/4850hmR.gif";
    bees[1] = "https://i.imgur.com/0FMGyos.gif";
    bees[2] = "https://i.imgur.com/7CozqZ5.gif";
    bees[3] = "https://i.imgur.com/J6e0HBK.gif";
    bees[4] = "https://i.imgur.com/uexlFJE.gif";
    bees[5] = "https://i.imgur.com/intd8Rx.gif";
    bees[6] = "https://i.imgur.com/l3ZVHzT.gif";
    bees[7] = "https://i.imgur.com/NNG3lnb.gif";
    bees[8] = "https://i.imgur.com/wYl8pHt.gif";
    bees[9] = "https://i.imgur.com/CM53Kch.gif";
    bees[10] = "https://i.imgur.com/Tt90vYh.gif";
    bees[11] = "https://i.imgur.com/MTQRrrG.gif";
    bees[12] = "https://i.imgur.com/8S7d588.gif";
    bees[13] = "https://i.imgur.com/tO9HTc5.gif";
    bees[14] = "https://i.imgur.com/KtbttF1.gif";
    

    for (var i = 0; i < bees.length; i++) {
        beeFly[i] = loadImage(bees[i]);
    }

    //images of the cat
    var cats = [];
    cats[0] = "https://i.imgur.com/ZWzbhxI.gif";
    cats[1] = "https://i.imgur.com/GaD7QU7.gif";
    cats[2] = "https://i.imgur.com/i6pEZq8.gif";
    cats[3] = "https://i.imgur.com/ljdWpB9.gif";
    cats[4] = "https://i.imgur.com/3dpfves.gif";
    cats[5] = "https://i.imgur.com/r0rgZRT.gif";
    cats[6] = "https://i.imgur.com/810gnOd.gif";
    cats[7] = "https://i.imgur.com/36qZ7mv.gif";
    cats[8] = "https://i.imgur.com/DPO7GIs.gif";
    cats[9] = "https://i.imgur.com/r9pxkAW.gif";
    cats[10] = "https://i.imgur.com/BNjV3y7.gif";
    cats[11] = "https://i.imgur.com/GOJmcoi.gif";

        for (var i = 0; i < cats.length; i++) {
        catRun[i] = loadImage(cats[i]);
    }
    
    mouse = loadImage("https://i.imgur.com/293UbtW.png");

    fence = loadImage ("https://i.imgur.com/N9jB1Hh.png");

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

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

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

    squeak = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/squeak.wav");
}
    
function soundSetup(){
    //barking.setVolume(0.75);
    buzz.setVolume(15);
    meow.setVolume(0.4);
    //squeak.setVolume(1);
}

//updates walking dog for next frame
function stepDog(){
    this.imageNumber++;

    //cycles through the 16 images
    if (this.imageNumber>15){
        this.imageNumber=0;
    }
}

//updates flying bee for next frame
function stepBee(){
    this.imageNumber++;

    // cycles through 15 images
    if (this.imageNumber>14){
        this.imageNumber = 0;
    }  
}

//updates cat for next frame
function stepCat(){
    this.imageNumber++;

    // cycles through 12 images
    if (this.imageNumber>11){
        this.imageNumber = 0;
    }  
}


//draws walking dog
function drawDog(){ image(dogWalk[this.imageNumber], this.x, this.y, 200, 110); }

// draws flying bee
function drawBee() { 
    push();
    scale(-1, 1);
    image(beeFly[this.imageNumber], this.x, this.y, 50, 50)
    pop();
}

// draws cat
function drawCat() { 
    push();
    scale(-1, 1);
    image(catRun[this.imageNumber], this.x, this.y, 80, 80)
    pop();
}


//constructor that creates and returns an object representing a dog
function makeDog(cx, cy){
    c = {x: cx, y: cy,
        dx: 8, 
        imageNumber:0,
        stepFunction: stepDog,
        drawFunction: drawDog}
    return c;
}

//constructor that creates and returns an object for a bee
function makeBee(bx, by){
    b = {x: bx, y: by,
        dx: 7,
        imageNumber: 0,
        stepFunction: stepBee,
        drawFunction: drawBee}
    return b;
}

//constructor that creates and returns an object for a cat
function makeCat(ax, ay){
    a = {x: ax, y: ay,
        dx: 9,
        imageNumber: 0,
        stepFunction: stepCat,
        drawFunction: drawCat}
    return a;
}


//empty array for dog
var dog=[];

//empty array for bee
var bee = [];

//empty array for cat
var cat = [];


function setup(){
    createCanvas(800, 100);
    imageMode(CENTER);

    for (var i = 0; i < 1; i++) {
        // make a dog
        var c = makeDog(1100, i+60);
        // push the dog onto dog array
        dog.push(c);

        var b = makeBee(-1200, i+50);
        bee.push(b);

        var a = makeCat(-1000, i+70);
        cat.push(a);
    }
    useSound();
    frameRate(8);
}

function draw(){
    background(201, 74, 88);

    //barking sound
    if (frameCount == 65 || frameCount == 75) {
        barking.play(); 
    } 

    // buzzing sound
    if (frameCount == 80 || frameCount == 90){
        buzz.play();
    }

    // meow
    if (frameCount == 40 || frameCount == 50){
        meow.play();
    }

    //squeak
    if (frameCount == 20 || frameCount == 30){
        squeak.play();
    }
    

    if (0 < frameCount < 100){
        for (var i = 0; i < 1; i++) { // for the dog
            var c = dog[i];
            c.stepFunction();
            c.drawFunction();
            //moves dog to the left
            dog[i].x-=dog[i].dx;
        }
    }
    

    if (0 < frameCount < 100){
        for (var i = 0; i < 1; i++) { // for the bee
            var b = bee[i];
            b.stepFunction();
            b.drawFunction();
            //moves bee to the left
            bee[i].x+=bee[i].dx;
        }
    }

    if (0 < frameCount < 100){
        for (var i = 0; i < 1; i++) { // for the cat
            var a = cat[i];
            a.stepFunction();
            a.drawFunction();
            //moves cat to the left
            cat[i].x += cat[i].dx;
        }
    }

    image(mouse, mx, 75, 45, 30);
    image(fence, 700, 100, 200, 70);

    mx -= 10

}

function mousePressed (){
    frameCount = 0;
}

Project 10: Sonic Sketch

For my project, I wanted to create a composition based on an illustration idea I had, so I created an illustration first in Illustrator and then exported the layers as images. In my project, I was able to practice using images and sound together and ended up using 7 images and 5 sounds total (meow, car, bicycle, wind, chirping). I wanted to make part of the sketch interactive, so I made the sun follow the user’s mouse. My story is as follows:

It is fall and the sun is setting. A cat sits on the windowsill and meows, watching the traffic outside. A car passes by, then a bicycle. The wind blows and leaves rustle. Birds chirp in the distance.

Illustrator drawing
sketch-cb
//Storyline: A cat sits on the windowsill and meows, watching
//traffic outside. A car passes by, then a bicycle. It is late
//fall and the sun is setting. Birds chirp in the distance.

//images
var cat;
var wind;
var leaf;
var bike;
var car;
var bird;
var mountains;

//sounds
var meow;
var engine;
var spinning;
var windblows;
var chirping;

//moving distances
var dx = 0;
var dy = 0;

function preload() {
    //loads images
    cat = loadImage("https://i.imgur.com/4Jqrrll.png");
    wind = loadImage("https://i.imgur.com/jYEWld7.png");
    leaf = loadImage("https://i.imgur.com/1rd8ozl.png");
    bike = loadImage("https://i.imgur.com/u3DeUeL.png");
    car = loadImage("https://i.imgur.com/4F1DaeZ.png");
    bird = loadImage("https://i.imgur.com/aEcelIZ.png");
    mountains = loadImage("https://i.imgur.com/kdIC817.png");

    //loads sounds
    meow = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/meow.wav");
    engine = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/engine.wav");
    spinning = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/spinning.wav");
    windblows = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/windblows.wav");
    chirping = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/chirping.wav");
}

function setup() {
    createCanvas(400, 400);
    frameRate(1);
    useSound();
    cat.loadPixels();
    wind.loadPixels();
    leaf.loadPixels();
    bike.loadPixels();
    car.loadPixels();
    bird.loadPixels();
    mountains.loadPixels();
}

function soundSetup() { 
    //setup for audio generation
    meow.setVolume(1);
    engine.setVolume(0.2);
    spinning.setVolume(0.5);
    windblows.setVolume(0.5);
    chirping.setVolume(0.75);
}

function draw() {
    background(204, 121, 84);

    //plays sounds at correct times
    switch (frameCount) {
        case 4: meow.play(); break;
        case 7: engine.play(); break;
        case 12: spinning.play(); break;
        case 18: windblows.play(); break;
        case 23: chirping.play(); break;
    }
    
    //sky
    noStroke();
    fill(151, 166, 221);
    ellipse(200, 180, 287);
    
    //sun and mountains
    fill(242, 113, 73);
    ellipse(mouseX, mouseY, 60);
    image(mountains, 57, 194);

    //car drives by
    if (frameCount >= 6 & frameCount < 13) {
        image(car, 240-dx, 235);
        dx+=25;
    }
    //bicycle passes by
    if (frameCount >= 11 & frameCount < 20) {
        image(bike, 15+dx, 240);
        dx+=30;
    }
    //wind blows leaves
    if (frameCount >= 17 & frameCount < 22) {
        image(leaf, 80, 80+dy);
        image(leaf, 280, 200+dy);
        dy+=40;
    }
    //birds fly in distance
    if (frameCount >= 23 & frameCount < 27) {
        image(bird, 216, 187);
        image(bird, 230, 175);
        image(bird, 232, 150);
        image(bird, 150, 155);
    }

    //window and cat
    image(wind, 0, 0);
    image(cat, 80, 230);
}

Project 10-Sonic Story

My sonic story about the election goes as follows:

Biden and Trump meet at the white house. Trump debates biden by saying ‘Wrong’ repeatedly while smiling. Biden then bonks Trump on the head with the great state of Pennsylvania, winning him the election. Trump’s defeat music plays as he frowns and Biden smiles. Trump leaves the white house and Biden dances to his victory music.

Sounds- Wrong, Bonk (hitting on head), Bass(Trump defeat sound), winSound(Biden’s victory song)

sketch

//trump and biden meet, trump debates biden by saying wrong repeatedly while smiling, then biden bonks trump with a democratic pennsylvania, winning the election. Trump then frowns and his panic music plays, he then leaves and biden does a dance to victory music.
//sounds
var bonk;
var winSound;
var bass;
var wrong;

function preload(){
    bonk = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/bonk-1.wav");
    winSound = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/Wide-1.wav");
    bass = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/Bass-1.wav");
    wrong = loadSound("https://courses.ideate.cmu.edu/15-104/f2020/wp-content/uploads/2020/11/Wrong-1.wav");
}

function setup() {
    createCanvas(400, 400);
    useSound();
    frameRate(1);
    imageMode(CENTER);
    rectMode(CENTER);
    noStroke();
}
function soundSetup() { 
    winSound.setVolume(0.5);
}
var trumpPos=0;
var bidenPos=400;
var armrot=12;
function draw() {
    translate(200,200);
    //biden and trump slide in
    if(frameCount<8){
        drawWH();
        trumpPos+=16;
        bidenPos-=16;
        push();
        translate(trumpPos-200,0);
        drawTrump(true);
        pop();
        push();
        translate(bidenPos-200,0);
        drawBiden(false);
        pop();
    }
    //trump wrong sound
    if(frameCount==7||frameCount==8||frameCount==9){
        wrong.play();
    }
    //biden arm appears and swings
    if(frameCount>=9&frameCount<11){
        armrot-=0.2;
        drawWH();
        push();
        translate(trumpPos-200,0);
        drawTrump(true);
        pop();
        push();
        translate(80,80);
        rotate(armrot);
        drawPenn();
        pop();
        push();
        translate(bidenPos-200,0);
        drawBiden(false);
        pop();
    }
    //bonk sound effect
    if(frameCount==12){
        bonk.play();
    }
    //trump mad
    if(frameCount==13){
        drawWH();
        push();
        translate(trumpPos-200,0);
        drawTrump(false);
        pop();
        push();
        translate(80,80);
        rotate(armrot);
        drawPenn();
        pop();
        push();
        translate(bidenPos-200,0);
        drawBiden(true);
        pop();
    }
    //bass sound
    if(frameCount==14){
        bass.play();
    }
    //trump exit, biden slide
    if(frameCount>14&frameCount<19){
        drawWH();
        trumpPos-=55;
        bidenPos-=27;
        push();
        translate(trumpPos-200,0);
        drawTrump(false);
        pop();
        push();
        translate(bidenPos-200,0);
        drawBiden(true);
        pop();
    }
    //win song plays
    if(frameCount==20){
        winSound.play();
    }
    //biden wiggle
    if(frameCount>20&frameCount<25){
        drawWH();
        push();
        var rot=random(-0.3,0.6);
        rotate(rot);
        translate(bidenPos-200,0);
        drawBiden(true);
        pop();
    }
    if(frameCount==25){
        background(0);
        noLoop();
    }
}

function drawTrump(happy){
    //red suit
    fill(170,27,27);
    rect(0,200,150,400);
    //head and ears
    fill(255,173,101);
    ellipse(0,0,100,90);
    ellipse(50,0,20,40);
    ellipse(-50,0,20,40);
    //hair
    fill(255,220,88);
    ellipse(0,-35,100,50);
    fill(0);
    //smiley face
    if(happy){
        arc(0,10,40,20,0,PI,CHORD);
    }
    //sad face
    else{
        arc(0,10,40,20,PI,0,CHORD);

    }
}

function drawBiden(happy){
    //blue suit
    fill(47,62,140);
    rect(0,230,100,400);
    //hair
    fill(255);
    ellipse(0,-25,70,60);
    //head and ears
    fill(214,169,140);
    ellipse(0,0,80,100);
    ellipse(40,0,10,20);
    ellipse(-40,0,10,20);
    fill(0);
    //smiley face
    if(happy){
        arc(0,10,40,20,0,PI,CHORD);
    }
    //sad face
    else{
        arc(0,10,40,20,PI,0,CHORD);
    }
}

function drawPenn(){
    //arm
    fill(47,62,140);
    rect(0,-45,30,90);
    //hand
    fill(214,169,140);
    ellipse(0,-95,40,40);
    //state
    fill(47,62,140);
    rect(0,-160,60,120);

}

function drawWH(){
    background(82,198,205);
    //grass
    fill(53,123,42);
    rect(0,50,400,300);
    //main house
    fill(255);
    rect(0,-120,100,40);
    //tip
    triangle(0,-150, -20,-140,20,-140);
    //inside
    fill(230);
    rect(0,-118,40,32);
}

LookingOutwards-10

The project that I’m discussing is “Travis Bott” by the creative agency space150. The project uses artificial intelligence and machine learning to create a completely generated song that sounds as if it was created and performed by the american hip hop artist Travis Scott (hence the name “Travis Bott”). They had different teams that analyzed the music separately, breaking it down into beats, melodies, lyrics, and more. As the algorithm learned likely sequences and patterns in note and lyrical structure, they could then guide it in reconstructing a completely new song. Not only did they have to reconstruct the instrumental and lyrics, but Travis Scott’s vocal information was reconstructed as well. In some ways, Travis’ artistic sensibilities are the main focus here as anything that the algorithm was produced from his content and influence, but the packaging of the final song and video had some input from the studio behind it.

Travis Bott (2020)
https://www.space150.com/work/v45-travisbott
Feb 2020 by space150

LO – 10 Computational Music

Endel by Oleg Stavitsky

Endel (CEO and co-founder Oleg Stavitsky) is a generative music app that creates sound based on the user’s environment. The app pulls data from the user’s phone including the weather, heart rate, physical activity rate, GPS location, and circadian rhythms to create personalized soundscapes (ex. Gentle music for sleeping, studying, and relaxing) by adjusting the sonic output to match user activity. It can siphon heart-rate from your smartwatch and create a beat to match your pulse and footsteps. I think this app is extremely powerful in that it has been used to aid in ADHD, insomnia, and tinnitus by curating relaxing and peaceful personalized music. It never creates two compositions that sound the same—I almost want to download it and try the app out myself!

Review: Endel – an app for fine-tuning your mind - TapSmart
Endel App - Personalized sounds | UI Sources

Project 10 – Sonic Story

For my project, I created a story of Santa Clause delivering presents and running into a penguin. Now that Halloween is over, it is Christmas time.

I used Illustrator to create vector drawings correlating to the canvas size.

sketch
//general story
//Santa Clause was delivering presents when he ran into a penguin
let snowflakes = [];
function setup() {
    createCanvas(400, 200);
    useSound();
}

function soundSetup() { 
    osc = new p5.Oscillator();
    osc.amp(0.25);
    osc.setType('square');
    osc.start();
}

// Frequencies in Hz for each of the white and black keys, left to right
var white_freqs = [261.625, 293.665, 329.63, 349.23, 392, 440, 493.88, 523.25];
var black_freqs = [277, 311, 0, 370, 415, 466];   // index 2 not used

function draw() {
    background(0, 0, 68);
       noStroke();
    fill(230, 249, 255);
    rect(0, 180, 400, 200);
    penguin();
    tree();
    santa();
    elf();
    present();
    let t = frameCount / 60; // update time

  // create a random number of snowflakes each frame
  for (let i = 0; i < random(5); i++) {
    snowflakes.push(new snowflake()); // append snowflake object
  }

  // loop through snowflakes with a for..of loop
  for (let flake of snowflakes) {
    flake.update(t); // update snowflake position
    flake.display(); // draw snowflake
  }
}

// snowflake class
function snowflake() {
  // initialize coordinates
  this.posX = 0;
  this.posY = random(-50, 0);
  this.initialangle = random(0, 2 * PI);
  this.size = random(2, 5);

  // radius of snowflake spiral
  // chosen so the snowflakes are uniformly spread out in area
  this.radius = sqrt(random(pow(width / 2, 2)));

  this.update = function(time) {
    // x position follows a circle
    let w = 0.6; // angular speed
    let angle = w * time + this.initialangle;
    this.posX = width / 2 + this.radius * sin(angle);

    // different size snowflakes fall at slightly different y speeds
    this.posY += pow(this.size, 0.5);

    // delete snowflake if past end of screen
    if (this.posY > height) {
      let index = snowflakes.indexOf(this);
      snowflakes.splice(index, 1);
    }
  };

  this.display = function() {
    ellipse(this.posX, this.posY, this.size);
  };
}
 


function mousePressed() {
if(mouseY >= 0 & mouseY < 200 && mouseX >= 25 && mouseX < 325) {
        var keynum = constrain(floor((mouseX - 25) / 50), 0, 5);
        if(keynum != 2) {
        osc.start();
        osc.freq(black_freqs[keynum]);
    }
}
}

function penguin() {
    push();
    noStroke();
    translate(0, 0);
    fill(50);
    rectMode(CENTER);
    //face
    ellipse(49.5, 90.5, 39, 39);
    fill(20);
    //wings
    ellipse(35, 131.5, 8, 55);
    //wings 
    ellipse(64, 131.5, 8, 55);
    fill(50);
    //body
    rect(49.5, 142, 29, 82);
    //belly
    fill(255);
    ellipse(50, 137.5, 16, 55);
    fill(255, 255, 0);
    //foot
    ellipse(35.5, 182.5, 15, 9);
    //foot
    ellipse(64.5, 182.5, 15, 9);
    fill(255, 255, 0);
    //beak
    ellipse(37, 90.5, 22, 3);
    fill(255);
    //eyes
    ellipse(40.5, 83.5, 3, 3);
    //eyes
    ellipse(55.5, 83.5, 3, 3);
    pop();
} 
    function tree() {
        push();
        noStroke();
        translate(0, 0);
        fill(210, 105, 30);
        rectMode(CENTER);
        rect(100, 162, 7, 43);
        //triangle 1
        fill(34, 139, 34);
        beginShape();
        vertex(100, 69.7388);
        vertex(82.5, 130.5);
        vertex(117.8899, 130.5);
        endShape();
        //triangle 2
        beginShape();
        vertex(100, 100.7388);
        vertex(82.5, 161.5);
        vertex(117.8899, 161.5);
        endShape();
        fill(255, 255, 0);
        //star
        ellipse(100, 71, 9 ,9);
        pop();
    }

    function santa() {
        push();
        noStroke();
        translate(0, 0);
        //body
        fill(255, 0, 0);
        ellipse(200, 150.5, 44, 61);
        fill(255);
        ellipse(200, 70, 9, 9);
        //face
        fill(255, 230, 204);
        ellipse(200.5, 110.5, 31, 31);
        //hat
        fill(255, 0, 0);
        beginShape();
        vertex(200.0522, 70);
        vertex(187.2356, 101.5);
        vertex(213.1543, 101.5);
        endShape();
        //boots
        fill(0);
        ellipse(189.5, 179.5, 15, 9);
        ellipse(211.5, 179.5, 15, 9);
        fill(255);
        //buttons
        ellipse(200, 135, 9, 9);
        ellipse(200, 150, 9, 9);
        ellipse(200, 165, 9, 9);
        //eyes
        fill(0);
        ellipse(193, 110, 4, 4);
        ellipse(209, 110, 4, 4);
        pop();
    }

    function elf() {
        push();
        noStroke();
        translate(0, 0);
        rectMode(CENTER);
        //arm
        fill(0, 102, 0);
        rect(242, 155.5, 7, 30);
        rect(258, 155.5, 7, 30);
        //body
        fill(51, 153, 51);
        rect(250, 159, 17, 43);
         //face
        fill(255, 230, 204);
        ellipse(249.5, 130.5, 29, 29);
        //ears
        ellipse(234.5, 131, 3, 14);
        ellipse(264.5, 131, 3, 14);
        //shoes
        fill(255, 0, 0);
        ellipse(241.5, 181, 15, 6);
        ellipse(258.5, 181, 15, 6);
        //hat
        beginShape();
        vertex(249.0522, 94);
        vertex(236.2356, 125.5);
        vertex(263.1543, 125.5);
        endShape();
        //hat top
        fill(255);
        ellipse(249, 92, 9, 9);
        //eyes
         fill(0);
         ellipse(243, 129, 4, 4);
         ellipse(256, 129, 4, 4);
         pop();
    }

    function present() {
        push();
        noStroke();
        translate(0, 0);
        rectMode(CENTER);
        //present
        fill(204, 0, 0);
        rect(299.5, 166.5, 35, 35);
        //ribbon
        fill(255, 204, 0);
        rect(299.5, 166.5, 5, 35);
        rect(299.5, 166.5, 35, 3);
        noFill();
        strokeWeight(2);
        stroke(255, 204, 0);
        ellipse(295, 148, 10, 8);
        ellipse(304, 148, 10, 8);
        pop();
    }
Illustrator Mockup

LO 10 – Computer Music

Cymatics

Nigel Stanford


Nigel Stanford

For my Looking Outwards post, I will be talking about a sound visualization project done by Nigel Stanford. For his latest music video for Cymatics, Stanford decided to use various methods of visualizing sound through natural materials, demonstrating how sound waves affect different types of matter. He uses instruments and computation to effectively convert the sound to waves that can be demonstrated physically. I admire this project because the main focus was creating the visuals of sound: “I looked for interesting science experiments that showed how sound waves affect things, figured out what looked good, and then wrote the musical parts for each experiment” (Stanford). Not only is he using his creativity for his music, but also pushes himself to visualize sound, which allows for a whole new experience for the viewer.

View his portfolio here

View the video here