Skip to content

feat: audio clocks carry on across a microphone drop, on one run-wide synthetic clock (P-09, D701) - #157

Open
lnorton89 wants to merge 1 commit into
masterfrom
feat/p09-audio-clock-continuity
Open

lnorton89 wants to merge 1 commit into
masterfrom
feat/p09-audio-clock-continuity

Conversation

@lnorton89

Copy link
Copy Markdown
Owner

Builds backlog P-09, as the owner decided in D701 (R29).

  • One run clock for synthetic audio. AudioInput reads the synthetic track at its own run clock, advanced once a frame by the app's heard time (app.rs, D300). It no longer uses each caller's scene time, so every scene on synthetic audio hears the same moment, and a cue start no longer restarts its audio.
  • Clocks carry on across a switch of source. carry_clocks takes an offset at each switch so every clock continues from the value last shown: the six band clocks (syn_Time ... syn_CurvedTime) and the two beat clocks (syn_BeatTime, syn_BPMTwitcher). The beat clocks round to whole beats, never backwards. No allocation.

Tests:

  • every_clock_carries_on_across_live_to_synthetic_to_live_an_hour_in: an hour of synthetic audio, then a live frame with every clock elsewhere, then synthetic again. At each switch every clock moves less than a frame's step (a beat clock at most one whole beat) and never back.
  • Two existing tests now advance the run clock.

Checked:

  • strobe-app lib tests: 703 pass on Windows.
  • cargo test -p strobe-app in WSL with real GL: everything passes except one timing test in desktop.rs (the lease back-off), which this doesn't touch. It passed when re-run alone.
  • Clippy -D warnings, fmt and conventions are clean.

Not covered: the syn_BPMSin/Tri family follows the new source's beat phase, and a real device unplugged mid-show is still R-01.

@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @lnorton89's task in 20s —— View job


Review of PR #157

The change looks correct. I found no bugs and no violations of the house rules. carry_clocks and advance don't allocate, there is no unwrap or expect, and every lookup uses get/let else. Calling frame_at more than once in a frame is safe, because the offsets only change when the source changes.

Two things to check:

  • Downbeat and bars are not carried. The P-09 backlog work says "the downbeat offset by that number mod 4", and its acceptance says "the bars do not move". The code and test cover only the eight clocks. The backlog status admits "the downbeat is the analyser's", which weakens the acceptance wording. Either carry the bar and downbeat offset, or reword the acceptance line in docs/IMPLEMENTATION_BACKLOG.md so it doesn't promise it.
  • Roadmap. docs/ROADMAP.md has no mention of P-09. CLAUDE.md says to update it when finishing something, so add a line there if the roadmap tracks this area.

Minor: the live-to-synthetic test asserts at most one whole beat of movement for beat clocks, which matches ceil. The synthetic-to-live direction relies on the same bound, so the test covers both switches.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant