Archaeopteryx: Ruby Self-Generating Pattern Sequencer from giles goat boy on Vimeo.

Who needs NAMM? Well, sure, you could wait 48 hours for the mind-bogglingly awesome announcements I’m sure we’ll be scooping on this site know absolutely nothing about. But that’s 48 hours you could be spending right now, coding your own sequencer. And unless Ableton and Steinberg and Apple and Digidesign and all are reading your thoughts, it may just do something they haven’t imagined yet.

Ah, you say, but wouldn’t that mean learning something ancient and arcane like C?

No, I’d say. You can do it Ruby, and impress that cute Web developer at the local indie coffee shop with the hip, new programming languages you’re using. (The Ruby developers in this crowd, I’m sure, have already skipped to the juicy bits, so let’s continue with this absurd role play.)

Ah, you say, but I need to learn to play an instrument and I’ve never coded before.

Fine, I say. But you can still rest easy at night knowing Giles Bowkett is doing it for you.

Giles Bowkett was seen, well, earlier today on this site using Ruby to create his own callbacks in the hexagonal grid generative sequencer Elysium. But he has a project of his own, coding something called Archaeopteryx. Coded in Ruby, which aside from being hip really does do a lot in a tiny amount of code, Archaeopteryx creates systems for “auto-generating, self modifying music.” Using inter-app MIDI on the Mac (possible via other methods on Linux and Windows), he drives traditional sound sources like Reason. That means the really ugly work of coding your own DSP is left to the professionals, while the compositional and creative work of figuring out which notes to play is entirely in his hands. And he evidently plans to open source the whole thing – giving entertaining talks on Ruby coding along the way at events like RubyFringe.

I think this is fantastic, and it demonstrates that making programming more accessible helps people who otherwise would never try coding their own projects do just that. That should inject more creativity and difference into the world of computer music-making, which is good for even the people who don’t ever touch this stuff. And if you’re learning Ruby as your day job, it gives you something really cool to do with it at night – provided you can stand at looking at still more code until you quit your day job, of course.

More on the topic:

Drive Propellerhead Reason With Ruby

Archaeopteryx: A Ruby MIDI Generator

And a full RubyFringe presentation with slides and all (can’t embed it, but worth a look if you’re into Ruby):

Archaeopteryx: A Ruby MIDI Generator [InfoQ]

Archaeopteryx Activating/Deactivating Clips In Live from giles goat boy on Vimeo.

He also goes into some thoughts about open source, business models, funding, and why Sasha should have open sourced the commissioned controller project. I stay out of things involving money or business models, though, because money sees me and goes off to cry itself to sleep in a corner.

Great stuff, Giles! I’m still partial to Java because I think it’s a more versatile platform overall – and I’m looking into ways of using Groovy to avoid the fingers-falling-off amount of code Java tends to require. But this gives me still more incentive to keep working. Thanks to composer Ted Pallas for the tip!

