Files
Sylpheed/docs/re/data/menu-bgm-loop-start.txt
sylph-decoder e1f2a7f714 re: the menu loop starts at 9.44 s -- measured, and the fix was scheduling
Tailing the log from BEFORE the music starts cut the unsampled backlog from 616
samples spanning offsets 32..2,559,033 to 125 spanning 32..515,239, so the first
pass is sampled like any later cycle. Offsets below loop_start play exactly once,
which is why the previous run could not measure them.

Wraps at 96.46 / 158.33 / 220.21 s, gaps 61.87 / 61.87, both contexts together.

Two derivations, neither converting bits to seconds:
  (a) time to read_offset crossing loop_start, plus a 1.33 s head correction at a
      rate measured on 748 timestamped samples of that same stretch
  (b) first pass (offset 32 -> loop_end) minus the cycle
Both give 9.44 s on both contexts -- four numbers, one value.

So the loop region is [9.44, 71.31] s of an 87.744 s wave, cycling every 61.87 s.
The first 9.44 s is an intro played once; the last 16.4 s, the fade-out
bgm-two-stems.md documents, is never played at all.

The decoder reads ahead of playback, but both endpoints are read_offset events so
the lead cancels in the difference. One boot, one bank.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
2026-08-30 10:13:14 +00:00

31 lines
1.4 KiB
Plaintext

# WHERE the menu loop starts -- measured, no bits-to-seconds conversion.
#
# 2026-08-30. tools/re-capture/menu_loop_firstpass.py. The fix over the
# previous run was scheduling, not analysis: tail the log from BEFORE the
# music starts, so the first pass is sampled at the same cadence as every
# later cycle. Offsets below loop_start are played exactly ONCE.
#
# Backlog compression, previous run vs this one:
# before: 616 samples at t=0.002 spanning offsets 32..2,559,033
# now: 125 samples at t=26.479 spanning offsets 32..515,239
#
# WRAPS: t = 96.46, 158.33, 220.21 gaps 61.87, 61.87 (both contexts, same
# instant, as they must be to stay sample-synchronous)
#
# TWO DERIVATIONS, both contexts:
# (a) time from offset 32 to read_offset crossing loop_start,
# with the unsampled head corrected at the LOCAL measured rate
# (387,823 / 377,440 bits/s over 748 timestamped samples):
# 8.11 s sampled + 1.33 s head = 9.44 s
# (b) first pass (offset 32 -> loop_end) minus the cycle:
# 70.0 + 1.33 - 61.87 = 9.44 s
#
# ctx0 -> 9.44 s ctx1 -> 9.44 s agreeing to the digit
#
# => LOOP REGION [9.44 s, 71.31 s] of an 87.744 s wave; cycle 61.87 s.
# The first 9.44 s is an intro played ONCE; the last 16.4 s -- the
# fade-out bgm-two-stems.md documents -- is NEVER played.
#
# The decoder reads ahead of playback, but both endpoints are read_offset
# events, so the lead cancels in the difference.