May 21, 2013

//tiled130521a
//Setup Code is from this sketch:
//http://blog.jamesmakes.com/post/41737671314/int-value-opacity-int-threshold

int[] value, opacity;
int threshold, pIndex;

void setup() {
  size(720, 720);
  value = new int[width];
  opacity = new int[height];
  translate(width/2, height/3*2);
  threshold = 135;
  for (int i=1; i<width; i++){
    for (int j=1; j<height; j++){
      pushMatrix();
        value[i] = int(map(i,1,width,0,255));
        opacity[j] = int(map(j,1,height,0,255));
        if (opacity[j] < threshold){
          stroke(value[int(abs(cos(i)*j))],opacity[int(abs(cos(j)*i))]);
        } else {
          stroke(value[j],opacity[i]);
        }
        translate(cos(i)*i/3,cos(j)*j/3);
        point(0,0);
      popMatrix();
    }
  }
}

void draw() {
  loadPixels();
  if (threshold < (width*100)) {
    for (int k=width; k<width*height-width; k++) {
      pIndex = int(((width*height/2)-width/2)+(k%threshold));
      
      pixels[k] = color(
        int(red(pixels[pIndex])),
        int(green(pixels[pIndex])),
        int(blue(pixels[pIndex])),
        int(brightness(pixels[pIndex]))
      );
    }
    threshold = threshold+width;
  } else {
    threshold = 1;
  }
  updatePixels();
}

May 20, 2013
May 19, 2013
//smearedPoints//Setup Code is from this sketch int[] value, opacity;int threshold;void setup() {  size(720, 720);  value = new int[width];  opacity = new int[height];  translate(width/2, height/3*2);  threshold = 135;  for (int i=1; i&lt;width; i++){    for (int j=1; j&lt;height; j++){      pushMatrix();        value[i] = int(map(i,1,width,0,255));        opacity[j] = int(map(j,1,height,0,255));        if (opacity[j] &lt; threshold){          stroke(value[int(abs(cos(i)*j))],opacity[int(abs(cos(j)*i))]);        } else {          stroke(value[j],opacity[i]);        }        translate(cos(i)*i/3,cos(j)*j/3);        point(0,0);      popMatrix();    }  }}void draw() {  loadPixels();  if (threshold &lt; 255) {    for (int k=width; k&lt;width*height-width; k++) {      if (brightness(pixels[k]) &gt; threshold) {        pixels[k-1] = color(        int(red(pixels[k+1])),        int(green(pixels[k+1])),        int(blue(pixels[k+1])),        int(brightness(pixels[k+1]))          );      }      else {        pixels[k-width] = color(        int(red(pixels[k+1])),        int(green(pixels[k+1])),        int(blue(pixels[k+1])),        int(brightness(pixels[k+1]))          );      }    }    threshold = threshold+1;  }  else {    threshold = 100;  }  updatePixels();}

//smearedPoints
//Setup Code is from this sketch

int[] value, opacity;
int threshold;

void setup() {
  size(720, 720);
  value = new int[width];
  opacity = new int[height];
  translate(width/2, height/3*2);
  threshold = 135;
  for (int i=1; i<width; i++){
    for (int j=1; j<height; j++){
      pushMatrix();
        value[i] = int(map(i,1,width,0,255));
        opacity[j] = int(map(j,1,height,0,255));
        if (opacity[j] < threshold){
          stroke(value[int(abs(cos(i)*j))],opacity[int(abs(cos(j)*i))]);
        } else {
          stroke(value[j],opacity[i]);
        }
        translate(cos(i)*i/3,cos(j)*j/3);
        point(0,0);
      popMatrix();
    }
  }
}

void draw() {
  loadPixels();
  if (threshold < 255) {
    for (int k=width; k<width*height-width; k++) {
      if (brightness(pixels[k]) > threshold) {
        pixels[k-1] = color(
        int(red(pixels[k+1])),
        int(green(pixels[k+1])),
        int(blue(pixels[k+1])),
        int(brightness(pixels[k+1]))
          );
      }
      else {
        pixels[k-width] = color(
        int(red(pixels[k+1])),
        int(green(pixels[k+1])),
        int(blue(pixels[k+1])),
        int(brightness(pixels[k+1]))
          );
      }
    }
    threshold = threshold+1;
  }
  else {
    threshold = 100;
  }
  updatePixels();
}

whichlight:

Tiaga is part V of the web audio api minimal synths series. 
You can play with the synth here. Since it uses the web audio api, it currently requires the chrome browser. 
/**
 tiaga.pde
 
 kawandeep virdee
 **/


