0. Before you start — instructions and references
What files can I upload?
- Standard MIDI files (
.midor.midi), formats 0 or 1. - Recommended: 100 – 4 000 notes, duration 30 s – 10 min.
- The in-browser engine treats all tracks as a quasi-monophonic stream; for rigorous polyphonic analysis use the Python package.
- Not supported: SMPTE division, MIDI type 2, encrypted files, audio (WAV/MP3).
What does the applet do with your MIDI?
- Parses the notes and builds a 12-D chromagram (pitch
classes) on a beat-synchronous grid with bin
Δb = 1/12. - Quantises windows of length
pnby k-means at each level n. - Builds the tower
S1 → … → SNmaxwith forced inverse systemπn+1,n. - Computes the coherence invariant
Cohπ(p,n)and compares it against the architectural floor1/p.
What results will you see?
- A table with
Cohπ(p,n), the floor1/pand a status badge. - Four musical views: temporal chromagram with prototype segmentation, prototype catalogue, inverse system π and the full p-adic tree.
- CSV download of the values.
Privacy
Your MIDI file never leaves your browser. The applet makes no network requests, uses no cookies and sends no telemetry. You can save this HTML and run it fully offline.
What to expect as a diagnosis (with examples)
When a piece satisfies the structural hypotheses
(SC) sibling-cover and (AI)
ancestor-inclusion and one chooses r = p,
Proposition 3.1 of paper [2] predicts
Cohπ(p,n) = 1/p exactly for all
n (the architectural null floor). Deviations above the
floor are the quantitative fingerprint of polyphonic texture or
non-canonical metric structure.
| Reference piece | p | Expected outcome |
|---|---|---|
| BWV 1007 — prelude (monophonic, bundled demo) | 2 | Cohπ(2,n) = 0.500000 exactly at
every level. The badge should read on floor. |
| BWV 1007 — prelude | 3 | Range [0.67, 0.999] above the floor
1/3 ≈ 0.333. Difference explained by
r ≠ p: the binary content does not align with
the ternary grid. |
| Polyphonic Bach (BWV 1049, 1050, 1079) | 2 | Measurable deviation from the floor:
Cohπ typically between 0.55 and
0.95 depending on the movement. This is the
texture discriminant reported in [2]. |
| Any piece, high levels with a small corpus | — | If |Sn+1| is very small the
value loses statistical stability — interpret with
caution. |
Key references
-
[1]
Pérez-Buendía, J. R. (2026).
Prime-power indexed multiscale graph diagnostics for symbolic
temporal data: methodological exploration and delimitation via
BWV 1007.
Submitted to the Journal of Mathematics and Music
(Taylor & Francis). Defines the descriptors
β0,D,β0specand the diagnostic methodology that motivates this software. -
[2]
Pérez-Buendía, J. R. (2026).
Profinite hierarchical patterns and prime-indexed multiscale
invariants in symbolic music.
Submitted. Introduces the p-adic tower
Dp,n, the inverse systemπn+1,n, the invariantCohπ(p,n)and proves Proposition 3.1 of the1/pfloor. -
[3]
Serre, J.-P. (1979).
Local Fields. Springer GTM 67, ch. 1, §3.
Theoretical support for the convergence of pushforward measures
on
ℤp.
Start with the demo: click
Load BWV 1007 demo below, keep the default parameters
(p=2, Nmax=4) and run the analysis; you should
see three rows with Cohπ = 0.500000. Then
try p=3 on the same file to observe the contrast.
1. Load a MIDI file or a demo
Upload your own MIDI, drop it onto the box below, or start with one of the four bundled demos. Demos are useful to see what the theory predicts for known structures.
Expected results per demo (with K=8, Nmax=4, seed 42)
| Demo | Cohπ(2,·) | Cohπ(3,·) | Reading |
|---|---|---|---|
| BWV 1007 — prelude (mono Bach) | [0.500, 0.500, 0.500] floor 0.500 |
[1.00, 1.00, 0.54] floor 0.333 |
The paper's canonical case. Binary cello pulse puts p=2 exactly on the floor. With p=3 the invariant saturates: there is no ternary alignment. |
| Toy binary (synthetic, p=2) | [0.500, 0.500, 0.500] floor 0.500 |
[0.44, 0.56, 0.35] floor 0.333 |
Designed to satisfy (SC) and (AI) at p=2. Hits the floor for p=2; fluctuates near the ternary floor. |
| Toy ternary (synthetic, p=3) | [0.25, 0.50, 0.50] floor 0.500 |
[0.333, 0.41, 0.27] floor 0.333 |
Designed to satisfy (SC) and (AI) at p=3. The binary view is atypical (n=1 dips below). With p=3 level 1 hits the floor 1/3 exactly. |
| BWV 1079 — Crab canon (polyphonic) | [0.500, 0.500, 0.500] floor 0.500 |
[1.00, 0.96, 0.81] floor 0.333 |
Real polyphony with two voices in retrograde imitation. Strict binary structure. Same qualitative profile as BWV 1007. |
To reproduce the values: load the demo, set p=2 (or 3), click Run analysis. Magnitudes can shift slightly with K and seed; the qualitative pattern (on-floor vs off-floor) does not. The column shows levels n=1, 2, 3.
.mid file here.
2. Parameters
Defaults reproduce the gold-standard runs of the companion papers (J. R. Pérez-Buendía, 2026) with the proviso that the in-browser implementation uses a simplified MIDI parser limited to monophonic flows; for full reproducibility use the Python package.
About
PAdicMIDI · A Python toolkit for hierarchical, ultrametric, and p-adic analysis of symbolic music data. Jesús Rogelio Pérez Buendía (publication name: J. Rogelio Pérez-Buendía), researcher, CIMAT-Mérida. ORCID 0000-0002-7739-4779 · Web www.cimat.mx/~rogelio.perez · Email rogelio.perez@cimat.mx. Funding: SECIHTI grant CF-2019/217367. Source code: MIT licence. Companion papers: Prime-power indexed multiscale graph diagnostics (JMM, 2026) and Profinite hierarchical patterns and prime-indexed multiscale invariants in symbolic music (2026).