Roger Dannenberg – [OLD FALL 2019] 15-104 • Introduction to Computing for Creative Practice https://courses.ideate.cmu.edu/15-104/f2019 Professor Roger B. Dannenberg • Fall 2019 • Introduction to Computing for Creative Practice Sat, 05 Oct 2019 13:54:28 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.20 rbd test https://courses.ideate.cmu.edu/15-104/f2019/2019/10/05/rbd-test/ https://courses.ideate.cmu.edu/15-104/f2019/2019/10/05/rbd-test/#respond Sat, 05 Oct 2019 13:28:47 +0000 https://courses.ideate.cmu.edu/15-104/f2019/?p=47262 Continue reading "rbd test"]]>

rbdtest

var sun = 220;
var moon = 235;
var cloud = 260;

var s;
var m;
var h;

function setup() {
    createCanvas(480, 480);
    frameRate(1);  
    s = second();
    m = minute();
    h = hour();
}

function draw() {
    background(0);
    noFill();
  
    if (s % 2 === 0) {
    if (h >= 8 & h < 13) {
      background(182, 224, 239);
      // base()
      // morning()
    } else if (h >= 13 & h < 17) {
      background(141, 194, 214);
      // base()
      // afternoon()
    } else if (h >= 17 & h < 22) {
      background(79, 130, 150);
      // base()
      // twilight()
    } else if (h >= 22 & h < 23.5) {
      background(34, 79, 96);
      // base()
      // night();
    }
    } else if (h >= 0 & h < 8) {
      base()
    }
  
    //minutes
    for (var j = 0; j < minute(); j ++){
      sun = map(j, 0, 70, 220, 255);
      moon = map(j, 0, 60, 125, 255);
      cloud = map(j, 0, 50, 280, 255);
      stroke(sun, moon, cloud);
      fill(37, 179, 255);
      ellipse(240, 240, 9*j, 9*j);
    } 
     push();
  
    //seconds
     noFill();
     translate(width/2, height/2);
    for (var i = 0; i < second(); i ++) {
      sun = map(i, 0, 70, 210, 71);
      moon = map(i, 0, 60, 345, 204);
      cloud = map(i, 0, 50, 0, 234);
      stroke(sun, moon, cloud);
      stroke(50, 75, 255);
      rotate(radians(3));
      ellipse(0, 0, 30, 450);
    } 
    
      pop();
  
      
    {
      
    } 
   
     strokeWeight(2);
     noFill();
     translate(width/2, height/2);
    //hours
    for (var k = 0; k < hour(); k ++){
      sun = map(k, 0, 70, 255, 255);
      moon = map(k, 0, 60, 255, 255);
      cloud = map(k, 0, 60, 102, 255);
      stroke(sun, moon, cloud, 190);
      rotate(radians(8));
      ellipse(0, 0, 150, 400);
      
        
    }		
    
}

]]>
https://courses.ideate.cmu.edu/15-104/f2019/2019/10/05/rbd-test/feed/ 0
Inspirations https://courses.ideate.cmu.edu/15-104/f2019/2019/08/26/inspirations/ https://courses.ideate.cmu.edu/15-104/f2019/2019/08/26/inspirations/#respond Mon, 26 Aug 2019 17:25:17 +0000 https://courses.ideate.cmu.edu/15-104/f2019/?p=39707

This is Roger’s fake LO-01.

]]>
https://courses.ideate.cmu.edu/15-104/f2019/2019/08/26/inspirations/feed/ 0
What is the largest canvas size on WordPress? https://courses.ideate.cmu.edu/15-104/f2019/2018/08/31/what-is-the-largest-canvas-size-on-wordpress/ https://courses.ideate.cmu.edu/15-104/f2019/2018/08/31/what-is-the-largest-canvas-size-on-wordpress/#respond Fri, 31 Aug 2018 15:59:26 +0000 https://courses.ideate.cmu.edu/15-104/f2019/?p=26438

This is a test. Line spacing is 100.

biggrid

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

function draw() {
    background(200, 200, 150);
    for (var i = 0; i <= 800; i += 100) {
        line(i, 0, i, 800);
        line(0, i, 800, i);
    }
    noLoop();
}

]]>
https://courses.ideate.cmu.edu/15-104/f2019/2018/08/31/what-is-the-largest-canvas-size-on-wordpress/feed/ 0
Sound Test https://courses.ideate.cmu.edu/15-104/f2019/2017/12/09/sound-test/ https://courses.ideate.cmu.edu/15-104/f2019/2017/12/09/sound-test/#respond Sun, 10 Dec 2017 04:00:27 +0000 https://courses.ideate.cmu.edu/15-104/f2019/?p=24830 Continue reading "Sound Test"]]>

Sound Test

type 1 2 3 4 to sketch to play sounds

playfour

var one, two, three, four;


function preload() {
    one = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/one.wav");
    two = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/two.wav");
    three = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/three.wav");
    four = loadSound("https://courses.ideate.cmu.edu/15-104/f2017/wp-content/uploads/2017/12/four.wav");
}


function setup() {
    createCanvas(200, 200);
    background(200);
}

function keyPressed() {
    print("" + keyCode);
    if (keyCode == 49) one.play();
    else if (keyCode == 50) two.play();
    else if (keyCode == 51) three.play();
    else if (keyCode == 52) four.play();

}

]]>
https://courses.ideate.cmu.edu/15-104/f2019/2017/12/09/sound-test/feed/ 0