Software

Fadecandy Server

The server handles communication with the Fadecandy boards over USB. Because the Space Tunnel has 12 Fadecandys, I set up a config file to identify each one by its serial number.

The server uses Open Pixel Control protocol (OPC) to send pixel data to each light individually.

Processing

Processing is a programming language used for new media arts and visual coding. You can create a canvas of any size, and then draw shapes upon it. Programs written in Processing are called Sketches, and they look something like this:

void setup() {
size(400, 400); // set up a canvas of 400 x 400 pixels
background(255, 0, 0); // set the background to red
stroke(255, 255, 255); // set the drawing colour to white
}

void draw(){
rect(30, 20, 55, 55); // draw a rectangle of 50x50 pixels,
30 pixels from left and 20 pixels from the top of the canvas

}

Using the OPC library for processing, the LEDs are mapped across the canvas, replicating their layout in the real world. Then, anything that is drawn onto the canvas is drawn on the lights.

In this picture, you can see that happening, the stripes on my laptop screen are also on the LED curtain (which is a previous project and also used for prototyping Space Tunnel)

Modes

The Space Tunnel has a few different modes and each mode is set up as its own Processing Sketch.

Space Mode
Being inside the tunnel feels like flying through the stars! Anyone can use the touchscreen to change the speed, colour and direction of the stars.

Animation and Music Reaction Modes
This is a collection of different animations, some of which react to music, here’s an example:

Drawing
Anyone can use the touch screen to draw on the lights, like this:

Interface

To allow anyone to control the tunnel and select modes, I designed an interface in HTML.

If Space or Drawing mode has been chosen, people can then control the lights using the touchscreen.

For the first outings of Space Tunnel, this was done with an interface created in the Processing sketch. This was limiting, because Processing is not really intended to create user interfaces, but it was the simplest way to let people control the lights.

Here are the early Processing interfaces:

I have since set up an HTML interface to control the Space Mode, and used a tool called (coincidentally) SpaceBrew to send instructions over a serial connection between Processing and the browser interface. The visual design of this interface is still in progress, and I’m excited to see people use it on the Space Tunnel’s next outing.

In this video you can see a prototype of the SpaceBrew control. On the left is the HTML interface, on the right is the Processing sketch.

Tying it all together

When a button in the HTML is clicked, an exe file (created using Autoit) runs which stops any Processing sketches which are currently running and starts up the one which has been selected. AutoIt also allowed me to do things like maximise or minimise the Processing window as needed, depending on which mode was being run, to provide a better user experience.

Thanks to security issues (you can’t directly run an executable from a browser because that would usually be a really bad thing) it actually was a little more complicated, and I used a tool called webrun to allow me to do that.

Here’s a diagram of how the technologies all fit together to control the lights: