On 4/21/06, Perry R Cook
In the original MIDI, clock was just a one byte message that subdivided musical time into either 12ths of 24ths of quarter notes. That, combined with MIDI start and stop, allowed drum machines to talk to each other and sequencers, etc. It should be easy to implement this using our standard MIDI and event framework:
Sure, that would work for me. Wait for one of those messages, store "now", wait for the next, store the new now. Substract those two, chuck the result to "dur click" and my example code would run already, in essense. We could average them out depending on wether long-term smoothness or a fast reaction to clock modulations would be preferable. It's simple, it's consistent and syncing to drum machines will open the way for lots of jokes about "crash cymbals". I like it. One thing that has me a little woried is that currently incoming MIDI messages can be depended on to be three bytes. Clock messages aren't so if we are going to have this then from then on sorting MIDI notes and cc's will need to be done starting with the first byte because otherwise trying to build conditions on what msg.data2 or msg.data3 are is going to cause trouble since they won't be there. This might break existing code. Not the end of the world and your idea is certainly both more simple and more consistend then my own proposal. Yours, Kas.