[sdiy] Techniques for Multiplying MIDI Clock frequency?

Brian Willoughby brianw at audiobanshee.com
Sat Dec 18 21:40:42 CET 2021


Has anyone documented these lost clock steps from the Boss DR-202 or other groove boxes? Is it a known problem, and does anyone know why it happens? If there's an online article, I'd be curious to read about it.


One thing you might try, if you aren't already, is to write "bare metal" firmware without any of the Arduino overhead.

An important thing to consider about the MIDI Standard is that all messages involving timing are single-byte messages that can be handled immediately, with very fast code. Most MIDI messages are 2 or 3 (or more) bytes long, so the typical code collects bytes from the serial interface via an interrupt, and then runs a parser to collect together bytes into messages. Depending upon how the interrupt code and non-interrupt code is written, this parsing can create delays between the arrival of the MIDI data and the action(s) taken.

Careful code design allows the System Real Time Messages to be taken out of the parser and handled immediately by special code, which will minimize the jitter or other delays due to software. Unless someone has design a very capable MIDI interrupt handler into the Arduino system, you're not going to get the best performance without replacing that.

Depending upon the requirements, you can even write the interrupt handler in assembly language to reduce the code delays to the absolute minimum. This isn't always necessary, but some processors and compiler tools generate tons of overhead that just wastes a bunch of time (in order to make the coding "easier").


Questions:

Does the DR-202 mix Notes messages with System Real Time Messages?

Do the plain vanilla drum machines use MIDI or DIN sync?

Do any of these use MIDI Song Position Pointer (or MIDI Time Code)?


Brian

On Dec 18, 2021, at 12:12, Benjamin Tremblay <btremblay at me.com> wrote:
> One thing that discouraged me was MIDI clock coming from my Boss DR-202.  When I play a complex pattern on that thing, I start losing clock steps. I could not figure out why, so I gave up on multiplying the clock.
> If I use a plain vanilla drum machine (as opposed to a groove box), it seems to work okay.
> 
> I wrote this code for Arduino Mega, and then tried it with Teensy, but either way it has the same problems.
> 
> So, two different problems. 
> 1) MIDI clock dropping out on groove boxes. 





More information about the Synth-diy mailing list