I’m planning to release PCBs, chip sets and, potentially, a full kit for this module in 2018. It’d be a great help to me if you’d spare the time to tell me whether this would be of interest to you (there’s a form at the bottom of the article).
I’ve set my self a target for this year – by the time 2018 rolls around, I want to have a live performance setup that has no laptop computer in it.
This brings challenges, as at the moment my laptop (and the Ableton Live software that it plays host to) performs a number of valuable tasks, not least of which is keeping everything (instruments, effects, etc) in sync and running to the same tempo clock.
So, as a first step along the road to freedom from a computer, I chose to address the clock issue. Could I create a clock module that would work for both MIDI and my voltage-controlled analog equipment?
Being from a software-design background, the first thing I did was create a specification:
- Clock must output the same tempo to MIDI and CV (control voltage)
- It should work with it’s own, internal clock source and, optionally, be able to “slave” to an external MIDI clock
- It must recognise (and be able to generate) MIDI stop and start messages, and stop and start the CV clock pulse too
- Tempo must be adjustable on-the-fly, in real time
- There should be visual feedback for current tempo, whether it’s running on internal or external clock, a “pulse” for the current tempo and whether the clock is currently running
I identified fairly early on that this could all be achieved using an ATMega328 microcontroller chip (also known as “Arduino“) via some fairly straighforward programming. All of the individual parts of the software puzzle had already been solved by other people, it was largely just a matter of stitching all of the relevant bits of sample code together.
I decided to utilise a rotary encoder with a built-in push-switch for setting the tempo and starting and stopping the clock. A 4-digit, 7-segment LED display would provide all of the visual feedback.
To develop the software I used an Arduino Nano clone, and started hooking up peripherals (initially just the encoder, display and a toggle switch for internal/external clock) on a breadboard.
At this stage the clock could receive external MIDI, toggle between internal and external modes, I could set a tempo and start/stop the clock. Lots of really great progress quite early on.
However… Arduino runs on 5 volts. My modular environment runs on 12 volts. So, there’d need to be a power converter in the design. Additionally, Arduino outputs 5v from it’s digital outputs. CV signals are typically up to about 10 volts for clock signals, so I’d have to design in a way of boosting the Arduino’s output.
And, as is always the case, the specification expanded a bit along the way:
- It’d be really handy if the gadget remembered the last tempo it was set at when it’s turned off
- How about being able to set the tempo by tapping a switch in time with some music?
- And wouldn’t it be nice if you could do that from a footswitch?
- And if we’re doing that – why not have start/stop on a footswitch, too?
- Outputting a CV clock pulse is great – but having options for whole, half, quarter, eighth beats would be really useful
I decided to split the project into two boards at this point; one to handle the basic clock mechanics and a second board (with a second ATMega328 chip) to handle converting MIDI to CV and dividing the output into a whole bunch of different clock divisions. That way, I could keep the code compact and efficient on the clock board and not have to worry about using up all of my available I/O pins.
To solve the “remembering the tempo” feature, I could write the tempo to the chip’s on-board non-volatile memory (EEPROM). However, there’s a limit of about 100,000 writes to this before it fails. If I simply wrote to it every time the rotary encoder read a change in state it would
- Slow the code execution down
- Burn through those 100,000 writes in no time
Fortunately, this had been solved already – I found a forum post that described a way of detecting the voltage drop on power-off, and which showed how to buffer enough charge in a capacitor to allow the chip the few milliseconds it needed to write to the EEPROM when it sensed the power going out.
Before too long I had a finished breadboard for the clock module, which I converted into a schematic and built a finished board from. I used my homemade Arduino Programmer to burn the chip and then put it to one side and started breadboarding the CV clock divider board.
Again, this turned out to be pretty straightforward, just a case of counting the incoming MIDI clock ticks and pulsing a square wave to the Arduino’s digital output pins. The conversion of 5V to 10V outputs was handled by a sketched schematic in a forum post, which also provided details about output protection. This breadboard went together very quickly as I only had to prove the principle for a single output – I could then just duplicate the basic circuit to the other outputs. I decided that the outputs would be
- Whole note
- Half note
- Quarter note
- Eighth note
- Sixteen note
- Thirty-second note
I designed in a half-dozen expansion pins on the board so that if I want to, I can extend this in the future.
The rest of the job was just down to mechanics – actually building the thing. I used my usual approach for the panel, the only novel part of the panel build being the rectangular opening that I had to cut for the 7-segment display. I used a fret saw for this and it turned out really nicely (much better than I expected it to, to be honest). The display was mounted using a load of hot glue, everything else just went in as usual.
This is now the main entry-point for MIDI into my DIY modular system. The MIDI clock, together with any incoming MIDI messages is sent to the MIDI breakout board for use by other MIDI-aware modules, and everything is “thru’d” to the MIDI output – so all of my external MIDI gear (and my laptop!) can be slaved to it. The clock divider outputs deliver 0 to 10V square-wave pulses when the clock is running, giving me ample CV outputs to run my sequencer and sample-and-hold modules at differing rates. User interaction is clearly marked, visually economical and obvious at-a-glance and settings are held through power-down cycles.
The clock itself is very stable – the measurements that I did using the MIDI-OX diagnostic tool suggest that this clock is rather more stable and accurate than the clocks in most of my existing MIDI gear!
The result is everything that I could have wanted from this module. This track is the first outing for it, where it’s syncing
- Roland MX-1 (MIDI)
- Ableton Live (via MX-1)
- Arturia MiniBrute (via MIDI Thru Box)
- Arturia BeatStep (via Ableton)
- YuSynth ADSR (CV)
- Music Thing Modular Turing Machine (CV)
Schematic (Master Clock Board)
Schematic (Master Clock Panel)
Master Clock stripboard layout
Master Clock stripboard layout (flipped)
Schematic (Clock Divider Board)
Schematic (Clock Divider Panel)
Clock Divider stripboard layout
Clock Divider stripboard layout (flipped)
My panel design and cutting guide are available below as 600dpi PDF files. Note that I’ve not included holes for mounting hardware in the cutting guide as these can vary from system to system, depending on your mount/rails/bit of timber of choice. Note also that I use M4 PCB standoffs – you might want to cut the 4mm holes to a different diameter, depending on your standoff of choice.
Panel Cutting Guide
Interested in building this project?
I’m in the process of designing and procuring PCBs for this project; if you’d be interested in buying a PCB, pre-programmed chips or a full kit of parts please let me know using the form below – it will help me to gauge what level to pitch the initial release at, what format to design for, etc.