int width=600;
int height=600;
int t=0;
float yval=300;
boolean saveFrames=false;

void setup() {
  smooth();
  frameRate(15);
  colorMode(HSB, 360, 100, 100, 100);
  size(width, height);
}

void draw() {
  
  yval =450+50*sin(radians(5*t));
  if (mouseY!=0) {
    yval=mouseY;
  }
  float y = max(height-(yval), 100);
  float res = height/(y/10);
  float sat=50;
  float val = map(height-yval, 0, height, 10, 20);
  background(234, 5, 100);

  for (int i=0; i&lt;height; i+=res) {
    noStroke();
    fill(100, 50, val, 2+res);
    rect(0, y+i, width, 1*i*res);
  }

  if (saveFrames) {
    save("images/"+str(t)+".gif");
  }
  t++;
}

void keyPressed() {
  if (key == CODED) {
    if (keyCode == UP) {
      println("Start saving frames");
      saveFrames=true;
    } 
    else if (keyCode == DOWN) {
      println("Stop saving frames");
      saveFrames=false;
    }
  }
}

/**
 synth.js
 
 kawandeep virdee
 **/
 
 var synths = [];
var gainVal = 0.03;
var qval = 25;

function openNotes(){
       synths.push(setupSynth(150));
       synths.push(setupSynth(100));
       synths.push(setupSynth(200));
       synths.push(setupSynth(250));
       synths.push(setupSynth(300));
}

function closeNotes(){
   for(var i=0; i&lt;synths.length; i++){
       synths[i].source.noteOff(0);
    }
}

function updateNotes(pitch, variance){
   for(var i=0; i&lt;synths.length; i++){
       synths[i].filter.frequency.value = pitch + variance*Math.random();
    }
}

function onNotes(){
   for(var i=0; i&lt;synths.length; i++){
       synths[i].volume.gain.value=gainVal;
    }
}


function offNotes(){
   for(var i=0; i&lt;synths.length; i++){
       synths[i].volume.gain.value=0;
    }
}

function setupSynth(f){
    var nodes={};
    nodes.source = context.createOscillator();
    nodes.source.type=1;
    nodes.source.frequency.value = f;
    nodes.filter = context.createBiquadFilter();
    nodes.filter.Q.value =qval;
    nodes.volume = context.createGainNode();
    nodes.filter.type=0; //0 is a low pass filter

    nodes.volume.gain.value = gainVal;
    nodes.source.connect(nodes.filter);
    nodes.filter.connect(nodes.volume);
    //frequency val
    nodes.filter.frequency.value=400;


    //reverb
    nodes.reverb = context.createConvolver();

    nodes.volume.connect(nodes.reverb);
    nodes.reverb.connect(context.destination);
    nodes.volume.gain.value=0;
    nodes.source.noteOn(0);
    nodes.volume.gain.value=0;
    setReverbImpulseResponse('http://thelab.thingsinjars.com/web-audio-tutorial/Church-Schellingwoude.mp3', nodes.reverb, function() {
      nodes.source.noteOn(0);
    });
    return nodes;
}

function setReverbImpulseResponse(url, convolver, callback) {
        var request = new XMLHttpRequest();
        request.open("GET", url, true);
        request.responseType = "arraybuffer";

        request.onload = function () {
            convolver.buffer = context.createBuffer(request.response, false);
            callback();
        }
        request.send();
    }

whichlight:

Tiaga is part V of the web audio api minimal synths series. 

You can play with the synth here. Since it uses the web audio api, it currently requires the chrome browser. 

/**
 tiaga.pde
 
 kawandeep virdee
 **/


int width=600;
int height=600;
int t=0;
float yval=300;
boolean saveFrames=false;

void setup() {
  smooth();
  frameRate(15);
  colorMode(HSB, 360, 100, 100, 100);
  size(width, height);
}

void draw() {
  
  yval =450+50*sin(radians(5*t));
  if (mouseY!=0) {
    yval=mouseY;
  }
  float y = max(height-(yval), 100);
  float res = height/(y/10);
  float sat=50;
  float val = map(height-yval, 0, height, 10, 20);
  background(234, 5, 100);

  for (int i=0; i<height; i+=res) {
    noStroke();
    fill(100, 50, val, 2+res);
    rect(0, y+i, width, 1*i*res);
  }

  if (saveFrames) {
    save("images/"+str(t)+".gif");
  }
  t++;
}

void keyPressed() {
  if (key == CODED) {
    if (keyCode == UP) {
      println("Start saving frames");
      saveFrames=true;
    } 
    else if (keyCode == DOWN) {
      println("Stop saving frames");
      saveFrames=false;
    }
  }
}

