𝄞 TSM Diff

A similarity measure for music scores based on Tree Score Model (TSM) DAG representations

Getting Started

This page covers installing TSM Diff and running the bundled example.

Requirements

Installation

git clone https://gitlab.com/xiaobo-wang/tsm_diff_lbd.git
cd tsm_diff_lbd
pip install -r requirements.txt

Run your first comparison

From the scripts/ directory:

cd scripts
python test.py

By default, test.py compares two versions of Mozart's Piano Sonata KV 281 (test/examples/K281-1.musicxml and test/examples/K281-1_01.musicxml) and prints the diff list.

Reading the output

Each row of the diff-list is one difference between the two scores:

ColumnDescription
codeThe diff code
left type / right typeLabel of the TSM node on each side, e.g. Chord3, Note_F3
left start / right startPosition of the difference, in bars (e.g. 2+1/4 means beat 1/4 after bar 2)
left dur / right durDuration of the affected interval, in bars
l|r nodesNumber of TSM nodes involved on the left and right side
time distContribution to the time distance
symb distContribution to the surface distance
costCombined weighted cost of this difference

Diff codes, node labels, and the similarity formula (1 minus the harmonic mean of the two distances) are all explained on the Description page.