Skip to content

feat: add clock_ticker for apps that only need the tick count - #644

Merged
ArthurGibert merged 1 commit into
ATOVproject:mainfrom
kosmar:feat/app-clock-ticker
Aug 14, 2026
Merged

feat: add clock_ticker for apps that only need the tick count#644
ArthurGibert merged 1 commit into
ATOVproject:mainfrom
kosmar:feat/app-clock-ticker

Conversation

@kosmar

@kosmar kosmar commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Split out of #638 at Arthur's request: clock_ticker is additive API and has nothing to do with the pubsub/metronome fix.

App::clock_ticker() hands an app a plain fn() -> u64 that reads the current 24 PPQN tick out of TICK_COUNTER. Apps that derive everything from the tick number and never react to Start/Stop/Reset can use it instead of use_clock(): it costs no CLOCK_PUBSUB subscriber slot, and an app that falls behind cannot back up the shared clock queue. u64::MAX means “not started”; the counter going backwards means the clock was restarted or reset.

It is #[allow(dead_code)] on main — the first users are the WIP app branches, where a clocked app that also awaits a MAX write or a MIDI send inside its loop is exactly the subscriber that used to stall the gatekeeper.

Stacked on #638 (which is itself stacked on #636), because TICK_COUNTER is introduced there. Cross-repo PRs can only target main, so this diff shows all three commits; merge #636 and #638 first and it shrinks to the app.rs change alone.

No test checklist: this adds an unused accessor and changes no behaviour on its own.

Opened by an AI coding agent on @kosmar's behalf.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ArthurGibert

ArthurGibert commented Aug 14, 2026

Copy link
Copy Markdown
Member

I rebased on main so that the merge of this PR doesn't depend on the approval of the other PRs.

PR is justified and applications are real. That's an approval as far as I'm concerned.

@chmanie Let me know what you think

@ArthurGibert
ArthurGibert merged commit a47c615 into ATOVproject:main Aug 14, 2026
3 checks passed
@ArthurGibert

Copy link
Copy Markdown
Member

This was merged by mistake — merging a stacked PR directly onto main pulled in the full 3-commit stack (#636, #638, and this one) in a single squash commit, without #636/#638 going through their own review and merge. It's been reverted from main (force-pushed back to the pre-merge commit). Reopened with identical content as #646.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants