May 24, 2008

The Dublin Freeze

Posted in: Art, Dublin, Events

As seen in London, New York... Prepare your pose.

Sunday 25th May 2008

18.33 - 18.39

Halfway along Grafton Street, near the clock outside Barratts: map

The Grand Central Freeze:

Posted by Paul Makepeace at 22:23 | Comments (0) | TrackBack

March 8, 2008

Arduino showing multiplexed LED matrix

Posted in: Art, Gadgets, Software, Tech

To control any more than 12 LEDs on an Arduino board requires a bit of trickery. The Diecimila with its Atmega168 chip has 14 digital output pins, but you somewhat lose two from the TX/RX serial pins on 0 and 1 leaving just 12 pins. Today I built an LED matrix with 20 lights using nine pins,

The technique is to light row by row, and rely on our persistence of vision effect. Playing around with the delay it seemed like 3ms for a total of 15ms (five rows) was about the point where flicker just started being noticeable.

Geeky detail after the fold...

The software pulls the row pins high one by one while the column pins are set low for every LED to light, sinking the current from the one high row pin. There's a 3ms delay, then the next row pin is brought high and the last one low.

The data for the little animation is a 2D byte array that looks like,

byte PATTERN[][5] = { 
  /* ... */
  {B0111,
   B1110,
   B1100,
   B1000,
   B0000,},
  /* ... */
};

('B' is a handy prefix for a binary number.)

You can see a diagonal band of 1's there in the early part of the wipe. Each byte's translated into pin writes by looking at the lowest bit in the byte and then shifting right and looking at the next. LOW is on.

void SetColumn(byte pattern) {
  for (int i = COL_COUNT-1; i >= 0; i--, pattern >>= 1) {
    digitalWrite(COL_PINS[i], pattern & 1 ? LOW : HIGH);
  }
}

A "frame" of the display is completed by lighting each row in turn,

void ShowPattern(byte pattern[]) {
  int last_row = ROW_COUNT-1;
  for (int row = 0; row < ROW_COUNT; last_row = row++) {
    digitalWrite(ROW_PINS[row], HIGH);
    digitalWrite(ROW_PINS[last_row], LOW);
    SetColumn(pattern[row]);
    delay(MULTIPLEX_DELAY_MS);
  }
}

The main loop draws each frame over and over until a certain amount of time has elapsed and then it goes onto the next one. millis() is a built-in that returns the number of milliseconds since the board was switched on. (This code would fail after about nine hours when the counter resets.)

void loop()
{
  for (int pos = 0; pos < PATTERN_SIZE; pos++) {
    long start = millis();
    while (millis() - start < PATTERN_DELAY_MS) {
      ShowPattern(PATTERN[pos]);
    }
  }
}

Notes

I actually had the circuit the other way around, cycling through column-by-column and the rows programmed in turn with a line of lights. This happened out to make writing patterns awkward so I flipped the orientation which made SetColumn pretty straightforward.

The matrix could've had more lights on it but the breadboard limited width a bit. I was quite proud of the tight wiring under the LEDS.

From Multiplexed LED Matrix

This was one of the projects where the bits that seemed like they'd be hard Just Worked and then silly things wasted time, like C mistakes with sizeof.

int ROW_PINS[] = {13, 12, 11, 10, 9};
int COL_PINS[] = {5, 4, 3, 2};
#define ROW_COUNT (sizeof(ROW_PINS)/sizeof(ROW_PINS[0]))
#define COL_COUNT (sizeof(COL_PINS)/sizeof(COL_PINS[0]))

Parameterizing these kinds of things made moving from a 3x4 board to 4x5, flipping the rows & columns, and using different pins trivial. An unfortunate cargo-cult effect in Arduino and Wiring code I've seen is folks not using #define and sizeof.

Some cute enhancements might be to have an array of structs, the struct containing additionally a delay time for each frame. We could also have, rather than 0/1, a wider range of values to indicate brightness. With that, (e.g. Perl/Python scripted) code could generate the animation sequences rapidly flipping frames to give an impression of anti-alias. Unfortunately I have other things to do... (yeah, I made the animations by hand in vi and pasted into the Arduino editor :-))

And finally, a Wiring-based pair of color LED matrixes are used as toilet signs... that change throughout the night [video]. More on this funny project.

Posted by Paul Makepeace at 23:27 | Comments (7) | TrackBack

January 18, 2005

Wireless London

Posted in: Art, Events, Tech

Tonight I attended a packed lecture hall for the inaugural, and as it turned out engaging and super-smoothly executed, Wireless London event that featured talks from Armin Medosch and Usman Haque. Both were great; interesting and provocative...

