import processing.video.*; import pitaru.sonia_v2_9.*; Capture myCapture; int ellipseSize = 8; int _height; int _width; void setup(){ size(640,480); //start the live input sonia engine brum brum Sonia.start(this); LiveInput.start(); stroke(150); fill(0); ellipse(0,0,width,height); ellipseMode(CENTER); // List all available capture devices to the console // Use the information printed to the text area to // correctly set the variable "s" below println(Capture.list()); // Specify your own device by the name of the capture // device returned from the Capture.list() function String s = "IIDC FireWire Video"; myCapture = new Capture(this, s, 640, 480, 30); // If no device is specified, will just use the default //camera = new Capture(this, 320, 240, 12); // Opens the settings page for this capture device //camera.settings(); } void captureEvent(Capture myCapture) { myCapture.read(); } void draw(){ for (int a = 0; a < 200 ; a++) { int x = int (random(width)); int y = int (random(height)); color c = myCapture.pixels[(x/2 + (y/2) * myCapture.width)]; //declare meterData to be an int then liveInput.getLevel multiply by 1000 to //gain numbers that are in the range of pixel values within the Applet size int meterData = int(LiveInput.getLevel()*250); //println(meterData); // if(mousePressed) ellipseSize = (meterData); if (meterData > 0){ _height = meterData; _width = meterData; } fill (c); ellipse(x,y,ellipseSize,ellipseSize); } } //stop the sonia engine on quit. public void stop(){ Sonia.stop(); }