I really really really want a monome, but even if I did have $1400, I’d still have to wait however many months before they become available. Now, I could just get a monome 64 or 128, but those are also pretty pricey for someone with no disposable income. I also wanted to see if this device would really help me create music more efficiently than my current non-tangible methods, or if I would just be wasting my money. monome releases a simple emulator that you can use to test how the device would work once in your hands, but it works via mouse clicks only and is purposely crippled out of principle (Update: Okay, Brian Crabtree, aka tehn, creator of the monome, assures me this wasn’t done intentionally- I forgive you Brian). But, considering the software is all free and open source, I figured instead that I’d attempt to build the cheapest monome clone I could… all I needed was a 2d grid of buttons. Hmm, a 2d grid of buttons, where could I find one of those…
Enter the keyboard: monome replacement?
It’s almost so obvious that it’s too obvious. We’ve been using these things for decades, and it turns out that they’re exactly that: a 2d grid of buttons. Of course, I can’t take all the credit; somebody already implemented this idea in Max/MSP. Problem was that it wasn’t working with the mlr app for me. Plus, what kind of nerd would I be if I didn’t try to do it myself?
So using a keyboard seems like the best way to emulate a monome. Granted, they don’t give you much LED light feedback action, but I could always just show that up on the screen. It’s not like I stare at my keyboard when I type anyway. Also, there are considerably less buttons than a 256, but I could easily get a good 32 solid buttons to play with.
As far as implementing the monomemulator went, I figured I would attempt to do it on my own, in a language I knew (I like the Max concept, but in the end, programming with a mouse is so tedious). I oddly chose to use the scripting language found in the mIRC chat client. I’ve made some crazy things in this language before, as well as some less crazy things, and in my opinion it was up for the task.
Why mIRC? Why not Max, PD, Ruby, Processing, Python, …?
mIRC scripting is sort of my comfort food when I want to prototype code. There are however two specific reasons that it’s perfect for the job:
- The mIRC community lacks smart people doing cool things (no offense to the few people doing cool things). This meant that I wouldn’t feel like I was re-inventing the wheel if I was to write an OpenSoundControl library for the language. Chance to contribute original code = extra points.
- mIRC may be an IRC client, but it actually has a rather extensive windowing library built-in. My entire implementation for the UI was about 12 lines of code. This probably beats out wxWidgets, Fox… Shoes? Maybe I’ll port it some other time. Considering it took 30 minutes including learning how to encode OSC messages, that’s not too bad.
The implementation actually ended up being 120 lines in total with the OSC library (a very simple/incomplete one) built in. You control the monome by simply hitting the keys shown in the above keyboard photo. Feedback for the LEDs are lit up using OSC messages as well. The UI for this emulator can actually expand to any grid size, so if you had a way to actually input 256 keys, you could just change the script up a bit to load it. You could even make it bigger; take that, monome.
alias -l monome_width { return 8 }
alias -l monome_height { return 4 }
The next few lines have options to change the prefix as well. Running the code with /monome gets you this (I’m running mlr in this screenshot as well):
Well. That’s about it. I actually played around with it for a bit and really liked the workflow. I might actually be up for making the plunge sometime soon, though I’ll try and save up for a 256.
If you’re interested in the script files involved you can grab em from here:
osc.mrc: OpenSoundControl library for mIRC
monome.mrc: The mIRC monome emulator