//wav file:http://freesound.iua.upf.edu/usersViewSingle.php?id=12368 //import processing.video.*; //import processing.opengl.*; //Capture capture; WhiteMountain graph; Ball ball; ParticleSystem physics; Channel sound; int columns = 40; int imageWidth = 640; int screenWidth = 640; int columnWidth = imageWidth / columns; int screenColumnWidth = screenWidth / columns; int speed = 4; int threshold = 470; color [] colorTable; int score = 0; void setup(){ size(640, 480); framerate(24); smooth(); Ess.start(this); sound = new Channel("dink.wav"); physics = new ParticleSystem(5.0, 0.05); graph = new WhiteMountain(columns, columnWidth, speed, threshold, false); ball = new Ball(); //capture = new Capture(this, width, height, 15); ellipseMode(CENTER); initColors(); } void draw(){ background(0); fill(255); ellipse(width/3, height - height/3, 50, 50); ellipse(width - width/3, height - height/3, 50, 50); ellipse(mouseX, mouseY, 50, 50); loadPixels(); graph.update(g); //image(capture, 0, 0); graph.draw(); ball.draw(); fill(colorTable[0]); rect(0, 0, columnWidth, height); fill(colorTable[1]); rect(columnWidth * (columns - 1), 0, columnWidth, height); physics.tick(); } /* void captureEvent(Capture capture){ capture.read(); graph.update(capture); } */ void keyPressed(){ graph.threshold += 10; println(graph.threshold); } public void stop() { Ess.stop(); super.stop(); }