[sdiy] Techniques for Multiplying MIDI Clock frequency?
brianw at audiobanshee.com
Fri Dec 24 00:37:30 CET 2021
On Dec 20, 2021, at 06:26, Tom Wiltshire <tom at electricdruid.net> wrote:
> I very much doubt this is a "hard limitation of 5 pin MIDI" as you put it. MIDI was *designed* specifically to work on 8-bit processors running at probably only 4 or 8MHz if you were lucky. However, in order to do that, certain things were assumed. One of those assumptions was that Realtime bytes would be dealt with directly in the Rx interrupt, which is why they're easy to filter, and why it doesn't matter that they can appear anywhere: the assumption is that by the time the parser sees the string of incoming bytes, Realtime will already have been removed.
> If a Z80 in 1984 can do it, there's no way it's not possible in 2021 on an Arduino. The problem is only the coding, and in this case, it seems like you're fighting against the Arduino MIDI library. The test with the Teensy basically proves that to me.
You're correct, Tom. I wrote code for a 1 MHz 6502 (on an Apple ][) in the eighties that could keep up with MIDI clocks just fine. Of course, a 1 MHz 6502 accesses memory 4 times as fast as the typical 4 MHz 8-bit processor, so they're in the same ballpark. I just wanted to mention that even clock speeds as low as 1 MHz are not too slow to handle MIDI.
The challenge here is software (or firmware) development. For a 1 MHz processor, it might even be necessary to write in assembly language. In contrast, using a high-level language like C++ along with high-level function libraries like Arduino, could easily piss away the power of a 48 MHz or faster AVR processor, such that things would not work reliably. It's a real challenge to design real-time software, but it's certainly worth the effect to learn how.
More information about the Synth-diy