I think the timings are more relaxed when you take the required transfer time of a MIDI message into account. A three byte MIDI event requires 960 uS - nearly one milisecond. This means that the BankStick is 10 times faster than the transfer itself. Note also the MIOS provides a 48 byte transmit buffer which relaxes the timings even more, since in this way the bytes are sent in background and your application can continue to read from BankStick or to calculate the next events (I read that you plan some interpolation features for CC events…).
I also don’t think that your code has to read so much data from the BankStick during every MIDI clock when everything which is time critical is stored in RAM. The planned MB64seq port for example will be implemented in a different way compared to the PIC16F solution, but will work with a better performance. Of course, the possibilities will not be so powerfull like your plans, but I guess that the principle method, the skeleton will maybe open your eyes.
I’ve planned to realise it in following way
(this is only a short abstract from my ideas, if I would have to write all ideas, it would be faster for me just to program the assembler code in order to “document” what I mean — and every time I have to write more details, the day of release will be more delayed ;-)):
either the USER_Timer or the incoming MIDI clock triggers the sequencer with 24 ppqn (note: higher resolutions should also be possible). The timer itself doesn’t process the sequencer data at the same time, but only notifies to the main program that the pulse should be processed “as soon as possible”.
The main program checks if the sequencer has been triggered as often as possible. This handler will be called from USER_Tick - this hook is triggered ca. every 5-50 uS (microseconds) if nothing else is to do (no button event, no encoder event, no pot event, no MIDI event, no display event). If - for example - a button function has to execute a long running part of code, e.g. if it has to write something into the BankStick, the sequencer handler can also be called during every single write operation.
In this way extreme low latencies are guaranteed without any OS overhead.
What will the sequencer function do: anything you want
Mainly it will handle with a lot of delay counters, once a counter reaches zero, any action will be performed - sending MIDI events from BankStick or derived from RAM variables, or whatever…
Best Regards, Thorsten.