And I still think there’s a great argument for having simple scripting capabilities in tools like Ableton Live. Sometimes writing out code is better than assembling graphical patches. As code becomes more prevalent in our society, I expect it will pop up – and as Giles proves, there’s nothing stopping you from making it happen yourself. Even Giles took a space of a couple of years to get his project along. Spare time, no matter how tiny and fragmented, can be a powerful thing.

  • mar

    dead bird

  • "And I still think there’s a great argument for having simple scripting capabilities in tools like Ableton Live"

    — well there is(or was) check out vstlua.

    The web site seems to have gone away for downloading…but I've got v0.06Beta2 if anyone wants it..

  • debaser

    uhm…. not sure if i like it or not. but what about 'processing' is java based and simple, i've seen some really amazing audio/video stuff made with it.

  • karl

    I watched the entire RubyFringe Presentation, and although it was fun (and although I know a thing or two about Ruby) I would much rather use the CHUCK programming language for Live Coding.

  • "I’m still partial to Java because I think it’s a more versatile platform overall"

    That's why those of us in the know are using JRuby. Best of both worlds!

  • Martin

    Live already has scripting capabilities via python.

    The API doesn't cover everything but there is definitely scope to do some very interesting things.

    also if you're looking at Groovy for JVM based work then you should definitely check out Clojure as well.

    In particular the concept of sequences seems like a natural fit for a lot of music related tasks.

  • I wasn't too impressed with the generative drums stuff in the first video, and I was SUPER unimpressed with Ruby, but that second video of the app launching clips in live is absolutely brilliant.

    Perhaps the thing I liked most about it was (at least it seemed) that instead of fiddling around with pesky midi clock stuff, the app was just using the tap tempo. Very cute!

    I've been working on some generative stuff also, using Processing (although not using the Processing IDE). It generates random chord progressions and bass lines based on keys and something approximating flow charts. It's not nearly as nice as this, though…

  • Another language to check out is SuperCollider, which is actually quite similar to ruby (they share a common ancestor in SmallTalk).

  • Well, there's an easy answer – these are all brilliant coding tools. My own current preference is for Groovy on top of Java. I can use that to work with SuperCollider. And I prototype in Processing. So I suspect if I touch Ruby, I may *never finish anything again*. πŸ™‚

    That said, you can certainly see some commonalities between these environments, so in a way I don't think it really matters. I think it *does* matter that we have more elegant languages that don't require as much code, because we're able to work quickly.

    And the best would be to see more of what folks are working on in progress — impressive or not! (Impressive results, after all, often have humble beginnings.)

    We're working on some ways of you all showing and sharing stuff; stay tuned.

  • Also in Ruby, here's music.rb: It's a Ruby library with a simple expression type for representing polyphonic music. Here's an encoding of a Chopin prelude:…. It also a good tool for generative music, and plays with other libraries.

  • @Martin: Live does have an API; it's just not official or supported. And it could be friendlier. What if you could have a little script that could be assigned easily to a clip slot, and a little editor popped up? I come back to HyperTalk / HyperCard because it helped popularize this idea. That worked for kids. There ought to be a way to do it for grown-ups.

    Drawing patch cords isn't always the easiest way to accomplish things, particularly if interactivity — rather than sound (which is better suited to signal flow) — is the goal. I love both code and patching, and each can do the job of the other, but they do seem to be each suited to particular jobs.

    These resources are really great, guys — I'll be digging through them! This is what makes the site doubly worth doing. πŸ™‚

  • @Peter – cheers!

    @combatdave – there's more drums here, maybe more impressive I hope. it's true about the use of tap tempo – good enough to get the job done in many situations, so I can just go and get on to the next thing.

    btw – I might be switching Archaeopteryx over to use Jeremy Voorhis's Gamelan timing library. and on the Linux/Windows thing, people have definitely gotten Archaeopteryx to work on Windows, and I believe the same is true for Linux, although I'm not sure. It uses a platform-independent Ruby MIDI library called MIDIator, mainly by Ben Bleything and Topher Cyll. We also have MIDI *input* possible in Ruby as well, which means we get some fun stuff for free along with it (e.g., the WiiMote), thanks to a pair of programmers in Austria and Australia, Markus Prinz and Xavier Shay. There's a lot of cool whatnot going on in there, although fair warning, the code does get quite messy at times.

    As far as SuperCollider, Chuck, Java, JRuby, Groovy, Python, it's good to have more than one language out there. I posted a rant about how Chuck was just useless and for academics. Three days later a Chuck fan had convinced me that it had redeeming value and now a Chuck script he wrote is part of Archaeopteryx.

    Also on the whole generative music thing – I also used Archaeopteryx to generate simple meditation music at Burning Man last year. So although its rhythmic stuff works much better, it can also do melody and harmony to some extent. That code is very messy though and very far from finished.

    Well, that's probably all the self-promotion I can get away with. πŸ™‚

  • JohnG

    The guy is a bit of a moron though.

    See this rant

  • MattH

    There are a couple of Scheme/Lisp based environments for live coding / creative coding worth checking out:

    Impromptu is a (Mac only) live coding environment for music/visuals. See the gallery of live-coding screencasts (check out the "UMDT" or "Antiphony" pieces)
    for the mad live-coding skills of its creator (Andrew Sorensen) and the stylistic range that's possible in the environment. Seems free, but I don't see a license or a mention of source code.

    fluxus (Linux/Mac, also Scheme language) seems to have similar goals as impromptu, and the "FluxusSecrets" screencasts demonstrate how nice it is for live coding.

    Obvious downside for both is no Windows support :/

  • Martin

    @Peter, yeah i agree 100%. I really would like Ableton to embrace their own API and make it much easier to script the environment.

    It will be interesting to see what they announce at NAMM as part of the Cycling '74 partnership. Maybe that will affect the situation, maybe it wont.

    I think your idea of attaching a script to a clip is great but I guess that taking such a route would take resources away from their 'core product'..although i would also argue that a lot of the recent updates arent the best use of resources, instruments, sample packs etc, after all there is no shortage of plugins and samples available elsewhere.

    anyway, you've given me some ideas for a project im starting to put together (just the concepts at the moment). πŸ™‚

  • Thanks y'all — MattH, Giles, especially, for still more resources!

    The live coding stuff is super cool, but it's worth saying that that doesn't mean (lest anyone think otherwise) you *have* to live-code with these tools. So, for instance, if you're not into typing code onstage or are just too slow to pull that off (ahem, I'm a yea on both counts), that shouldn't stop you from using some of these tools to build an environment and then perform in a more traditional way.

  • lematt

    i just found this, it's awesome:

    especially for those who want to use ruby in max/msp

  • dan s.

    Sometimes writing out code is better than assembling graphical patches.

    Yes, as a professional programmer learning Pure Data, this is something that I find myself thinking over and over.

    BTW, Gotta love JohnG's timing…

  • JohnG

    Yes epic. But hey, first time I saw him take it back πŸ™‚

  • Roughly 20 years go, the other Tim Thompson wrote KeyKit, a dedicated MIDI language based one of the cleanest, purest scripting languages of the day: awk. the GUI is ugly as sin (written in keykit's own language) but pretty functional. Cross-platform before you kids even knew what that meant. Even comes with its own graphics-free interpreter ("lowkey") for use in other scripting languages.

    Main website:

    Tim is still busy doing lots of things that would be interesting to many CDM readers – check out his own home page @

  • @Paul: Well, sure, and actually it's worth noting that KeyKit had a functioning GUI, whereas in this case Ruby is just acting as the scripting language. I think it is reasonable, as well, to see the influence of awk (via Perl, etc.) on things like Groovy and Ruby, albeit translated to an object-oriented world, which I think is a good thing (and conceptually, objects aren't any newer).

    Having some sort of graphical interface could matter, even when scripting.

    Speaking of "cross-platform," is anyone else noticing the creeping effect of proprietary and OS-specific frameworks back into this stuff? I have nothing against that, necessarily, but it seems the first question should be, do I really need this Apple framework just to add a simple UI, or could I use something more flexible in this case? That's nothing against Cocoa or Apple or proprietary frameworks, I'm just wondering if we aren't missing out on some of the advantages of being cross-platform.

    PS, Paul, got share a booth with Tim at Maker Faire; hope to see him again soon (Tim, if you're out there, I'll be in SF this spring)…

  • "I posted a rant about how Chuck was just useless and for academics. Three days later a Chuck fan had convinced me that it had redeeming value and now a Chuck script he wrote is part of Archaeopteryx."

    That's fine. That post gave us the best promotional slogan for ChucK ever so as far as I'm concerned all is forgiven. ;¬)

  • Well, and here here — that someone took an opportunity. They could have blown Giles off for that rant, but instead they must have made an argument that helped convince him to come round to their way of thinking. I remember back in the darker days of the Mac, impassioned pleas to do just that, and I think it applies to anything you want to advocate.

    I think many things that have a reputation as being either "too academic" or, for that matter, "too commercial" sometimes don't get a fair shake. So the goal here is to embrace it all.

    Love the Cylon!

  • @Peter@Paul: the problem is, of course, that people start out on a given OS (and many/most of them start out on OS X). they figure out that Cocoa exists (along with its cousins like CoreMIDI, CoreGraphics etc), and are very well supported by Apple tools. they do a neat hack. people love it. then someone says "does this run on windows? how about linux?" and they such "errrrr…." Vendor tie-in via high quality tools is at least better than tie-in via low quality crap, but its still vendor tie-in, and for Apple, its <gollum>the precious</>

  • JohnG

    On an unrelated note, the big news in cross-platform land today is that Trolltech have announced that QT will be going LGPL. It's quite highly regarded and can be used to create apps that look native on all platforms so it will be interesting to see what comes of that.

  • Peter;

    "that someone took an opportunity. They could have blown Giles off for that rant, but instead they must have made an argument that helped convince him to come round to their way of thinking."

    I don't think this was a very complicated Question; I believe Giles's main issue was a perceived lack of MIDI support in ChucK while in fact MIDI works quite well once you've seen how. That wasn't a especially long debate, I think.

    "I think many things that have a reputation as being either “too academicâ€Β or, for that matter, “too commercialâ€Β sometimes don’t get a fair shake. So the goal here is to embrace it all."

    I agree, or at least "pick the bits we like". I didn't lose any sleep over this rant; one of my own main uses for ChucK is that it allowed me to write my own sequencer so I can improvise live house music in my own way (as in; starting with empty patterns). If that's too academic then I give up.

    Things probably could've gone more smoothly with a few emails to the ChucK-users lists about how MIDI works and about what practical, non-academic things people are doing with it instead of a rant but then again; to me this was a lot more amusing. I suspect some SuperCollider people secretly felt slighted that they weren't called "smart but lazy" as well; great fun, I put that quote on my MySpace in pride ;¬).

  • Pingback: Generating MIDI with Ruby - Hack a Day()

  • Jeremey H

    I read the Ruby code and it's some of the worst I've seen in an open source project. It's nothing but a thin ugly wrapper on the Ruby midiator library (which itself was borrowed from a book). As one commenter noted, the author's aversion to ChucK pretty clearly demonstrates his ignorance. I say stick with one of the real music generation environments (ChucK or SuperCollider) while this one fizzles and dies.

  • Pingback: Querystring » Generating MIDI with Ruby()

  • Pingback: Create Digital Music » Verlato: What if Musical Notes Had Their Own Programming Language?()

  • kiHuoS comment5 ,

  • Pingback: Grant Nestor » Blog Archive » Generative music, huh?()