MatchClaim, NOMATCH, synchronous vs conceptual, TiliaJsonLoader
How to Encode Song Genesis Relationships (Hendrix)
This notebook demonstrates how to encode conceptual and temporal relationships between multiple versions of a work using objects, structures, and the NOMATCH sentinel.
The use case comes from a genesis study of Jimi Hendrix’s 1983… (A Merman I Should Turn to Be), comparing three versions:
Studio – the studio recording from Electric Ladyland (CPT1)
Demo2 – a band demo with Mitch Mitchell on drums (CPT2)
Demo1 – a solo demo (CPT3)
Form analyses for each version are encoded as TiLiA hierarchy timelines. A CSV file records which sections correspond across versions, whether those correspondences are synchronous (temporal alignment possible) or merely conceptual (structural equivalence only), and where a section is explicitly absent from a version (NOMATCH).
Key Concepts Demonstrated
Loading TiLiA JSON files via TiliaJsonLoader
Creating an from independent timelines
Parsing a match table with synchronous and NOMATCH columns
Creating synchronous vs. conceptual objects
Using MatchClaim.nomatch() for explicit structural absence
/home/laser/miniconda3/envs/timetoalign/lib/python3.11/site-packages/partitura/__init__.py:9: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
1. Load the Three Versions
Each version of the song has been annotated in TiLiA, producing a JSON file with hierarchy timelines encoding the form analysis. We load each file and extract the first hierarchy timeline (HIERARCHY_TIMELINE_0), which contains the section-level annotations (Intro, Verse, Bridge, etc.).
names = ["Studio", "Demo2", "Demo1"]timelines = {}for name in names: loader = TiliaJsonLoader.from_file(DATA_DIR /f"Hendrix_Merman_{name}.json") tl = loader.create_timeline("HIERARCHY_TIMELINE_0") timelines[name] = tltimelines
These claims carry coordinate pairs (start and end) that enable temporal alignment between versions. Each interval match corresponds to a pair of section boundaries in seconds.
The MatchClaim’s rich display shows timelines, coordinates, events, and metadata — no need to compile info-dicts manually.
# Display an example synchronous claim (shows timeline IDs, coordinates, events)sync_claims[0]
MatchClaimsynchronous, interval
Timeline A
Studio
[32.573792 – 72.172127]
Event A
h0034
"A: Verse"
Timeline B
Demo2
[35.839063 – 73.036544]
Event B
h0018
"A: Verse"
Metadata
agent=user
# Summary of all synchronous claims{"synchronous_claims": len(sync_claims),"is_interval": all(c.is_interval for c in sync_claims),}
{'synchronous_claims': 13, 'is_interval': True}
Conceptual claims (no anchors)
These record structural equivalence without temporal commitment — for instance, “both versions have an Intro” without asserting that the intros can be aligned beat-by-beat.
# Display an example conceptual claim (no coordinates, just timeline connection)conceptual_claims[0] if conceptual_claims else"No conceptual claims"
MatchClaimNOMATCH
Timeline A
Studio
Timeline B
Demo2
Metadata
agent=user
{"conceptual_claims": len(conceptual_claims)}
{'conceptual_claims': 6}
NOMATCH sentinels
These explicitly record that a section has no equivalent in the target version — a positive assertion of absence, not a mere gap in the data. For instance, the “Instrumental Part” in the studio recording has no equivalent in Demo1.
# Display an example NOMATCH claimnomatch_claims[0] if nomatch_claims else"No NOMATCH claims"
MatchClaimNOMATCH
Timeline A
Demo2
Timeline B
Studio
Metadata
agent=user
{"nomatch_sentinels": len(nomatch_claims)}
{'nomatch_sentinels': 12}
Summary
This notebook demonstrated how to encode heterogeneous musicological relationships in a single, queryable structure: