[sdiy] Bunching of MIDI clock messages
Neil Johnson
neil.johnson71 at gmail.com
Thu Sep 12 14:42:12 CEST 2013
Hi Richie,
I've seen some good and not-so-good suggestions so far. So here's my
own input on this (I'll leave it to you to decide on its goodness!)
Firstly, minimise processing in interrupt handlers. Interrupt
handlers should follow male shopping tactics: get in, get it, get out
FAST! Get the received byte out of the UART, store it in a buffer,
and bump a semaphore. Any MIDI data parsing should be done on the
other side of the buffer in normal mode. There is no reason this has
to be slow, and no reason to use polling.
Secondly, on the issue of MIDI clock, it sounds like what you need is
the software equivalent of a PLL that is slaved to the incoming MIDI
clock messages, with a loop filter to reduce the effects of jitter
from the remote "reference clock". If you just treat clock messages
as a guide for tempo then that's all you need to do. Then configure
your local PLLed tempo clock to provide whatever sync events you need,
and add whatever artificial "slop" you need to recreate what the
original instrument had.
Neil
--
http://www.njohnson.co.uk
More information about the Synth-diy
mailing list