• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • about this course
  • syllabus
  • rubric
  • labs
  • blog

HCI | TechX

August 12, 2020

Harry Hao HW DAY6

import processing.sound.*;

SoundFile summer;
SoundFile a;
SoundFile b;

void setup() {
size(640, 480);

summer = new SoundFile(this, “summer.wav”);
a = new SoundFile(this, “a.aif”);
b = new SoundFile(this, “b.wav”);
}

void draw() {
background(255);
pushMatrix();
float aa = random(0,width-100);
float bb = random(0,height-100);
float cc = random(0,50);

  ellipse(aa, bb, 55, 55);
  fill(#23238E);
  noStroke();
  popMatrix();
  delay(500);
}

void keyPressed() {

switch(key) {
case ‘a’:
summer.play();
background(100, 50, 0);
break;
case ‘g’:
a.play();
background(10, 200, 50);
break;
case ‘l’:
b.play();
background(200, 0, 50);
break;
}
}

Filed Under: blog

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Recent Posts

  • Homework Day 8 – Simon Hsieh
  • homework day 8 – Michael
  • Homework-day8-Sophie
  • Harry Hao HW DAY8
  • homework day 8 – dora

Copyright © 2025 HCI | TechX on the Brunch Pro Theme