/**
 synth.js
 
 kawandeep virdee
 **/
 
 var synths = [];
var gainVal = 0.03;
var qval = 25;

function openNotes(){
       synths.push(setupSynth(150));
       synths.push(setupSynth(100));
       synths.push(setupSynth(200));
       synths.push(setupSynth(250));
       synths.push(setupSynth(300));
}

function closeNotes(){
   for(var i=0; i<synths.length; i++){
       synths[i].source.noteOff(0);
    }
}

function updateNotes(pitch, variance){
   for(var i=0; i<synths.length; i++){
       synths[i].filter.frequency.value = pitch + variance*Math.random();
    }
}

function onNotes(){
   for(var i=0; i<synths.length; i++){
       synths[i].volume.gain.value=gainVal;
    }
}


function offNotes(){
   for(var i=0; i<synths.length; i++){
       synths[i].volume.gain.value=0;
    }
}

function setupSynth(f){
    var nodes={};
    nodes.source = context.createOscillator();
    nodes.source.type=1;
    nodes.source.frequency.value = f;
    nodes.filter = context.createBiquadFilter();
    nodes.filter.Q.value =qval;
    nodes.volume = context.createGainNode();
    nodes.filter.type=0; //0 is a low pass filter

    nodes.volume.gain.value = gainVal;
    nodes.source.connect(nodes.filter);
    nodes.filter.connect(nodes.volume);
    //frequency val
    nodes.filter.frequency.value=400;


    //reverb
    nodes.reverb = context.createConvolver();

    nodes.volume.connect(nodes.reverb);
    nodes.reverb.connect(context.destination);
    nodes.volume.gain.value=0;
    nodes.source.noteOn(0);
    nodes.volume.gain.value=0;
    setReverbImpulseResponse('http://thelab.thingsinjars.com/web-audio-tutorial/Church-Schellingwoude.mp3', nodes.reverb, function() {
      nodes.source.noteOn(0);
    });
    return nodes;
}

function setReverbImpulseResponse(url, convolver, callback) {
        var request = new XMLHttpRequest();
        request.open("GET", url, true);
        request.responseType = "arraybuffer";

        request.onload = function () {
            convolver.buffer = context.createBuffer(request.response, false);
            callback();
        }
        request.send();
    }
 

(via fyprocessing)

May 16, 2013
//CMYKsinSplit //Steup Code is from CMYKsin sketchfloat rColor, gColor, bColor, aColor;int threshold;void setup() {  size(720, 720);  translate(width/2, height/3*2);  threshold = 135;  for (int i=0; i&lt;width; i++) {    for (int j=0; j&lt;height; j++) {      rColor = abs(cos(i)*width/2);      gColor = abs(sin(j)*height/2);      bColor = abs(cos(i+j)*width/2);      aColor = 255;      stroke(rColor, gColor, bColor, aColor);      pushMatrix();      translate((sin(i))*width/5*2, (sin(j))*height/5*2);      rotate(i);      rotate(j);      point(0, 0);      popMatrix();    }  }}void draw() {  loadPixels();  if (threshold &lt; 255) {    for (int k=width; k&lt;width*height-width; k++) {      if (brightness(pixels[k]) &gt; threshold) {        pixels[k-1] = color(        int(red(pixels[k+1])),         int(green(pixels[k+1])),         int(blue(pixels[k+1])),         int(brightness(pixels[k+1]))          );      }       else {        pixels[k-width] = color(        int(red(pixels[k+1])),         int(green(pixels[k+1])),         int(blue(pixels[k+1])),         int(brightness(pixels[k+1]))          );      }    }    threshold = threshold+1;  }   else {    threshold = 100;  }  updatePixels();}

//CMYKsinSplit
//Steup Code is from CMYKsin sketch

float rColor, gColor, bColor, aColor;
int threshold;

void setup() {
  size(720, 720);
  translate(width/2, height/3*2);
  threshold = 135;
  for (int i=0; i<width; i++) {
    for (int j=0; j<height; j++) {
      rColor = abs(cos(i)*width/2);
      gColor = abs(sin(j)*height/2);
      bColor = abs(cos(i+j)*width/2);
      aColor = 255;

      stroke(rColor, gColor, bColor, aColor);
      pushMatrix();
      translate((sin(i))*width/5*2, (sin(j))*height/5*2);
      rotate(i);
      rotate(j);
      point(0, 0);
      popMatrix();
    }
  }
}

