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.

4 x MIDI Thru Box – A Simple DIY Project

I recently found myself in need of a MIDI thru box for my desktop synth setup and decided to build one from scratch. A MIDI thru box is a pretty simple device and at a total cost 15-20 euros for parts (including a home made circuit board), it’s a great choice if you are looking for a simple DIY electronics project.

Complete schematics, circuit board layout and part list for this build are available under the Creative Commons license on GitHub.

Design

Circuit board designed in Eagle CAD

Circuit board designed in Eagle CAD

A bit of research revealed that most MIDI thru box designs posted online are strikingly similar. So after a brief stop at my local electronics store to pick up some parts, I quickly prototyped the circuit on a breadboard and settled on a design.

Although the Hex Schmitt trigger I use can in fact drive 5 MIDI outputs, I chose to sacrifice one of them for an activity LED. Life is too short to troubleshoot MIDI connections, so this was an easy decision. If you have the need, another Hex Schmitt trigger could easy be added to the circuit for a total of 10 outputs (plus the activity LED).

Next step was documenting the schematic in Eagle. I have been wanting to switch to KiCad for a while but this project was simple enough for the free version of Eagle, so I put off learning a new CAD package once again. With the schematic in place, I moved on to the circuit board layout. I opted for a single-layered design because it’s considerably easier and cheaper to make single-sided circuit boards on your own.

Build

Etching the circuit board is by far the trickiest part of the process if you haven’t done it before. Unless you are willing to spend hundreds of euros on a specialized equipment such as an UV light box and an etching tank, you may find that quite a few failed attempts are needed before you get it right… but it can be done! Personally, I use the “photo resist” method with a regular 15 watt CFL bulb, a photo frame and a couple of plastic containers, all of which I picked up at IKEA for next to nothing. It took me an hour or so to make a near-perfect circuit board for this project, including holes for all the components and a makeshift silkscreen.

Making cheap DIY circuit boards on the kitchen table

Making cheap circuit boards on the kitchen table

After completing the circuit board, populating and soldering the components was a simple matter. I like to build and test individual sections of the circuit in isolation, so I started with the voltage regulator, then moved on to the MIDI input (including activity LED) and finally completed the MIDI outputs one by one – testing each section carefully along the way. It may take a bit longer to do it this way, but it eliminates the frustration of having to sort out multiple issues at the same time, which I often find myself doing if I populate and solder an entire board in one go.

Having built a working circuit, the only reaming task was to build an enclosure to protect it. I like to design pretty acrylic boxes for my DIY projects and have them manufactured by Ponoko, but since this box will be stowed away under my desk I opted for a more basic solution and simply cut two small pieces from a 3 mm plywood board I had lying around – one for the top and one for the bottom of the circuit board.

Finished MIDI thru box

Finished MIDI thru box

If someone would like to contribute an acrylic box design to this project I would be happy to add the drawings to the GitHub repository.

Conclusion

I have used the box for around 20 hours now and have not experienced any issues. There is no noticeable latency when playing notes and MIDI clock is tight.

If you are a green DIY enthusiasts who have put together a few kits and are looking to take it to the next level, this project is a good choice. You could use stripboard but I really recommend that you bite the bullet and learn how to etch your own circuit boards. I find that using “proper” circuit boards helps me avoid mistakes and makes my builds much more enjoyable.

Feel free to post a comment if you have questions or need help.