Coding a Custom Step Sequencer

I have been wanting to code my own customer step sequencer for a while. A couple of weeks ago I finally dived in to the project. I knew I wanted to use a lightweight scripting language for the project an started out with Python. But after trying out a couple of Midi libraries I got frustrated and switched to Ruby with UniMidi.

UniMidi actually works pretty well, and I was able to write a fairly complete 8 track step sequencer for my Novation LaunchPad Mini in about 20 hours. The source code is available on github.  I also made a track where I used this sequencer to control my Volca Sample, and it worked out great.

Last week I decided to take things a bit further and ordered a Novation LaunchControl from Thomann. I figured this controller would be perfect fit for my needs: The silicon pads can be used to mute/unmute the 8 tracks and the 2 x 8 knobs can be set to control volume and pan of the corresponding Volca Sample channels (I’m actually using the right output on the Volca Sample as an effect send, so the pan knob acts as dry/wet balance).

I made another track with this setup and it worked out great… I will be needing a second LaunchControl for my Volca Beats before long. Or maybe I should get hold of some silicon pads and build a more customised midi controller…

I hit some snags with my Ruby/UniMidi setup though. Things work reasonably well as long as I sync to an external clock, but I have not been able to implement a 100% stable internal clock with the Ruby Sleep() function. The internal clock works OK most of the time, but sometimes the tempo drops by maybe 10% for 20 seconds or so… probably because some background task kicks in on my MacBook.

I really want to take this project further and eventually I hope to build a complete sequencer for my hardware setup. While playing around with Ruby and UniMidi has been fun, it is clear to me that I will need another platform to reach this goal.

I initially discounted Max/MSP because I really dislike visual programming languages. I spend my days developing software professionally and I like to write code in a text editor. But after doing some more research, I realised that Max actually has a javascript object and that it is possible to create extensions if you want and this has put me at ease.  At least I will have an alternative to huge canvases with a million visual objects and connections.

I’m still not sure if I want to go with live Max for Live or a “pure” Max setup for this project, but I will be doing some research.

Hacking a Remote Codec for the Launchpad Mini

42514I decided that I need a better way to select patterns/loops on Reason devices such as Redrum, Matrix and Dr. Octo Rex during live performances.

I know the Livid Ohm64 will do the job and it looks super cool but it’s expensive too. And since I already have a nanoKontrol2 which I’m quite happy with, the Ohm64 seemed like a bit of an overkill.

After a bit of online research I decided on a Novation Launchpad instead and went off to my local music store to get one. I looked at both the full-size “S” model and the “Mini”, both of which I knew to be supported by Reason from my research.

I decided on the Launchpad Mini. I’m OK with the small buttons and I only have so much space on my desktop… plus it’s a bit cheaper than its bigger brother, so what’s not to like?

Well… it turns out that Novation did’t bother implementing their AutoMap software for the Launchpad Mini. And they are not providing any remote codecs for Reason either. So the Launchpad Mini basically just works like a keyboard in Reason… and it’s not even velocity sensitive!

So much for the advertised “Reason support”.

It is  possible to map buttons in Reason to the Launchpad Mini of course, but the buttons on the control surface don’t light up and show the “state” of the software, which was what I expected.

Bummer.

Luckily I applied for access to the Propellerhead Remote SDK a while back and decided to get my hands dirty.

I haven’t actually used the Remote SDK before and it turned out that the most difficult and frustrating part of developing my first remote codec was actually figuring out how to download the SDK! Let’s just say that the Propellerhead developer support could be better…

After I got hold of the SDK things were actually pretty straight forward. It probably took me 7-8 hours to figure everything out and put together the codec. I have absolutely no love for Lua but the Remote API is clean and logical, and the documentation provided in the SDK is pretty good.

I decided to implement most buttons on the Launchpad Mini as simple toggle buttons. Since I plan to map individual Launchpad buttons to different devices in Reason, I decided not to map the buttons to anything by default. I wouldn’t make sense, really.

For the top row of round buttons on the Launchpad Mini (labelled 1-8) I decided to do something special. Rather than acting as toggle buttons, these buttons are mapped to the bar position in Reason: As the song pointer in Reason moves from bar 1 to bar 8, these buttons light up one by one. When the song pointer hits bar 9, the Launchpad “wraps around” and starts from 1 again.

Very cool, if you ask me. I tend to structure the music I make in 8 bar sections and I find that having a visual cue like this during a busy live performance is very useful. This way, I can focus on other aspects of the performance without losing track of the bar count.

The codec can be downloaded from the GitHub. Enjoy!