home/ atoms/ renardo-tempo-clock

Renardo's TempoClock pre-queues events 0.25 seconds early to compensate for processing latency

Renardo’s global Clock schedules all player events. To prevent jitter from processing overhead, events are pre-queued 0.25 seconds before their actual beat time (Clock.latency = 0.25 by default). If irregular beat lengths occur in practice, increasing latency (Clock.latency = 0.5) can help. Tempo changes (Clock.bpm = 140) take effect at the start of the next bar, not immediately, to keep TimeVar calculations coherent. Time signature is set with Clock.meter = (3, 4). Arbitrary functions can be scheduled via Clock.schedule(func, beat). Clock.clear() (bound to Ctrl+.) stops all players and cancels scheduled events.

Examples

Clock.bpm = 140
Clock.meter = (3, 4)          # waltz time
Clock.latency = 0.4           # increase if you hear jitter
Clock.schedule(lambda: print("bar!"), Clock.next_bar())

Assessment

Why does Clock.bpm = 180 take effect at the start of the next bar rather than immediately? What is Clock.latency and when would you adjust it?

“The `TempoClock` will begin processing the contents 0.25 seconds before it is *actually* meant to happen in case there is a large amount to process.”
corpus · renardo-python-over-supercollider-foxdot-successor-with-buil · chunk 80