Skip to content

Commit 9d7b5b9

Browse files
Merge branch 'develop'
2 parents 1ad9024 + 441524f commit 9d7b5b9

File tree

67 files changed

+23012
-9812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+23012
-9812
lines changed

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
11
# musicdiff
2-
A Python3 package (and command-line tool) for computing and visualizing the notation differences between two music scores.
2+
A Python3 package (and command-line tool) for computing and visualizing (or describing) the notation differences between two music scores.
33

44
musicdiff is focused on visible notation differences, not only on audible musical differences. For example, two tied eighth notes are considered different from a single quarter note. And two beamed 16th notes are considered different from two unbeamed 16th notes. This makes musicdiff particularly useful for assessing the results of Optical Music Recognition software.
55

66
musicdiff is derived from: [music-score-diff](https://github.com/fosfrancesco/music-score-diff.git)
77
by [Francesco Foscarin](https://github.com/fosfrancesco).
88

99
## Setup
10-
Depends on [music21](https://pypi.org/project/music21) (version 9.1+), [numpy](https://pypi.org/project/numpy), and [converter21](https://pypi.org/project/converter21) (version 3.1+). You also will need to configure music21 (instructions [here](https://web.mit.edu/music21/doc/usersGuide/usersGuide_01_installing.html)) to display a musical score (e.g. with MuseScore). Requires Python 3.10+.
10+
Depends on [music21](https://pypi.org/project/music21) (version 9.1+), [numpy](https://pypi.org/project/numpy), and [converter21](https://pypi.org/project/converter21) (version 3.2+). You also will need to configure music21 (instructions [here](https://web.mit.edu/music21/doc/usersGuide/usersGuide_01_installing.html)) to display a musical score (e.g. with MuseScore). Requires Python 3.10+.
1111

1212
## Usage
1313
On the command line:
1414

15-
python3 -m musicdiff file1.musicxml file2.krn
15+
python3 -m musicdiff -i decoratednotesandrests lyrics style -x beams -- file1.musicxml file2.krn
1616

17-
positional arguments:
18-
file1 first music score file to compare (any format music21 can parse)
19-
file2 second music score file to compare (any format music21 can parse)
17+
arguments:
18+
-i/--include one or more named details to include in comparison (the default is allobjects,
19+
a.k.a. decoratednotesandrests and otherobjects). Can be decoratednotesandrests,
20+
otherobjects, allobjects, or any combination of those and/or the following:
21+
notesandrests; the aforementioned note decorations: beams, tremolos, ornaments,
22+
articulations, ties, slurs; the other objects: signatures, directions,
23+
barlines, staffdetails, chordsymbols, ottavas, arpeggios, and lyrics; and
24+
a final few details that are not found in allobjects: style, metadata, and
25+
voicing. voicing compares how notes are included in voices and chords (by
26+
default this is ignored).
27+
-x/--exclude one or more named details to exclude from comparison. Can be any of the
28+
named details accepted by -i/--include.
29+
-o/--output one or both of two output formats: text (or t) or visual (or v); the default
30+
is visual). visual (or v) requests production of marked-up score PDFs; text
31+
(or t) requests production of diff-like text output.
32+
33+
file1 first music score file to compare (any format music21 or converter21 can parse)
34+
file2 second music score file to compare (any format music21 or converter21 can parse)
2035

2136
The source for that command-line tool, which calls musicdiff's high-level diff() API, can be seen [here](musicdiff/__main__.py). You can use it as example code for adding musicdiff capabilities to your own code. See the documentation [here](https://gregchapman-dev.github.io/musicdiff) to find out how to customize diff()'s behavior beyond what the command line tool does.
2237

2338
A google colab notebook is available [here](examples/musicdiff_demo.ipynb).
2439

25-
If you are interested in calling lower-level musicdiff APIs to do more complicated things than just visualization in PDFs, the source for musicdiff's high-level diff() API (found [here](musicdiff/__init__.py)) is good example code to read. Note particularly how diff() calls converter21.register() to register converter21's Humdrum and MEI parsers for use by music21. If you call lower-level APIs than diff(), you will need to do this yourself.
40+
If you are interested in calling lower-level musicdiff APIs to do more complicated things than just visualization in PDFs or diff-like text output, the source for musicdiff's high-level diff() API (found [here](musicdiff/__init__.py)) is good example code to read. Note particularly how diff() calls converter21.register() to register converter21's Humdrum and MEI parsers for use by music21. If you call lower-level APIs than diff(), you will need to do this yourself.
2641

2742
## Documentation
2843
You can find the musicdiff API documentation [here](https://gregchapman-dev.github.io/musicdiff).
@@ -46,4 +61,4 @@ The paper is freely available [here](https://hal.inria.fr/hal-02267454v2/documen
4661
Licensed under the [MIT License](LICENSE).
4762

4863
## Acknowledgment
49-
Many thanks to [Francesco Foscarin](https://github.com/fosfrancesco) for allowing me to use his [music-score-diff](https://github.com/fosfrancesco/music-score-diff.git) code, and for continuing to work with and advise me on this project.
64+
Many thanks to [Francesco Foscarin](https://github.com/fosfrancesco) for allowing me to use his [music-score-diff](https://github.com/fosfrancesco/music-score-diff.git) code, and for continuing to advise me on this project.

ReleaseNotes_4.0.0.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Changes since 3.1.1:
2+
New command line and API that allows fine-grained setting of requested details.
3+
New output option that prints a diff-like text description of the differences to stdout.
4+
New comparison algorithm that ignores voicing and chording, just comparing all the notes,
5+
wherever they are in the measure.
6+
Support comparison of slurs.
7+
Support comparison of chord symbols.
8+
Better comparison of tuplets.
9+
Better comparison of lyrics.
10+
Ignore leading and trailing whitespace in directions, lyrics, and metadata.
11+
Fix random crashes and long-term memory growth when doing multiple comparisons in one run.

build_dist.commands

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
# FIRST edit setup.py to change version number and maybe dependencies.
2-
# MAYBE README, too, if dependencies changed.
1+
# git checkout main
2+
# git merge develop
3+
# Fix any conflicts, add, commit, push to origin
4+
5+
# Edit setup.py to change version number and maybe dependencies.
6+
# MAYBE README and pypi_README, too, if dependencies changed.
7+
# git add setup.py README etc
8+
# git commit
9+
# git push origin
310

411
# Clean up previous stuff:
512
rm -r __pycache__
@@ -19,3 +26,11 @@ python3 -m twine upload --repository testpypi dist/*
1926

2027
# If all looks good, then publish on pypi proper (no password needed):
2128
python3 -m twine upload dist/*
29+
30+
# Go to github and make a release there as well (tag=vN.n.n)
31+
32+
# Make develop "catch up with" main, so we can easily merge again later
33+
# git checkout develop
34+
# git merge --squash main
35+
# git commit
36+
# git push origin

0 commit comments

Comments
 (0)