Game Of Life Sequencer in Processing from wesen on Vimeo.

Coding-for-artists tool Processing is already popular for visuals, but MIDI and sound have been a serious blind spot. Speaking of our friend Wesen of Ruin & Wesen, he has solved that with a new library called rwmidi, which makes MIDI programming far easier and more stable. He’s also solved the lack of proper Java MIDI support on Mac with the free OSXMidiSPI. You can download both from his site, under “Software > JAVA”:

Ruin & Wesen support downloads

Wesen today shares a screencast showing how you can build a sequencer using rwmidi and the classic Game of Life. For the record, the Game of Life dates all the way back to 1970 and British mathematician John Horton Conway. I really need to do some digging to track just how many computer musicians have applied the Game of Life to musical applications, but suffice to say, they’ve been doing it for quite some time – partly because you don’t need any computing power to make it work. Most recently, we’ve seen in synth form in the wonderful Reaktor ensemble by Lazyfish, Newschool (featured in Reaktor and included with the package), and as a kind of meta-effect from Audio Damage called Automaton.

What’s great about the Game of Life is that it helps you break out of endlessly-looping sequencers. Once you get the basic hang of this code, though, you’re by no means limited to the Game of Life. You could easily create other variations – perhaps a sequencer based on the game Breakout or Tetris, for instance. And this is a great introduction to using the rwmidi library if you prefer to learn from videos. Wesen promises more such tutorials in the future.

  • i had the same problem here as i did with Tiction: when using Reason, the gate would stay open en sound would continue to play while the pattern had stopped. i do not know much of Processing (just started), but looked through the code, applied some logic and wished for the best, and added a bit of my own code to implement a note-off event. and lo and behold, it worked. so for those who have the same problem, here's the new code:

    oh i made the screen twice as big as well, but you can change that to your own liking if you wish, at the top of the code.

  • oh damn i forgot, the code has also been changed to send MIDI over channel or port 2 instead of 0. this is because on my PC MIDIYoke channel 1 is number 2 here. so you can change that as well, somewhere over there.

  • Good library. Poor documentation.

    This library seems like it has potential, but the documentation is really poor. I cannot figure out how to access incoming CC message. Furthermore, the source code is not posted online for finding the answer.

    Thank you for the tip though.

  • yup sorry i have to write a few more examples, i've been super busy lately. The information you need is a bit "buried" in the documentation:

    Here's the list of standard messages you can register yourself to receive.

  • lematt

    that's ace !

    thank you wesen

  • jkant

    Hey thank you man!

    Sadly i can't get midi output devices with rwmidi in Tiger 10.4.11 (i've also installed the latest java and osxmidispi in java extensions)…

  • Hi jkant,

    I'll look into this. Can you tell me if you're using PPC or intel, and which kind of USB interface it is? Does it work if you have no MIDI interface plugged in and just have the IAC driver activated?

    Regards, Manuel

  • jkant

    Right, with no midi interfaces plugged in, i can see the IAC bus. It work!
    I'm on intel core 2 duo.
    Midi interfaces:
    midiman oxygen8 midi out
    NI rig kontrol midi out

    If you need help to debug feel free to use me 🙂


  • 4lefts


    excellent work – very useful just to show us processing ignorants how to implement life.

    though, i am having problems with getting midi output to work. this:
    MidiOutputDevice devices[] = RWMidi.getOutputDevices();
    for (int i = 0; i < devices.length; i++){
    println(i + ": " + devices[i].getName());
    prints only

    0: Real Time Sequencer Sun Microsystems
    1: Java Sound Synthesizer Sun Microsystems

    but not IAC busses, or the to/from max/msp ports. any ideas? i'm on ibook g4 on OSX.4.11

  • jkant


    please, try to unplug your usb midi devices and then listing ports…

  • Yes it seems that there is trouble with some usb interfaces, i have a few of those not working so i'll look into this. I mostly just use my own usb midi interfaces and they worked nicely. cheers, manuel

  • 4lefts

    thanks for the help guys – still no joy though. i have nothing plugged in to my computer at all – just me and the laptop…

  • Phil

    maybe you need something like midiyoke? something to route internal midi, that did it for me. and setting the right ports.

  • Yeah, I'm going to do a Windows MIDI loopback driver round-up soon (MIDI-Yoke, LoopBe, etc.) On Mac, go with the IAC bus — go to Audio MIDI Setup and enable IAC (double-click, check "enabled")

  • 4lefts

    i know this isn't really the place for me to debug my midiness, but here goes.
    i don't have any problems using the IAC busses between Live 7 and Max 5. it just seems the RWMidi library doesn't see them. which is a shame, because i have a major woody for some processing midi fonk.
    there's a sentence i never thought i'd type.

  • If you're not seeing MIDI drivers on Mac, you probably haven't installed the OSXMidiSPI. This is necessary because Apple does *not* properly support and maintain standard Java APIs and dropped MIDI support in their Java implementation. You'll find that file, as I said, on the support download site above. You need to make sure you have it in the proper folder (see the instructions included).

  • I suspect there is a subtle bug in osxmidispi and some usb devices. I don't really know what it's about yet but I will have a closer look tonight. Some devices don't show up even if midiosxspi is installed.
    I'll drop a comment here when I have it sorted out 🙂

    Cheers, manuel

  • Pingback: Coding a Game of Life sequencer in Processing |

  • jkant

    public void hope() {
    while (notSortedOut()) {


  • jkant, can you try out… ? I tried it on a G4 with 10.4.11, with a BCR2000, an oxygen, an EDIROL midisport and 2 tahorng midi links plugged it at the same time, and it listed them all (including IAC driver). If just made pretty minor changes. If it doesn't work at your place, we have to work something else out, can you then maybe contact me per email at ?

    Cheers, manuel

  • Pingback: Seq. Tests « A1029()

  • 4lefts

    wooooooo! that fixed it. i can now use tiction properly as well. thanks manuel!

  • cycadia

    inspired! now you've inspired me 🙂

  • Thanks for the tutorial Peter! For another example, here's my Whitney Music Box, implemented in Processing, using rwMidi.

  • Pingback: Create Digital Music » Sonic Life, Organic Game of Life Sequencer, Hits iPhone and iPod()

  • This is great stuff. It inspired me to create this :

    If the cell's state is not just simply on or off, but a number in a range then you get all sorts of interesting musical runs and trills. You can also clearly see the connection between the colours and the sound.

  • Pingback: Create Digital Music » Help! I’m Trapped in an Acid-Colored Wash of a Thousand General MIDI Pianos!()

  • YJ

    i will take credit for bringing up Peter's awareness of the Lazyfish Reaktor ensemble.
    Thank you.

  • Just a hint – if you want to receive all NOTE OFF events with RWMidi, you should also watch for NOTE ON events where the Velocity is 0.

  • Sai

    hey guys , very interesting tutorial
    when i put the code in processing after i got the osxmdispi file it says rwmidi package does not exist ? any clue where i should copy this package?  
    thanks in advance

  • Pingback: Patch Cords, Buttons, Pixels, Noise: Free Modular Code-bending Instruments as Playgrounds()

  • Pingback: Patch Cords, Buttons, Pixels, Noise: Free Modular Code-bending Instruments as Playgrounds - machine quotidienne()