/* PixelOSC by Ian Bartholomew 2008 ianbartholomew.com Based on PixelArray code from the Processing library Released under GPL license */ import ddf.minim.*; import ddf.minim.signals.*; import supercollider.*; import oscP5.*; import netP5.*; Minim minim; AudioOutput out; float[] values = new float[6]; SineWave[] sine = new SineWave[values.length]; PImage a; int[] aPixels; int direction = 1; boolean onetime = true; float signal; void setup() { a = loadImage("amy.jpg"); size(a.width, a.height); aPixels = new int[width*height]; noFill(); stroke(255); frameRate(30); minim = new Minim(this); // get a line out from Minim, default bufferSize is 1024, default sample rate is 44100, bit depth is 16 out = minim.getLineOut(Minim.STEREO); for(int i=0; i width*height-1 || signal < 0) { direction = direction * -1; } if(mousePressed) { if(mouseY > height-1) { mouseY = height-1; } if(mouseY < 0) { mouseY = 0; } signal = mouseY*width+mouseX; } else { signal += (0.33*direction); } if(keyPressed) { loadPixels(); color c = pixels[int(signal)]; values[0] = c >> 16 & 0xFF; values[1] = c >> 8 & 0xFF; values[2] = c & 0xFF; values[3] = brightness(c); values[4] = hue(c); values[5] = saturation(c); for (int i=0; i> 16 & 0xFF; values[1] = c >> 8 & 0xFF; values[2] = c & 0xFF; values[3] = brightness(c); values[4] = hue(c); values[5] = saturation(c); for (int i=0; i