I'm asking this here because what I'd like to do is something that pd does, so I suspect people here might know the answer. That is, you can have objects like delay that delay a bang or message. I'd like to, at first just for personal interest and pedagogical value, write a simple patcher-like system for managing the flow of events. I've tried to read some of the source code, but the size of it is overwhelming without some advice as to where in the source to read, and some idea of how pd is structured internally.
So suppose I wanted to write a pd-very-lite with no audio, just messages. The only objects would be 'bang', 'delay' and some kind of output (e.g. sending a midi CC or something). What sort of code do you have to write to get a reliable ms delay of an event?
More generally, again pedagogical value for now, how does one sequence midi events, or events in general, either when there is an audio thread to sync to, or without.