I’m confident that I’ve found and fixed the source of the midi receive problems reported by @sam and @barksten. I just need to clean up the change and get that merged in.
On the clock front things are much more involved. I’m made two different attempts at using the incoming midi messages to build a “clock” signal but I was unhappy with the amount of jitter in the cycle, small amounts of drifting relative to the note gate on/off, and instability when running at high BPM values (the module was fine but the software clocking mechanism started to miss beats).
I have started looking into the possibility of adding a completely different clocking mechanism to the module code base - one which is built directly on top of the remaining unused timer/counter hardware. Ideally I can get the hardware timer to drive the “edge” output directly for a really stable hardware based clock (then use the incoming midi data to change the phase and period as needed to stay in sync). Doing this requires delving into hardware level details on the avr chip.