retrointerfacing

- connecting past and future -

Archive for the ‘Processing’ Category

Video Projection System

without comments

For the 100th Gonnagle performance I designed a ‘live video drawing tool’ using webcam, LED spots and processing app..

projectie schrijfsel

Software has been written in Processing.. pretty straightforward.. Especially the filters are simple to use but very powerfull.. In the application they are controlled using a midi controller (Korg NanoKey)


void draw() {
background(255);
if (cam.available() == true) {
cam.read();
}
if (useRotate) {
translate(width/2, height/2);
rotate(PI);
translate(-width/2, -height/2);
}
image(cam, 0, 0);

if (useBW) filter(THRESHOLD, constrain(thresholdLevel, 0, 1));
if (useInvert) {filter(INVERT); fill(0);}
else fill(255);
if (useBlur) filter(BLUR,1);
if (useRotate) {
translate(width/2, height/2);
rotate(PI);
translate(-width/2, -height/2);
}
}

Written by edwin

May 3rd, 2012 at 9:02 pm

Posted in Processing, music

Tagged with

Time Stretcher

with one comment


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);
}

Written by edwin

April 26th, 2010 at 3:49 pm

Posted in Processing

Tagged with

32×32 bit Pong

with 5 comments

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

Written by edwin

March 11th, 2009 at 2:11 am

LED matrix on arduino

without comments

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)

Written by edwin

February 4th, 2009 at 11:13 pm

Posted in Arduino, DIY, Processing, blinky

Tagged with

Game of life on dot-matrix

without comments

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

Written by edwin

December 30th, 2008 at 6:08 pm

Posted in Arduino, DIY, Processing, blinky

Tagged with

Hockney-generator

with one comment

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

Written by edwin

October 16th, 2008 at 7:45 pm

Posted in DIY, Processing, Robotics, imaging

Tagged with