In particular Usman's Sky Ear project was just fantastic - send up little radio frequency sensors with powerful LEDs, some communication circuitry, and phones all inside hundreds of helium balloons. The sensors detect both natural- and human-created signals and visualize them with the LEDs. An extra twist is created by the ability to be able to SMS/text the device which in the process of receiving the message affects the surrounding ether and thus the visualization! The scale of the creation was just awesome and looked wonderful.

Definitely recommended, looking forward to the next one.

Continuing what seems to be a run of good fortune meeting cool people, I was lucky enough to be sitting next to an architect who did an intriguing project on the 'flirtatious city' examing how configurations of architecture are and are not conducive to urban intimacy in its broad sense. Gotta love intending to go to Rome and experiment wearing high-heels on a Vespa to see how that effects passage through the urban landscape... Someone has to investigate this stuff.

Posted by Paul Makepeace at 23:40 | Comments (2) | TrackBack

November 19, 2004

Zoom quilt

Posted in: Art

Simple, elegant, beautiful: The Zoomquilt. The Flash version of Zoomquilt version is probably the most fun/interactive.

This piece was created collaboratively as you can see from the home page. The organizer, razghul links to tiles.iCE.org, a collaborative "quilt" (tiled image) community foundry. The entry requirements for iCE are pretty steep so they say and the artwork really impressed me: here's an example.

Click a tile to see how it's produced: a gap surrounded by a few pixels of its completed neighbors is sent out ("checked out") from the system to the artist and within a day it has to be filled out and sent back ("checked in"). The tiles are rated by fellow tilers which contributes to the artist's overall rating. These artist ratings are then used by others to set entry requirements for producing subsequent tiles. Each tile even has its own mini bulletin board where style, construction, and other artistic themes are discussed.

Posted by Paul Makepeace at 15:44 | Comments (1) | TrackBack

June 6, 2004

C64 Audio

Posted in: Art, Music, Old Skool, Tech

Just got back from NotCon '04 and was curious about what had been left behind on its host site, xcom2002.com: a website pretty much covered in cobwebs, last updated around early 2003. Skimming down the page I saw a link to C64audio.com and, being a huge fan of C64 audio back in the day (mid-late 80s), went exploring...

Somewhere down on c64audio.com is a link to the High Voltage SID Collection, the C64/SID tune archive. Mind-boggling tens of thousands of SID tunes.

What is the SID? It is the dedicated 3-voice polyphonic Sound Interface Device in the C64. Voted alongside the Pentium and Sun SPARC as a Top 20 of All Time Computer Chips: "In 1981, Bob Yannes was told to design a low-cost sound chip for the upcoming Commodore 64. He would end up creating an analog synthesizer chip that redefined the concept of sound in personal computers." What the composers and programmers ended up doing with the SID and 1MHz 6510 defied comprehension; the soundtracks of games were often works of art in their own right.

To get the C64 audio experience, I: downloaded WinRAR to unpack the "Complete HSVC 5.7" (.rar is smaller) , and finally to play it grabbed sidplay2, the recommended player. Since I have an Audigy soundcard I diligently spotted they have a SID Live! Experience (see "SID Tools" section below HVSC tools) to tweak around using the Audigy's Environmental Audio features (couldn't get this f*cker to work). There's even a winamp plugin to upload SID files to and control your C64 via a serial cable. Mental.

So, installed WinRAR, peeled open the massive rarchive, and went immediately hunting for Martin Galway (the HVSC is organised primarily by composer, Galway_Martin style). Fired up sidplay2, dragdropped arkanoid.sid onto it. Whooooo!!!! Oh, man, I am 15 again.

Definitely check the voted Top 100 SIDs especially to get started and get a feel for the popular composers Rob Hubbard, Ben Daglish, Martin Galway, Jeroen Tel (Maniacs of Noise), all whom were regarded by some of us as gods. Sidplay2 has quite a decent file/dir navigator under View->Directory-based UI (Alt+D).

Listening to Hawkeye's (screenshots, loader) game tune and loader riff is bringing me out in a cold sweat. In 1988 on my French exchange visit, I read, re-read, re-re-read, indeed learnt the damn thing "par coeur", the Zzap64! review of that truly jaw-dropping game–3weeks of waiting to get back to the UK to get this creation that every mag reviewer was salivating over. One of the few games I actually paid for :-) Ahhh, heady teenage emotions....

This journey has also had the satisfying side-effect of allowing me closure on a long-standing (six-year!) itch. Just how similar is the opening sample of BMX Kidz and Coldcut's Timber? Really goddam similar. (Click the green preview button on last.fm, and use sidplay to play the .sid)

Want more? Great collection of links to C64 sites.

Posted by Paul Makepeace at 21:44 | Comments (4) | TrackBack