@Obineg said:
i wonder in which context you gonna need this.
Beats and bars.
Pd is a music tool but has no way built in to say, "I clicked on the start button at some arbitrary time, and I want the actual thing to start on the downbeat."
To do that, you need a clock with a time reference (otherwise there is no globally accessible concept of where the downbeat is).
Then you need something to pop out a message on time = a scheduler.
EDIT: I see, after the fact, that you can use timer to figure out elapsed time, round up, subtract and delay -- if Pd is in control of the timing. But if you're using abl_link~ or MIDI clock to sync with other devices, then Pd is not in exclusive control of the timing. In that case, advancing a scheduler by ticks is a good way to proceed (and you can substitute a metro in place of the external clock). So the one solution is "Pd is a solo universe" while the tick-scheduler is more general. (For that matter, in SuperCollider, all scheduling occurs in this type of queue. Implementing Ableton Link support was mainly a matter of replacing the internal beats-vs-seconds calculations with Link's and basically everything else worked for free -- LinkClock is a drop-in replacement for TempoClock. By contrast, a Pd patch based on Pd vanilla timing mechanisms only will be harder to adapt to Link, but a Pd patch based on a scheduler such as this one would be much simpler to adapt.)
hjh