MidiClk is a high precision MIDI Clock tester/generator which allows you to check MIDI Clock timing accuracy and generate super stable MIDI Clock synchronous to the incoming MIDI Clock. With MidiClk you can finally use your DAW as a clock source for hardware sequencers, arpeggiators, and synthesizers!
Latest firmware: MidiClk_099 (use midiclk_pal.syx if your device has MIDIpal bootloader)
Source code: MidiClk_099_src
To switch between MIDI Clock Tester and MIDI Clock Generator modes, power up MidiGAL while holding down the switch.
In MIDI Clock Tester mode, MidiClk measures incoming MIDI Clock accuracy and stability. The clock accuracy is displayed as BPM value from 8 to 300BPM. Stability is displayed as standard deviation expressed as a percentage of the average BPM value. Both values are sampled over the period of four beats (96 MIDI clocks).
MIDI Clock Tester mode user interface:
- pressing the switch clears current statistics
- clicking the encoder immediately updates statistics which is automatically updated every second
- double clicking the encoder toggles “max” versus “current” standard deviation display
The picture below shows MidiGAL running MidiClk firmware connected to an old Alesis SR16 (1990) which appears to have reasonably good clock stability (0.5%), but lousy clock accuracy: 121.26 vs 120 BPM.
The same Alesis SR-16 running at 250 BPM into frequency meter which would measure precisely 100 Hz if SR-16 clock frequency would be exactly 250 BPM:
Note that 101.05 Hz average MIDI Clock frequency and 12.47 mHz standard deviation measured by the frequency meter perfectly match MidiClk Tester measurement for the same period: 101.05 Hz is equal to 252.625 BPM. Minor difference in standard deviation is caused by the fact that frequency meter calculated statistics over 1384 samples whereas MidiClk did it only over the last 96 samples.
In MIDI Clock Generator mode, MidiClk generates super stable MIDI clock with BPM selected by the encoder or measured by sampling MIDI Clock events received on MIDI IN.
MIDI Clock Generator mode user interface:
- pressing the switch starts/stops MIDI clock generator
- clicking the encoder toggles tempo selection mode (to a tenth of a beat)
- rotating the encoder selects configuration pages (see below)
- solid arrow to the left of the BPM count means clock generator has locked in on the incoming clock
- hollow arrow to the left of the BPM count means that the incoming clock is detected but not yet locked in on
- right arrow to the right of the BPM count means the slave device has been started
Pictures below show Clavia’s Nordbeat 2 Performance Step Sequencer running on iPad at 100 BPM connected to MidiGAL with MidiClk firmware via Griffin Technology StudioConnect Audio/MIDI interface:
First MidiGAL (with white on black LCD) shows quality of the MIDI clock coming from NordBeat2. As it is typical for software sequencers running on modern multitasking operating systems, the outgoing MIDI clock accuracy is good, however it’s stability is horrible: 1% or even worse. At 1% BPM varies from 99 to 101 during 4 beats!
Second MidiGAL (with black on yellow LCD) measures incoming clock frequency, rounds it to the closest integer BPM value, and generates synchronous stable clock. The number in the second line shows the difference between the number of MIDI Clock events received and sent. Since the computer-generated MIDI Clock instability is random, this number usually wanders around zero.
Third MidiGAL (with white on blue LCD) analyses stable MIDI clock generated by the second MidiGAL. As you can see, it’s two orders of magnitude better than the clock generated by NordBeat2 it started with. At 0.005% standard deviation it’s good for sample accurate rhythmic delays and instant groove!
To prove MidiClk generator accuracy and precision, here are results of MidiClk MIDI Clock Generator test after running at 250 BPM overnight. As you can see, frequency stayed close to 100.005 Hz during the entire test period, with the standard deviation less than 17 uHz.
Starting with firmware version 0.95 MidiClk supports Hold Mode which is inspired by Mutable Instruments MIDIpal Sync Latch mode, which, in turn, was inspired by the Mungo Sync. This mode allows the slave device to be temporarily stopped and re-started in sync with the master device playing a loop. In this mode the Start and Stop actions caused by pressing MidiClk switch are essentially quantized at the selected measure.
Step Length and Step Number pages specify duration and number of steps for the Hold Mode measure. For example, selecting a quarter note (1/4) and 4 will stop and restart slave device at the next bar measure.
Hold Mode page allows you to select if only Start or both Start and Stop actions will be quantized.
Other configuration pages
RoundBPM page forces measured BPM to an integer value. Set this to “on” if your MIDI Clock source is so unstable that it causes MIDI Clock tracker to jump to the nearest tenth of a beat value.
Threshold page specifies a numeric factor that defines when MidiClk decides that the input MIDI clock is stable. Set this to a minimal value that still allows the input clock icon (triangle arrow to the left of the BPM value) to be a black triangle most of the time.
ConstClk page specifies if MIDI Clock event are constantly sent to MIDI OUT or only between MIDI Start and Stop events.
PassThru page specifies if events other than MIDI Clock/Start/Continue/Stop are passed through to MidiClk’s MIDI OUT.
Strobe page specifies the width of the strobe pulse: 1ms to 5ms.
All the configuration parameter are saved in nonvolatile memory and remembered when MidiClk is switched off.
Starting with firmware version 0.96 MidiClk Clock Generator uses MidiGAL’s extension ports to output Sync24 signals:
- Pin2: ground
- Pin3: Sync24 (24 PPQN)
- Pin4: Step pulse (set by Step Length page to 1/64 triplet, 1/32 triplet, 1/32 note, 1/16 triplet, 1/16 note, etc… all the way to 2 whole notes)
- Pin5: Step count pulse (set by Step Count page to a number from 1 to 96 which multiplies the value set by Step Length page)
- Pin6: Start/Stop
Pins3-5 output positive going pulses with width specified by Strobe Width page whereas Pin6 goes high on Start/Continue and low on Stop. All signals are 0-5V.
The picture below shows pins 4 and 5 with Step Length set to 1/64, Step Number set to 4, running at 250 BPM with 1ms pulse width: