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

HCI | TechX

August 13, 2020

HOMEWORK DAY06 RAPHAEL

import processing.sound.*;

SoundFile sound;
Amplitude a;

int width, height;

void setup(){
  width = 600;
  height = 600;
  
  size(600, 600);
  background(0);
  sound = new SoundFile(this, "happy.wav");
  a = new Amplitude(this);
  a.input(sound);
  
  // sound.loop();
  sound.play();
}

int counter = 0;
void draw()
{
  background(255);
  
  noStroke();
  
  float current = a.analyze() * 1000;
  ellipse(width/2, height/2, int(current + random(20)), int(current + random(20)));
  
  counter ++;
  if (counter > 15){
    counter = 0;
    fill(random(255), random(255), random(255));
  }
  
}

At least by random I can somehow see the effect – but on my laptop it is not working due to some unknown issues. Processing even cannot play sample sounds from lib.

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