Archive for the ‘Processing’ Category

Time Stretcher

Monday, April 26th, 2010


Some time ago I paid a visit to Tate Modern. In the turbine hall was a funny, dreamy, if not to say fear-and-loathing-in-las-vegas like video projection. I used processing to figure out what they did. Here’s a video of the result and the processing source code. The work can be traced back to Bill Spinhoven who created it in 1988 (!). All processing was done electronically (digitally) with Andries Lohmeijer - no computers involved. Talking about retrointerfacing…..

// shows a time-delayed video.
// Each row of the displayed image has been delayed one frame, starting from the top row.
import processing.video.*;
int WIDTH=320;
int HEIGHT=240;
int rowSegment = 1; //increase to speed up (but lose resolution)
int[][] theImageBuffer;
Capture video;
int numberOfFrames = HEIGHT/rowSegment;
int currentframe=0;
void setup() {
  size(WIDTH,HEIGHT, P2D);
  video = new Capture(this, width, height, 24);
  theImageBuffer = new int[numberOfFrames][video.width*video.height];
}

void draw() {
  if (video.available()) {
    video.read(); // Read a new video frame
    video.loadPixels(); // Make the pixels of video available
    for (int i = 0; i < video.width*video.height; i++)
    {
      theImageBuffer[currentframe][i] = video.pixels[i]; // copy video in buffer
    }
    for (int row=0; row<video.height; row++)
    {
      for (int col=0; col<video.width; col++)
      {
         video.pixels[col+(row*video.width)]=theImageBuffer[(currentframe+((video.height-row-1) / rowSegment ))%numberOfFrames][col+(row*video.width)];
      }
    }
    currentframe++;
    currentframe%=numberOfFrames;
    updatePixels();
  }
  image(video, 0, 0, width, height);
}

32×32 bit Pong

Wednesday, March 11th, 2009

Connecting everything with everything… Here a computer playing Pong with itself. The motorfaders from the Behringer BCF2000 can either used as user-input or taken over by the PC.

pong arduinocloseup

Check the processing example here

LED matrix on arduino

Wednesday, February 4th, 2009

ledmatrixfinished
The previously discussed LED matrices have been mounted on a perspex stand, and instead of the mublock controller I have used a normal Arduino Diecimila. Since the software was originally written for WinAVR using some of the AVRlib functions, I haven’t made a full functioning Arduino sketch yet. Bitmap images give the start configuration for the game-of-life simulation, so you can immediatly play with ‘gliders’ or ‘lsww’ (see wikipedia on Conway) The bitmaps should go in the ‘data’ directory with the processing sketch.

gliders pulsar

Here’s the processing sketch:conwayprint32. A ‘clean’ sketch for displaying just 32*32 monochrome bitmaps: bitmapprint. The arduino sources are here: arduinoleddisplay.

These sources do not work with the normal Arduino programming environment, since I haven’t figured out completely how to do timing interrupts etc. I have used WinAVR. The sources compile with Make All.. Make Program will program the sources normally. (don’t forget to set the correct COM port in the makefile)

Game of life on dot-matrix

Tuesday, December 30th, 2008

display

First of all I wish you an inspiring and creative 2009!

The remainder of this post is about the Dot matrix LED display. This ‘game of life’ simulation is running in Processing, communicating via serial port to an ATmega32 controller which controls two LED dot matrixes. The displays were on sale at baco-army-goods, and had a previous life at a bus station. See it move… on youtube. After I got this idea and build it… well, you’ve got these links on youtube and google… obviously somebody else must have done a similar thing… (and yes, look at adafruit where you can even buy a kit). Oh well..

Sources and connection details are posted here

life

Hockney-generator

Thursday, October 16th, 2008

While making a dynamixel library for Processing, I started fiddling around with a simple humanoid head that I constructed earlier (as temporary setup for the soccer Humanoid). This head consists of three AX-12+ types dynamixel servo’s by Robotis, and two Logitech Webcam’s (currently only one used). The control software in Processing controls the head (basic a pan-tilt set-up) with a joystick, while panning the recorded image on a canvas. Due to the lack of precision in the joystick movements, this yields a Hockney-style image!.. So basically David Hockney is a mal-adjusted pan-tilt camera…. See this youtube clip for the generator in action!

For video capture the processing.video libraries have been used (don’t forget to install winVDIG from here). For joystick input proCONTROLL has been used. The dynamixel servo’s are controlled using a USB2DYNAMIXEL adapter. The java-sources that come with the dynamixel SDK have been recompiled (using JDK5.0 -> java 1.5.x version required) and packed with the processing source.

Picture generated with robothead

Picture generated with robothead

Head

Head

logitechhead