void draw() {
  loadPixels();
  if (threshold < 255) {
    for (int k=width; k<width*height-width; k++) {
      if (brightness(pixels[k]) > threshold) {
        pixels[k-1] = color(
        int(red(pixels[k+1])),
        int(green(pixels[k+1])),
        int(blue(pixels[k+1])),
        int(brightness(pixels[k+1]))
          );
      }
      else {
        pixels[k-width] = color(
        int(red(pixels[k+1])),
        int(green(pixels[k+1])),
        int(blue(pixels[k+1])),
        int(brightness(pixels[k+1]))
          );
      }
    }
    threshold = threshold+1;
  }
  else {
    threshold = 100;
  }
  updatePixels();
}

May 14, 2013
tingham:


Processing: Noise Sorting (18)

tingham:

Processing: Noise Sorting (18)

//SpinesOutofSorts

//I pulled the code in setup from this sketch


float rColor, gColor, bColor, aColor;
int threshold;

void setup() {
  size(720, 720);
  translate(width/2, height/2);
  threshold = 135;
  for (int i=0; i<width; i++) {
    for (int j=0; j<height; j++) {
      rColor = abs(cos(i)*width/2);
      gColor = abs(sin(j)*height/2);
      bColor = abs(cos(i+j)*width/2);
      aColor = abs(sin(i+j)*height);
      stroke(rColor, gColor, bColor, aColor);
      pushMatrix();
      rotate(i);
      rotate(j);
      translate(i/3, j/3);
      point(0,0);
      popMatrix();
    }
  }
}

void draw() {
  loadPixels();
    if (threshold < 255) {
      for (int k=width; k<width*height-width; k++){
        if (brightness(pixels[k]) > threshold){
          pixels[k-1] = color(
            int(red(pixels[k+1])),
            int(green(pixels[k+1])),
            int(blue(pixels[k+1])),
            int(brightness(pixels[k+1]))
          );
        } else {
          pixels[k-width] = color(
            int(red(pixels[k+1])),
            int(green(pixels[k+1])),
            int(blue(pixels[k+1])),
            int(brightness(pixels[k+1]))
          );
        }
      }
      threshold = threshold+1;
    } else {
      threshold = 100;
  }
  updatePixels();
}

May 13, 2013

//colorGradientLandscape-130513a
int[][] index, rValue, gValue, bValue, opacity;
int threshold;
 
void setup(){
  size(720,480);
  threshold = 135;
  index = new int[width][height];
  rValue = new int[width][height];
  gValue = new int[width][height];
  bValue = new int[width][height];
  opacity = new int[width][height];
  for (int i=0; i<width; i++){
    for (int j=0; j<height; j++){
      index[i][j] = (width*i)+j;
      rValue[i][j] = int(map(sin(index[i][j]),abs(sin(j))*-1,abs(sin(i)),0,255));
      gValue[i][j] = int(map(sin(index[i][j]),abs(sin(i))*-1,abs(cos(j)),0,255));
      bValue[i][j] = int(map(sin(index[i][j]),abs(cos(j))*-1,abs(sin(i)),0,255));
      opacity[i][j] = int(map(sin(index[i][j]),abs(cos(i))*-1,abs(cos(j)),0,255));
      stroke(rValue[i][j],gValue[i][j],bValue[i][j],opacity[i][j]);
      point(i,j);
    }
  }
}

void draw() {
  loadPixels();
    if (threshold < 255) {
      for (int k=width; k<width*height-width; k++){
        if (brightness(pixels[k]) > threshold){
          pixels[k-1] = color(
            int(red(pixels[k+1])),
            int(green(pixels[k+1])),
            int(blue(pixels[k+1])),
            int(brightness(pixels[k+1]))
          );
        } else if (brightness(pixels[k]) == threshold) {
          pixels[k+width] = color(
            int(red(pixels[k-width])),
            int(green(pixels[k-width])),
            int(blue(pixels[k-width])),
            int(brightness(pixels[k-width]))
          );
        } else {
          pixels[k-width] = color(
            int(red(pixels[k+1])),
            int(green(pixels[k+1])),
            int(blue(pixels[k+1])),
            int(brightness(pixels[k+1]))
          );
        }
      }
      threshold = threshold+1;
    } else {
      threshold = 0;
  }
  updatePixels();
}

action-gallery:

Some of the amazing works of Adam Ferris will be featured at  ACTION GALLERY in Milano on May 25 and in Naples on May 30.

action-gallery:

Some of the amazing works of Adam Ferris will be featured at  ACTION GALLERY in Milano on May 25 and in Naples on May 30.

(via adamferriss)

May 12, 2013

Alternate frames from normalSortA