# Where the frontier is on finding loop points, and what it says about `detect.ts` A survey of 2024–2026 work, read against the three things the detector actually gets wrong on real files. It is written to be additive to `RESEARCH-loops-to-the-beat.md` rather than a repeat of it: that document's §11 already contains the correct diagnosis — _"nothing about the floor, the tail quantile or the beat grid will fix that pair; they are all downstream of a representation where every frame resembles every other"_ — and the literature has since moved in exactly that direction, with numbers attached. Two things up front, because they decide how much of this is usable: - **The beat half of the problem is already essentially solved here.** The app ships `beat-this-small0` (CPJKU/beat_this, ISMIR 2024, MIT code _and_ weights), which is within ~1 point of the published state of the art on GTZAN. Every 2025–26 tracker worth naming gains 0.5–2 points on that benchmark, and the MIREX 2025 leader (92.53) got there by training on the test set — a practice MIREX has announced it will disallow. **Do not spend the next quarter here.** The one idea worth stealing from that literature is architectural (§2), not accuracy. - **The loop half is not a benchmarked task.** There is no MIREX task for "find the A–B region that loops seamlessly", nobody publishes a loop-point F1, and the loop papers (LoopMaker, LooperGP, LoopGen) all evaluate with listening tests. So the frontier has to be read as _techniques validated on neighbouring tasks_, and the calibration sitting in `docs/research/calibrate-loops.md` stays the only real ground truth available. --- ## 1. The representation is the frontier, and it moved on measurable evidence Your §11 finding is that the twelve pitch classes of a full mix cannot separate frames: every track's own 98th-percentile lag score lands in 0.955–0.998, `floor` is never consulted, and the typicality weights came out exactly `1.00 × 12` on every input ever tried. `presence` is a hand-built attempt to buy back separability. The MIR community's answer to that problem, in 2025–26, is foundational audio encoders (FAEs): self-supervised encoders pretrained on music, used frozen, with a trivial head on top. **Sony's MSA-bench, _"Do Foundational Audio Encoders Understand Music Structure?"_ (arXiv 2512.17209, [code](https://github.com/sony/MSA-bench))** compared 11 FAEs on music structure analysis with the _deliberately_ dumb backend — a single linear layer, so all long-range ability must come from the encoder itself. The findings that bear on a similarity surface: | finding | why it matters to `detect.ts` | | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | | MLM-on-music dominates: MusicFM top-2 on every metric, AudioMAE(Zhong) top-2 on boundaries, MERT-330M strongest at functional labels | the win is not model size, it is the pretraining objective and the training data | | supervised encoders (PANNs, PaSST) cannot match music MLM models | a supervised tagger is the wrong thing to reach for | | MULE (contrastive, 0.5 Hz frames) has _bad_ boundary detection "likely due to its coarse frame rate and the resulting blurred boundaries" | frame rate is a real constraint on any boundary claim — see §1.1 | | codec tokenizers (EnCodec, DAC) at high frame rate also hurt | more frames is not better either; there is a middle | | "a high frame rate is not essential": MERT 75 Hz, MusicFM 25 Hz, AudioMAE(Zhong) 6.25 Hz are all top-3 | you are not obliged to run a 75 Hz feature in a worker | | pooling to the label rate **shifts boundary positions** and can degrade HR.5F | directly relevant to beat-pooling a boundary (`poolToBeats`) — a beat-quantised boundary is a _rounded_ one | **SongFormer (arXiv 2510.02797, [code](https://github.com/ASLP-lab/SongFormer), Oct 2025)** is the current SOTA on strict boundaries. Method: fuse **MuQ** and **MusicFM** at two temporal resolutions — 30 s windows (the models' own training context) concatenated to full-song length, plus a genuine 420 s pass — downsample to ~8.33 Hz with a depthwise-pooling residual block, 4-layer RoPE transformer, two heads, BCE + a boundary-aware total-variation loss, peak-picking at inference. On SongFormBench/HarmonixSet: **HR.5F 0.703** against LinkSeg 0.630 and All-In-One 0.596; and Gemini 2.5 Pro, the obvious "just ask a big model" baseline, gets **HR.5F 0.423** while beating everyone at the sloppy HR3F — i.e. an audio LLM will tell you about your song's form and be off by more than half a second on a third of the boundaries. 2–4 s per song on an L40. It also ships **SongFormDB (~10–14k songs)** and **SongFormBench (300 expert-verified songs)** — the first usable training data for a boundary head. **MuQ (arXiv 2501.01108, [code](https://github.com/tencent-ailab/MuQ))** is the encoder SongFormer leans on: Mel-RVQ pseudo-targets instead of EnCodec/CQT teachers, SOTA on MARBLE with 0.9k hours, and it beats MERT and MusicFM on **music structure analysis** among other tasks. Caveats worth recording before anyone benchmarks it: the open checkpoint is `OpenMuQ/MuQ-large-msd-iter`, ~300M params, trained on MSD rather than the paper's 160k hours, and the repo states plainly that it "may not achieve the same level of performance as reported"; input is strictly 24 kHz; fp32 recommended. ### 1.1 Why this is the fix for _your_ specific defect, and the risk that it isn't The mechanism your chroma relies on — fold harmonics across octaves so "second chorus with the bass an octave up and a different cymbal" reads as the same vector — is a hand-designed invariance. An MLM music encoder learns that invariance, and gets timbre/instrumentation robustness with it, which is why these encoders win boundary F1 with a _linear_ head on top. The `presence` gate and the typicality weights are attempting to reconstruct, downstream, separability the representation should have had. The honest counter-risk, and it is not small: these encoders are **contextualised transformers**. Every frame attends to its neighbours inside a 30 s window, so a frame's vector is partly a summary of its context — which is a mechanism for making neighbouring frames _more_ alike, not less. Two consequences to measure rather than assume: - the tail could collapse the same way it does now, in a different basis. Per-lag scores on real material are the thing to print, and printing them costs nothing (§7, L1). - a windowed encoder makes "copy vs copy" a different question than it is today: two copies read from different positions in the track carry different context, which could either wash out the difference you want or manufacture similarity between distant frames. Mitigations the literature supports: read an **early** layer, not the last (MuFun, arXiv 2508.01178, concatenates layers 0/7/15/32 precisely because early layers keep "low-level acoustic details like timbre and pitch" while deep ones hold abstraction; SoniDo, arXiv 2411.01135, improves four downstream tasks by injecting intermediate features); and **concatenate rather than replace** — `[SSL || chroma || RMS]`, keeping the representation you can already reason about and letting the tail tell you which half earned its place. --- ## 2. Beat and downbeat: one step behind, and the step is architectural For the record, GTZAN (beat F1 / downbeat F1), as published by the respective authors — note these are not strictly comparable across papers (test-set sizes differ; MIREX 2025 switched to `mir_eval` and warns that only F1/Goto/CML/AML carry across years): | system | beat | downbeat | note | | --------------------------------------- | --------- | --------- | -------------------------------------------------------------------------------------------------- | | TCN (2020) | 88.5 | 67.2 | | | **beat_this** (ISMIR 2024, **shipped**) | 88.9–89.1 | 75.5–78.3 | SOTA without DBN postprocessing; ~2 M params small variant | | BeatFM (arXiv 2508.09790) | 89.5 | 79.6 | frozen MERT/MusicFM + semantic-aggregation module + DBN | | HingeNet (arXiv 2508.09788) | 89.7 | 79.8 | frozen MERT/MusicFM + tiny "hinge" head | | KD-MHL self-training (arXiv 2510.25560) | 89.6 | 78.3 | contrastive SSL with PLP-driven multi-hypothesis selection + self-training; best CV average (89.3) | | BeatNet+ (TISMIR 2024) | 80.6 | 56.5 | different eval conventions; ships `af_non_percussive` weights for classical/ambient | | MIREX 2025 winner, KG-ApolloBeats | 92.53 | — | trained on GTZAN; disallowed from 2026 | The gain from your current grid is inside the noise of a listening test. What the table argues is a **shape**: one frozen foundation encoder + several 100 KB heads. `beat_this` today does its own front-end and its own inference; `BeatFM`/`HingeNet`/`SongFormer` all converge on _encoder once, task heads many_. If an FAE ever lands in the pipeline (§7, L1→L3), the same frozen features should serve beat, boundary, seam, and the candidate ranker — HingeNet is the evidence that the head can be small: swapping Adapter (73.4/64.9) or LoRA (81.2/69.8) for their hinge head on the _same_ frozen MERT gives 89.7/77.4. Two durable conclusions from that literature that `RESEARCH-loops-to-the-beat.md` §9 already reached from the other direction: downbeat accuracy is still ~78–80 at the frontier, so **a confidently wrong downbeat is the failure mode to design against** and `m`/`M` staying able to overrule the grid is correct; and for non-percussive material (SMC: 55–62 for everyone) no tracker is trustworthy, which is an argument for the refusal path, not a better model. --- ## 3. The seam: the loop papers have gone generative, and left two metrics behind LoopMaker (Shi & Mysore, CHI 2018) is still the only paper whose subject is your exact task, and §4 of the earlier survey took its scoring function correctly. What has happened since is instructive: the seam went from a similarity score to **a predictability score**, and then to something you can _optimise_ rather than merely select for. **LoopGen, _"Training-Free Loopable Music Generation"_ (ISMIR 2025, arXiv 2504.04466)** defines the metric your detector does not have: **seam perplexity** — score the token log-likelihood only in a window around the wrap, and a low score means the transition is predictable, i.e. invisible. Method is inference-only circular padding on MAGNeT (the model attends to the loop's start while generating its end), 55 % seam-perplexity improvement, +70 % in blind listening. Two transferable parts, neither needing a generative model: 1. **The metric, transposed.** You cannot take a token model's perplexity, but the shape transfers exactly: for candidate `(a, b)`, compare the continuity of the feature stream across the wrap `b → a` against the continuity at the same offsets _inside_ the loop. A loop whose wrap is more surprising than its interior is broken however well the copies agreed. This is a two-line addition to the existing `seam()` and it is the only measurement that can rank the four positions of one family, which is the gap §11 says `seam` currently cannot fill. 2. **The meter constraint as a constraint.** LoopGen runs a SOTA tracker on the prompt and forces the loop length to an exact multiple/submultiple of a bar, doubling and halving until it fits, because "a 2.5-bar unit is musically unpleasing when repeated". `SearchSubject` already carries `rowsPerBar` and `phase`; today `bars` and `onBar` are _reported_. Making "an integer number of bars" a hard property of an emitted candidate — with the halving/doubling search — is the difference between advising the user and deciding for them. **DITTO (ICML 2024, PMLR v235:38426, arXiv 2401.12179)** is the other edge: optimise a pretrained text-to-music diffusion model's _initial noise_ at inference time through any differentiable feature-matching loss, and you get inpainting, outpainting, **and looping** with no training. This is what "make the seam good" becomes when you stop searching for a seam that already exists. It is a GPU research spike, not a worker feature, and it is recorded here so that the option is on the map: a loop-extension mode (regenerate the 3 s after `b` so that it leads back into `a`) is the frontier version of the crossfade your v1 plan defers. **Learned perceptual distance**, from a different direction: **CDPAM** (Manocha et al., ICASSP 2021, arXiv 2102.05109) is a distance trained to correlate with human judgements of audio distortion. **LoopMatcher (2025)** uses VGGish for retrieval and CDPAM for perceptual refinement when ranking music loops against a reference, and reports Spearman 0.68 against human rankings. Worth knowing as the "there exists a model trained on human ears" option for seam scoring — with the caveat that CDPAM's training data is mostly speech and degraded speech, so its music behaviour is extrapolation. **A definition worth adopting:** LooperGP (arXiv 2303.01665) trains a Transformer-XL on 93,681 loops mined from DadaGP, and its mining rule is stated in your terms: _"we consider a segment of a song to be loopable if it is bookended by a repeated phrase of a minimum length"_, found with a correlative matrix. That is a better operational definition than "the copies agree": the loopable region is the one whose **out-edges match its in-edges**, which is the LoopMaker `a`/`b`/`c` argument expressed as a mining rule. --- ## 4. Search: the alignment literature does the ragged-copy case properly Your trim/blur/gate pile-up (`SMOOTH_SEC`, `TRIM_GAP_SEC`, `TRIM_MIN_SEC`, `TRIM_GATE`) exists because the score is a **window mean along one diagonal**, and a real performed repeat is ragged along that diagonal. The literature that deals with ragged copies at scale is cover song identification and pattern discovery, and both use a different object: - **CSI**: beat-synchronous chroma (or CQT) → cross-similarity matrix → **dynamic programming along the matrix** (DTW / Smith–Waterman), optionally fusing several features' SSMs (Serrà et al.); at scale it became embeddings + metric learning, and MIREX 2025's entrants (e.g. MuCrossCover) are CQT + transformer + triplet/CE losses with tempo/pitch augmentation. The ensemble-based line (arXiv 1905.11700) is the "compare a set, not a pair" extension; dominant-melody embeddings (arXiv 1907.01824) is the "compare the tune, not the mix" version. - **Pattern discovery**: MIREX _Discovery of Repeated Themes & Sections_ (JKUPTD, establishment/ occurrence F1). Its persistent conclusion — repeated **sections** are handled well, short **themes and motifs** are not, and audio is much harder than symbolic. Its own forward recommendation is a nested pass: run discovery on the whole piece, then run it again _inside_ the discovered sections. The transferable move is a **max-sum path along the diagonal** (Viterbi/DTW with a gap cost) instead of `mean(s[i … i+lag))` with a separate run-length trim. One DP replaces `smooth`, `agreementRun`, the gap tolerance and the minimum-run heuristic, and it returns a score _with a support length_, which is what §5 needs to stop shortest-period-wins. It is ~100 lines in the same worker and it is testable on the existing fixtures. Two extra ideas from this line, both cheap: multi-feature SSM **fusion** (combine the chroma surface and an onset/energy surface before searching, rather than picking one) and the CSI observation that **beat-synchronous features are the reason alignment scores are sharp** — which is what §3 of the earlier survey argued and what §10 of it found hard to settle on synthetic material. --- ## 5. Shortest-period-wins has named fixes that need no model §11's second symptom: winning periods cluster at 7.7–15.3 s, i.e. at `MIN_PERIOD_SEC`, "which is what a comparison with little resolving power does: a short lag overlaps the most copies of a nearly-flat representation and wins". Three published answers, all of them prior/normalisation rather than measurement: 1. **Per-lag normalisation before comparison.** The novelty-function literature normalises novelty _per lag_ before thresholding; your `TAIL_QUANTILE` is a single global quantile of every lag's best score, so a short lag that beats a long lag's ceiling wins by construction. Convert each lag to a z-score (or percentile) **within that lag's own distribution over positions**, then compare lags. 2. **A metric prior on the length.** Ellis's log-Gaussian tempo bias exists precisely because a periodic signal's autocorrelation peaks at every multiple and you must choose; LoopGen's integer-bar rule is the same instinct. A mild prior peaking at 4–8 bars of _this track's own_ measured BPM is a stated assumption, not a fudge, and it is the thing that makes 15.3 s and 30.6 s distinguishable instead of both being "the shortest allowed lag". 3. **A support requirement**: the agreed path must span ≥ k bars (RefraiD's line segments must exceed 6.4 s; LooperGP's bookend minimum; RefraiD's chorus prior of 7.7–40 s). Do these **before** any model work: they are the control. If per-lag normalisation plus a bar prior fixes the clustering on the ten calibration tracks, then the representation is not the only bottleneck, and the expensive experiment gets cheaper to justify. --- ## 6. Constraints, stated before the plan rather than after it - **Size and latency.** The reported bill for `beat_this small0` is 4272 ms for a 338 s track, 44 % of it log-mel/resampling and 190 ms per inference window, over ~2 M params. MERT-95M/330M, MuQ-300M and MusicFM-330M are 50–170× that in parameters; MERT-330M is ~1.3 GB fp32 (~330 MB int8). FAE inference in the worker beside a playing track is not a tuning problem, it is a different feature with a download and a GPU question. - **Licence.** `beat_this` is MIT for code _and_ weights, which is the actual reason it shipped. MuQ's weights are **CC-BY-NC 4.0** (stated in its repo); MERT's and MusicFM's checkpoints carry non-commercial terms as well (MusicFM releases only the FMA-trained model, "to avoid potential licensing complications", and that checkpoint is the large one — verify per checkpoint). For an MIT-licensed player this is a shipping blocker, and no amount of quality changes that. - Which turns the architecture question into the interesting one: **an FAE does not have to run in the browser.** Its only product is a feature matrix, so the options are (i) an offline/server-side analysis pass that caches embeddings per track, (ii) a user-triggered desktop-only analysis pass, or (iii) **distil** — train a small permissively-licensed encoder against an FAE teacher for repetition-detection specifically. That third option is where the encoder literature is pointed (the USAD 2.0 line (arXiv 2606.06444 — read via a secondary summary, so verify before relying on the numbers) distils music-supervised SSL teachers into a compact student, halving frame rate 50→25 Hz before scaling depth, and reports −30 % relative on pitch tasks if music supervision is dropped) — but I could not verify a small, permissively-licensed, music SSL encoder that already exists. If you know one, that changes §7 materially. - **No benchmark will settle this for you.** Loop quality is published with listening tests; MSA metrics are ±0.5 s, which is 30–60× coarser than the boundary precision a loop wrap needs. --- ## 7. What I would do, in order of payoff per unit of risk **Status as of this writing:** L0, L2, L3 and L5 are done (§7.1 has what landed and what it measured); L1's tooling is done and waiting on ten real files; L4 and L6 remain, in that order, and L4 should not be started until L1 has an answer, because a boundary head trained on a representation that cannot separate frames is the same mistake one layer up. Read the ladder below as the plan it was, with those four rows struck through by the work rather than by a change of mind. | # | step | source | cost | what it decides | | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **L0** | per-lag z-score, metric/bar prior with halve-or-double to integer bars, ≥ k-bar support requirement | §5 | ~80 lines, TS, fixtures | whether shortest-period-wins and the flood are prior/normalisation bugs rather than representation problems. **Run first — it is the control for everything else.** | | **L1** | **feature bake-off, offline only**: extend `scripts/neural-beat/` to dump MERT-95M / MuQ / MusicFM (early layer + fused layers) + chroma + RMS for the ten calibration tracks and the fixtures; run the existing column/prefix-sum search over them in TS; print per-lag tails, best-real vs best-fake separation, and within-family `seam` ranking | §1 | one python script, no app change, no licence exposure | whether the representation is actually the bottleneck. Decision rule: if the SSL surface does not pull the 0.955–0.998 tails apart while keeping real repeats above them, the answer is L0+L2, not an encoder — and that is worth knowing before anyone buys a 300 MB dependency. | | **L2** | replace window-mean + trim with a max-sum Viterbi path along the diagonal (gap cost, support length out); optionally fuse the chroma and onset surfaces first | §4, CSI + Müller & Kurth path enhancement | ~150 lines, TS | the "candidates come back somewhat long" family, and it hands L0 a real support length | | **L3** | seam as **wrap surprise**: continuity across `b → a` against continuity inside the loop, in the L1 feature space; then make integer-bar length a hard constraint on emission | LoopGen's seam perplexity + beat-aware length; LoopMaker | ~60 lines once L1 exists | the one ranking that turns 0.999 candidates into a recommendation instead of a shrug | | **L4** | learned **boundary head** to replace/augment `bodyRegion`'s Foote kernel — train on HarmonixSet + SongFormDB, export ONNX, keep the checkerboard as the prior and let the head re-rank, never veto | SongFormer, MSA-bench; HR.5F ~0.70 means 1 in 3 boundaries is off by >0.5 s | training run + ~1–5 MB ONNX | intro/tail exclusion without BODY_KERNEL_SEC's 24 s guesswork | | **L5** | learned **candidate ranker** on your own telemetry: the `c` walks and accept/dismiss already happen in the UI, and `harvest/` already stores per-track analysis. Logistic regression or GBDT over ~15 hand features (+ pooled frozen-FAE candidate embedding if L1 landed), exported to ONNX when it earns it | Neural Loop Combiner (ISMIR 2020: CNN on stacked pairs beats Siamese at classification; both beat rule-based AutoMashUpper), LoopMatcher (Spearman 0.68 with humans), DeepDrummer (a critic from ~80 ratings/user) | needs labels, which means shipping the logger first | this is where "frontier of intelligence" actually lives for your problem: nobody has a loop-point dataset, but you are generating one every time somebody presses `c` | | **L6** | seam **repair**: equal-gain crossfade windows chosen from the L3 measurement; then, only as a spike, generative seam/loop extension | PyMusicLooper #71, DITTO, LoopGen | crossfade small; diffusion GPU-only | whether the remaining complaint is "wrong place" or "audible cut" — they need different fixes and L3 tells you which | | L7 | stem-aware loops (drop a one-shot fill from the loop's `b`, or compare the harmonic stem only): Mel-RoFormer / BS-RoFormer, SOTA on MUSDB18HQ, small variants 9.1 M | arXiv 2310.01809, 2409.04702 | heavy, and last | only if L0–L5 leaves failures that are clearly "the fill broke the loop" | Also explicit **non**-directions, because they are plausible and wrong: audio LLMs for boundaries (Gemini 2.5 Pro: HR.5F 0.423 vs 0.703 — the temporal resolution is not there); functional labelling (verse/chorus is not your task — MSA's `segment discovery` framing and the pattern-discovery task are, and the nested "discover, then discover again inside" recipe from the MIREX task is the one that matches your candidate-family problem); and any further beat-tracker swap (§2). ### 7.1 What landed from this, and the three things the measurements said L0, L2, L3 and L5 are implemented and tested (1011 tests, up from 988); L1's tooling exists and has not yet seen a real file. The interesting part is not the code, it is what measuring it produced. **One: the threshold's comparative half is a top-five rule on a beat grid, and that is a third contributor to §11.** Candidate lags run `minPeriodSec…maxPeriodSec`, so how many there are is set by the length of a row: a four-minute track has ~2 435 lags on the frame grid and ~225 on a beat grid, and the 98th percentile of 225 values is the value with five above it. On a thirty-second clip, one lag clears it. So `TAIL_QUANTILE = 0.98` means "be among the five best" on a grid and "be the best lag in the file" on a short clip, while the same music on frames gets forty-nine above it — and a body that repeats contributes its period, its multiples and their grid neighbours, which is more than five lags near 1.0 with no help from a flat representation at all. A new knob, `tailLags`, floors the quantile by a count so that the clock the search runs on cannot silently decide the threshold. **Two: loosening that threshold alone reproduces §11 on the fixtures, which is the cleanest evidence this repo has that the lever is upstream of it.** Setting `tailLags` to 12 makes the rule mean the same thing on every clock, and what arrived was the twenty-four-second answer a fixture exists to contain, displaced by 4.2 s and 4.8 s lags — the shortest period the search is allowed. Every short lag that overlaps a few copies of a non-discriminative representation now clears the bar, and the ranking cannot clean it up: the prior is capped at the indifference margin _on purpose_, so a short lag that genuinely scores higher is not moved, and it should not be. `tailLags` therefore ships at 0, and the knob exists so the question can be asked at a console against files whose answers are known rather than settled by argument here. **Three: the bake-off's self-test manufactured §11 and its opposite, which is what makes the instrument worth believing before it is pointed at a model.** `scripts/ssl-bakeoff/bakeoff.mjs --selftest` builds a "flat" representation (every frame the same vector plus noise) and a "sharp" one (independent random directions, with one twenty-row loop planted once) on the same four-minute grid: **flat tail 0.965 at contrast 0.003** — inside the §11 band of 0.955–0.998, with nothing to stand above — against **sharp tail 0.069 at contrast 0.998**, finding the planted loop at the right row. The tail is therefore measuring separability, not track length or luck, and the real run's number will mean something. It also makes the contextualisation question of §1.1 answerable rather than arguable: `--models muq --layer -2` against the ten calibration tracks, one verdict line per track. What the landed code is, and where each piece is argued in full: | piece | what it adds | deliberate limit | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | `contrast` | how far a region stands above what the **same period** scores at a typical position in this file — a raw difference over a histogrammed median | a difference, not a z-score: dividing by the spread manufactures contrast exactly on the flat material that needs it | | `prior` | whole-number-of-bars fit × log-normal on the bar count (`PRIOR_BARS = 8`) | worth `PRIOR_WEIGHT = TIE_MARGIN`, so it breaks ties and cannot overturn; neutral `1` on a frame grid, where a bar is not a property | | `supportOf` | a bar floor (`MIN_BARS = 2`) beside the seconds floor, combined by whichever asks for more — bars capped at the period, seconds not | a prior never vetoes: acceptance still reads `score` alone, exactly as the body's rule has always been stated | | `path: true` | a max-sum diagonal with a price per _skipped_ row, replacing window mean + run detector; the region is the path clipped to one period, `coverage` says what was bridged | rows are scored **against the gate**, or the gap states are unreachable and the "path" is the whole column with a name on it | | `wrap` | LoopGen's seam perplexity in a feature space: the jump the cut introduces, against the worst step the loop takes inside itself | a second seam number beside `seam`, not a replacement — they answer different questions and disagree usefully | | `detectrank.ts` | learns one weight, `learned = r + w·contrast`, from which candidate a listener arms — pairwise median over their own lists, persisted and printed | `w` capped at the tie margin; hand-marked regions are **not** logged as rejections, because a mark means "I had a different idea" | | `SearchSubject.width` | the search compares rows of a matrix, and twelve is a property of pitch-class space rather than of the search, so an embedding can be searched unchanged | normalisation is the contract, not the width: an audible row is a unit vector | Two of those came out of the tests rather than the plan, and belong where they are: the gap price had to be levied on rows _skipped_ rather than on distance — taxing ordinary continuation at the bridge rate means no path can be longer than a single row, which is what the first version did at the default gate — and the family collapse has to compare the prior **quantised at the prior's own worth**, or a log-normal centred on eight bars invents a two-thousandths difference between two identical scores and chooses a family's keeper by arithmetic accident (that is how the eight-chord fixture started answering six bars where it should have answered four). ## 8. What the literature does not answer Recorded so nobody spends a week assuming a paper has it. 1. **Nobody reports frame-level similarity separability on real recordings.** The MSA numbers are boundary F1 from supervised heads; the "SSL features make a self-similarity surface discriminative" claim is supported by the figures in MSA-bench and MuQ's MSA results, not measured as such. L1 is the measurement, and `scripts/ssl-bakeoff/` is the instrument for it: the app's own `search()`, run under Node over matrices dumped from any encoder, printing the tail per representation on one shared beat grid. Its `--selftest` reproduces §11 synthetically (flat tail 0.965 against sharp 0.069), so the number is known to measure separability before it is believed about a model. What it has _not_ seen is a real file — that needs the ten calibration tracks and one `python3` invocation. 2. **The contextualisation risk (§1.1) is genuinely open** — does a windowed encoder make the tail better or worse? Not published, the honest prior is not favourable, and it is now one command line away from an answer on your own library rather than an argument. 3. **No permissively-licensed compact music SSL encoder I could verify.** MuQ/MERT/MusicFM are NC or partly-NC; the small variants that exist (MERT-95M, `beat_this small0`) are not uniformly free, and MusicFM's small variants are described in the paper rather than released. This is the binding constraint on shipping, not quality. 4. **Loop seam quality on non-generated audio has no metric with a human correlation attached.** LoopGen's seam perplexity is validated on generated loops; LoopMatcher's 0.68 is loop-_to_-loop similarity, not wrap invisibility. L3's threshold will come from the sitting, and nowhere else.