Code in 2013

Bytebeat Animations

SPW_5

These are the frames of two of five b&w animations created using Processing. The animations are kind of a visual manifestation of the low fi 8-bit music form sometimes referred to as Bytebeat.

Each frame is algorithmically generated from a one line expression, where the black and white areas are defined by looking at a small window of the result as the expression is incremented each time. The expressions used in these examples are shown under the frames. The result is an engaging, pulsating graphic that feels like it is responding to an interesting silent soundtrack.

bb1

// Bytebeat Animation

int w = 256*3;
int h = 256*3;
int d = 5;
int t = 0;
int v = 0;
int rrr;
int ggg;
int bbb;
int outer = 0;
int dir = -1;
float speed = .5;

void setup() {
  background(255);
  stroke(255, 255, 255);
  smooth();
  size(w, h);
  rrr = 0;
  ggg = 0;
  bbb = ggg;
  frameRate(10);
}

void draw() {
  background(255);
  outer+=dir;
  //rotate(speed*2*PI*outer/360);
  for (int i=0; i<8; i++) {
    t++;
    // Uncomment one of these lines to change the expression
    //
    //v = ((t<<1)^((t<<1)+(t>>7)&t>>12))|t>>(4-(1^7&(t>>19)))|t>>7;
    //v = t;
    //  v = t/32*42;
    //v = ((-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14));
    //v=(t>>6|t|t>>(t>>16))*10+((t>>11)&7);
    v=(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6);

    for (int j=0; j<8; j++) {
      if (((v>>j) & 0x01) == 1) {
        fill(rrr, ggg, bbb);
      } 
      else {
        fill(255, 255, 255);
      }
      for (int x=0; x<256*3; x+=256) {
        for (int y=0; y<256*3; y+=256) {
          translate(x, y);
          rotate((random(6)-3)*PI/360);
          int dw = (int)random(10)-5;
          ellipse(j*32, i*32, 20+dw, 20+dw);
          resetMatrix();
        }
      }
    }
  }
}

bb2

// Bytebeat Animation #2

int w = 210;
int h = 210;
int d = 5;
int t = 0;
int v = 0;
int rrr;
int ggg;
int bbb;
int outer = 0;
int dir = -1;
float speed = .5;

void setup() {
  background(255);
  stroke(255, 255, 255);
  smooth();
  size(w, h);
  rrr = 0;
  ggg = 0;
  bbb = ggg;
  frameRate(30);
}

void draw() {
  translate(w/2, h/2);
  background(255);
  bbb = ggg;
  outer+=dir;
  rotate(speed*2*PI*outer/360);
  for (int a=0; a<32; a++) {
    t++;
    // Uncomment one of the following to change the expression
    //
    v = ((t<<1)^((t<<1)+(t>>7)&t>>12))|t>>(4-(1^7&(t>>19)))|t>>7;
    //v = t;
    // v = t/32;
    //v = ((-t&4095)*(255&t*(t&(t>>13)))>>12)+(127&t*(234&t>>8&t>>3)>>(3&t>>14));
    //v=(t>>6|t|t>>(t>>16))*10+((t>>11)&7);
    //v=(t>>7|t|t>>6)*10+4*(t&t>>13|t>>6);
    rotate(a*2*PI/32.0);
    for (int i=0; i<8; i++) {
      if (((v>>i) & 0x01) == 1) {
        fill(rrr, ggg, bbb);
      } 
      else {
        fill(255, 255, 255);
      }
      int x = 0; 
      int y = d*i*2+30;

      ellipse(x, y, d*i, d*i);
    }
    fill(rrr, ggg, bbb);
    stroke(rrr, ggg, bbb);
    ellipse(0, d*18+30, d*9+15, d*9+15);
    stroke(255, 255, 255);
  }
}

 
Generative RI Mini Maker Faire Poster | Books I've edited (or co-edited) at O'Reilly Media