From 4dd6a3f325b5c79dbb9f3bdfcb475fd777905ce1 Mon Sep 17 00:00:00 2001 From: sylph-decoder Date: Sun, 30 Aug 2026 20:17:23 +0000 Subject: [PATCH] re: a bank's wave 1 is not a filtered copy of wave 0 -- and my own discriminator cannot finish the job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coherence on BGM_103, the menu's bank, with controls run first: a real linear filter of wave 0 reads 0.93-0.94 in every band, a different bank reads 0.001, and wave 0 misaligned by 1 s reads 0.004-0.057. The measurement reads 0.027 at 1-4 kHz, so the 'wave 1 is wave 0 filtered' model is refuted. The frequency structure is inverted relative to any mic-pair or reverb model: coherence rises with frequency (0.169 -> 0.827) while energy falls (71 % -> 0.2 %), and a rear pair decorrelates fastest at HF. In the midrange the two waves are 13x further apart than the two channels of one wave. But the L-R control is what limits the tool and it is recorded as such: within one wave, genuinely one performance in two channels, coherence is only 0.221-0.497. So 'same performance' does not imply high coherence here, my positive control was the wrong model of the rear-pair reading, and the 🟔 is NOT settled. The tool tests for linear filtering and neither surviving reading requires it. Also corrects MISSION's Q10 row, which still carried the refuted three-sub-wave premise and had directed work at a dead question for days. Its gate is in fact met. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v --- docs/port/MISSION.md | 33 +++++++++++- docs/re/REFUTED.md | 28 ++++++++++ docs/re/data/bgm-stem-coherence.txt | 71 ++++++++++++++++++++++++++ docs/re/structures/bgm-two-stems.md | 41 +++++++++++++++ tools/re-capture/bgm_stem_coherence.py | 71 ++++++++++++++++++++++++++ 5 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 docs/re/data/bgm-stem-coherence.txt create mode 100644 tools/re-capture/bgm_stem_coherence.py diff --git a/docs/port/MISSION.md b/docs/port/MISSION.md index 15be5c45..c3a8f9f4 100644 --- a/docs/port/MISSION.md +++ b/docs/port/MISSION.md @@ -74,7 +74,7 @@ alongside it. | **Q7** | **Transitions.** What happens visually between screens — the `pteff00.prm` quads, a fade, a cut — and its timing | Described and timed against a capture | | **Q8** | **Menu audio.** Which BGM per screen; which cue on move / confirm / back / error. The cue table is complete; the event binding is not | Cue names bound to events, with how you established each | | **Q9** | **Video binding.** Which movie is the boot intro vs the new-game intro; whether playback is skippable and what ends it | Named movies plus the playback rules | -| **Q10** | **What are a music bank's sub-waves?** `BGM_001.slb` is three sub-waves — 10 KB, 4.47 MB, 4.67 MB — and we currently **concatenate them blindly** into one 347 s track. Two near-equal halves could be intro + loop, or two variations, or two halves of one piece. A menu that loops its music needs to know which | The role of each sub-wave, established for at least the menu BGM. "Concatenate" is a decision, not a default — right now it is a default nobody chose | +| **Q10** | ~~**What are a music bank's sub-waves?**~~ āœ… **ANSWERED — see below.** Every factual premise in the original row is refuted: a bank is **two** waves, not three (the 10 KB was the bank *header*, emitted by our own reader), and the three candidate roles it listed — intro + loop, two variations, two halves — are all dead. | āœ… **Gate met.** Role established on the menu's own bank: [`bgm-two-stems.md`](../re/structures/bgm-two-stems.md). 🟔 One sub-question survives — *which kind* of second stem — and it is 🟔 by measurement, not by neglect | | **S1** | ~~**Ready Room probe.**~~ **DONE 2026-08-28 — [no-go](../re/ready-room-probe.md).** It is 2D and enumerates fine, but the pak is briefing/tactical-map content, not the Ready Room menu | āœ… go/no-go written | ## āœ… Emulator-side questions are NOT blocked — corrected 2026-08-30 @@ -290,6 +290,37 @@ What needs a decision is which way the divergence gets closed: Recorded rather than chosen, per "do not improvise around a blocker". +## āœ… Q10 is answered — corrected 2026-08-30 + +The Q10 row above was written on a premise that has since been **refuted in every +part**, and it survived as a live question for days after the refutation landed. +Recording the correction here rather than silently editing the row: + +* āŒ *"`BGM_001.slb` is three sub-waves (10 KB, 4.47 MB, 4.67 MB)"* — the 10 KB is + the **bank header**. Our reader emitted it, from a modulus valid only for a + header shorter than one XMA packet. A bank is **two** waves, **28/28** disc-wide. +* āŒ *"we currently concatenate them blindly"* — and concatenating is **wrong**, + now measured: the two waves are **sample-synchronous** and the running game + decodes **both at once** (the XMA probe at the main menu saw two stereo streams + whose byte sizes are `BGM_103`'s two declared waves, exactly). +* āŒ *"could be intro + loop, or two variations, or two halves of one piece"* — all + three predict unequal durations; **32 banks give equal ones**. +* āœ… **The gate — "the role of each sub-wave, established for at least the menu + BGM" — is met**, and on the menu's own bank: `BGM_103`, named from the + executable, confirmed against the disc and against the running game. + +🟔 **What is still open is narrower than the row**: *which kind* of second stem — +the rear pair of a 4-channel mix, or a second intensity layer. Both predict +simultaneity, so runtime observation cannot separate them, and a coherence +discriminator run 2026-08-30 **refuted the "filtered copy" model but could not +separate the two** — its own control showed that in this material even L vs R of +one performance reads only 0.22–0.50, so the test's premise does not hold. +[`../re/data/bgm-stem-coherence.txt`](../re/data/bgm-stem-coherence.txt) + +āš ļø **This distinction does not block the port.** Both readings give the same +instruction: play both waves, aligned at sample 0, together. It changes only how +they would be *mixed* if the port ever does surround. + ## Known unknowns — say so, do not fill them in Some of these may turn out to be undecodable. That is a valid, useful answer, and diff --git a/docs/re/REFUTED.md b/docs/re/REFUTED.md index ea7f6412..2b3d82c1 100644 --- a/docs/re/REFUTED.md +++ b/docs/re/REFUTED.md @@ -761,3 +761,31 @@ sweep phases — and the 350Ɨ396 logo ROI is **byte-identical across all of the (0 / 138 600 px differing, max |d| 0), reproduced in two independent sessions**, while 5–8 % of the whole frame moves as a contrast control. The sweep ink does not land on the logos. The ±1–2 residual is not sweep. + +### Music-bank stems (2026-08-30) + +* ~~"wave 1 is wave 0 put through a filter"~~ — āŒ **refuted** on `BGM_103` by + magnitude-squared coherence. A real linear filter of wave 0 reads **0.93–0.94** + in every band (positive control); the measurement reads **0.027** at 1–4 kHz. + No linear filter does that in a band where both waves carry energy. + [data](data/bgm-stem-coherence.txt) +* ~~"the rear-pair reading can be tested by coherence"~~ — āŒ **refuted, and it was + my own test's premise.** The control that matters — L vs R *within* one wave, + genuinely one performance in two channels — reads only **0.221–0.497**, so in + this material "same performance" does not imply high coherence. A 4-channel + mix's rear pair is not a linear filter of its front pair, so the discriminator + never had the power to separate the two readings. The 🟔 stands. + +### Refutation attempt on the corpus's "two stems of ONE PERFORMANCE" — 🟔 SURVIVED, WEAKENED (2026-08-30) + +**Target:** `structures/bgm-two-stems.md` (the `BGM_103` section is another +agent's), which reads the two waves as two stems *of one performance*. + +**My attempt:** if they are one performance, they should share signal structure; +coherence should be well above the independent floor across the bands carrying +the music. + +**Result: the claim survives, but one of its supporting readings is dead and the +bands carrying 96 % of the energy read 0.169 and 0.184** — far above the 0.001 +independent floor, so *not* independent, and far below a filtered copy. "One +performance" stands; "rear pair, i.e. a filtered view of the same mix" does not. diff --git a/docs/re/data/bgm-stem-coherence.txt b/docs/re/data/bgm-stem-coherence.txt new file mode 100644 index 00000000..5e529f9f --- /dev/null +++ b/docs/re/data/bgm-stem-coherence.txt @@ -0,0 +1,71 @@ +# Is a music bank's wave 1 the SAME instruments filtered, or DIFFERENT parts? +# BGM_103 (the menu's music) -- 2026-08-30 +# +# structures/bgm-two-stems.md leaves two readings alive for wave 1: the rear +# pair of a 4-channel mix, or a second intensity layer -- and correctly notes +# that runtime simultaneity cannot separate them, because both predict it. +# This is a static attempt at a discriminator. +# +# METHOD: magnitude-squared coherence, Welch, NFFT 8192 @ 48 kHz, 60 s window +# (702 segments, so the bias floor is ~1/702 = 0.0014). Coherence is ~1 wherever +# one signal is a LINEAR FILTER of the other and ~0 for independent signals. +# tools/re-capture/bgm_stem_coherence.py +# +# WAVES: slb_extract_wave.py BGM_103.slb 14336 1893 2 48000 (wave 0) +# slb_extract_wave.py BGM_103.slb 3903488 1919 2 48000 (wave 1) +# then ffmpeg -i x.riff x.wav. Both decode to 87.744 s, 4 211 729 frames. +# CONTROL BANK: BGM_104.slb 14336 1305 (a different piece, same codec). +# +CONTROLS + POS w0 vs linear-filter(w0) 0-0.2k 0.929 0.2-1k 0.938 1-4k 0.936 4-12k 0.938 12-16k 0.938 16-24k 0.937 + NEG w0 vs a different bank 0-0.2k 0.001 0.2-1k 0.001 1-4k 0.001 4-12k 0.001 12-16k 0.001 16-24k 0.002 + NEG w0 vs w0 shifted 1 s 0-0.2k 0.057 0.2-1k 0.048 1-4k 0.007 4-12k 0.019 12-16k 0.015 16-24k 0.004 + REF w0 L vs R (one perf.) 0-0.2k 0.321 0.2-1k 0.221 1-4k 0.363 4-12k 0.445 12-16k 0.497 16-24k 0.450 + REF w1 L vs R (one perf.) 0-0.2k 0.078 0.2-1k 0.051 1-4k 0.089 4-12k 0.411 12-16k 0.453 16-24k 0.455 + +MEASUREMENT + w0 vs w1 0-0.2k 0.169 0.2-1k 0.184 1-4k 0.027 4-12k 0.635 12-16k 0.768 16-24k 0.827 + +ENERGY SHARE + w0 0-0.2k 71.4% 0.2-1k 24.8% 1-4k 2.4% 4-12k 1.0% 12-16k 0.1% 16-24k 0.2% + w1 0-0.2k 53.8% 0.2-1k 40.9% 1-4k 2.3% 4-12k 2.1% 12-16k 0.3% 16-24k 0.6% + +# ------------------------------------------------------------------------------ +# READING IT +# +# āœ… THE INSTRUMENT IS CALIBRATED. A real linear filter of w0 reads 0.93-0.94 in +# every band; a different bank reads 0.001-0.002; w0 against itself misaligned by +# 1 s reads 0.004-0.057. So the estimator detects filtering and is not fooled by +# two pieces of music in the same codec. +# +# āŒ REFUTED: "wave 1 is wave 0 put through a filter." The positive control says +# a filter reads 0.936 at 1-4 kHz. The measurement reads 0.027 there. No linear +# filter produces that in a band where both waves carry energy. +# +# šŸ“Œ THE FREQUENCY STRUCTURE IS INVERTED relative to any mic-pair or reverb +# model. Coherence RISES with frequency -- 0.169, 0.184, 0.027, 0.635, 0.768, +# 0.827 -- while energy FALLS -- 71.4 %, 24.8 %, 2.4 %, 1.0 %, 0.1 %, 0.2 %. +# A rear pair or a reverb return decorrelates FASTEST at high frequency, which +# is the opposite. What is coherent lives in bands holding ~1.3 % of the energy; +# the bands holding 96 % of it read 0.169 and 0.184. +# +# šŸ“Œ AND IN THE MUSICAL MIDRANGE THE TWO WAVES ARE FURTHER APART THAN THE TWO +# CHANNELS OF ONE WAVE: 1-4 kHz gives 0.027 between waves against 0.363 for w0's +# own L vs R -- a factor of 13. Two channels of one performance agree far more +# than the two waves do. +# +# šŸ”“ BUT THE L-R CONTROL IS ALSO WHAT LIMITS THIS TOOL, AND IT KILLS THE CLEAN +# ANSWER. L vs R within a single wave is genuinely "one performance, two +# channels", and it reads only 0.221-0.497 -- nowhere near the 0.94 a filter +# gives. So in THIS material "same performance" does not imply high coherence, +# which means my positive control was the wrong model of the rear-pair reading: +# a real 4-channel mix's rear pair is not a linear filter of its front pair. +# +# => The filter model is dead. The two named readings are NOT separated. This +# tool cannot separate them, and the reason is stated rather than discovered +# later: it tests for linear filtering, and neither reading requires it. +# +# āš ļø REACH: one bank (BGM_103), one 60 s window, mono-summed for the coherence +# rows. Not run over the other 31 banks. The 16-24 kHz reading of 0.827 sits in +# 0.2-0.6 % of the energy and is unexplained -- it is NOT generic codec +# behaviour, since the different-bank control reads 0.002 in the same band. diff --git a/docs/re/structures/bgm-two-stems.md b/docs/re/structures/bgm-two-stems.md index 47ea5066..ceb207dd 100644 --- a/docs/re/structures/bgm-two-stems.md +++ b/docs/re/structures/bgm-two-stems.md @@ -92,6 +92,47 @@ twice, the second time as a bass-less secondary stem. decorrelated between L and R, and with the bass managed away to the front pair. * **A second intensity layer** to be mixed in or crossfaded. +### āŒ One of the two is now narrowed: wave 1 is NOT a filtered copy of wave 0 + +**measured 2026-08-30** — [`../data/bgm-stem-coherence.txt`](../data/bgm-stem-coherence.txt), +`tools/re-capture/bgm_stem_coherence.py`, on **`BGM_103`**, the menu's bank. + +Magnitude-squared coherence is ~1 wherever one signal is a **linear filter** of +the other. Controlled first: a real filter of wave 0 reads **0.93–0.94** in every +band, a different bank reads **0.001**, and wave 0 against itself misaligned by +1 s reads **0.004–0.057**. + +| band | w0 vs w1 | w0's own L vs R | energy in w0 | +|---|---|---|---| +| 0–200 Hz | 0.169 | 0.321 | 71.4 % | +| 200 Hz–1 kHz | 0.184 | 0.221 | 24.8 % | +| **1–4 kHz** | **0.027** | **0.363** | 2.4 % | +| 4–12 kHz | 0.635 | 0.445 | 1.0 % | +| 16–24 kHz | 0.827 | 0.450 | 0.2 % | + +āŒ **"Wave 1 is wave 0 filtered" is dead.** A filter reads 0.936 at 1–4 kHz; the +measurement reads **0.027**. + +šŸ“Œ **The frequency structure is inverted** relative to any mic-pair or reverb +model: coherence *rises* with frequency while energy *falls*. A rear pair or a +reverb return decorrelates fastest at HF. Whatever is coherent lives in bands +holding ~1.3 % of the energy; the bands holding 96 % of it read 0.169 and 0.184. + +šŸ“Œ **In the midrange the two waves are 13Ɨ further apart than the two channels of +one wave** — 0.027 against 0.363. + +šŸ”“ **But the same control kills the clean answer, so this does NOT settle the +🟔.** L vs R *within* one wave is genuinely one performance in two channels, and +it reads only **0.221–0.497** — nowhere near 0.94. So in this material "same +performance" does not imply high coherence, and my positive control was the wrong +model of the rear-pair reading: a real 4-channel mix's rear pair is not a linear +filter of its front pair. **The tool tests for linear filtering, and neither +surviving reading requires it.** Stated here rather than discovered later. + +āš ļø Reach: one bank, one 60 s window, mono-summed. The 16–24 kHz reading of 0.827 +is unexplained and is *not* generic codec behaviour — the different-bank control +reads 0.002 in that same band. + **Not settled, and the obvious field does not settle it.** `ChannelMask` is `0x0002` on *both* waves, and [`sound-slb.md`](sound-slb.md) already records that this game writes meaningless channel metadata (movie voices declare 2 channels diff --git a/tools/re-capture/bgm_stem_coherence.py b/tools/re-capture/bgm_stem_coherence.py new file mode 100644 index 00000000..f50ae715 --- /dev/null +++ b/tools/re-capture/bgm_stem_coherence.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +"""Are a music bank's two waves the SAME instruments filtered, or DIFFERENT parts? + +`structures/bgm-two-stems.md` leaves two readings alive for wave 1 -- the rear +pair of a 4-channel mix, or a second intensity layer -- and notes that runtime +simultaneity cannot separate them, since both predict it. + +This tries a static discriminator. Magnitude-squared coherence is ~1 wherever +one signal is a LINEAR FILTER of the other, and ~0 for independent signals, so +a rear pair modelled as "front pair, filtered" should read high and a different +arrangement layer should read low. + +āš ļø READ THE CONTROLS BEFORE THE MEASUREMENT. The L-vs-R control below is the +one that matters and it is the one that limits this tool: see the docs page. + + bgm_stem_coherence.py + +Waves come from slb_extract_wave.py + ffmpeg; see the docs page for the exact +offsets and packet counts. +""" +import sys, wave, numpy as np + +NFFT, HOP, FS = 8192, 4096, 48000 +BANDS = [(0,200),(200,1000),(1000,4000),(4000,12000),(12000,16000),(16000,24000)] + +def load(p, nmax, stereo=False): + w = wave.open(p); n = min(nmax, w.getnframes()) + a = np.frombuffer(w.readframes(n), dtype="=lo)&(f=lo)&(f