Skip to main content

A music score notation diff package

Project description

musicdiff

A Python3 package (and command-line tool) for computing and visualizing the notation differences between two music scores.

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.

musicdiff is derived from: music-score-diff by Francesco Foscarin.

Setup

Depends on music21 (version 7.2+), numpy, and converter21. You also will need to configure music21 (instructions here) to display a musical score (e.g. with MuseScore).

Usage

On the command line:

python3 -m musicdiff file1.musicxml file2.krn

positional arguments:
  file1       first music score file to compare (any format music21 can parse)
  file2       second music score file to compare (any format music21 can parse)

The musicdiff command line tool will display two rendered score PDFs that have the differences highlighted with color and descriptive text.

musicdiff is also a package, with APIs you can call in your own code. There is a high-level diff() API that the command-line tool uses (that you can tweak the behavior of), and there are also lower level APIs that you can use in projects that perhaps want to do something more complicated than just visualization in PDFs.

Documentation

You can find the musicdiff API documentation here.

Citing

If you use this work in any research, please cite the relevant paper:

@inproceedings{foscarin2019diff,
  title={A diff procedure for music score files},
  author={Foscarin, Francesco and Jacquemard, Florent and Fournier-S’niehotta, Raphael},
  booktitle={6th International Conference on Digital Libraries for Musicology},
  pages={58--64},
  year={2019}
}

The paper is freely available here.

Acknowledgment

Many thanks to Francesco Foscarin for allowing me to use his music-score-diff code, and for continuing to work with and advise me on this project.

License

The MIT License (MIT) Copyright (c) 2022, Francesco Foscarin, Greg Chapman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

musicdiff-1.4.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

musicdiff-1.4.0-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file musicdiff-1.4.0.tar.gz.

File metadata

  • Download URL: musicdiff-1.4.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for musicdiff-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f1764897fe50803eac47f280e56c826b4eff020e8478f7d1aa0009f623ed4350
MD5 60177d136490ca4f19012fbefb3864aa
BLAKE2b-256 537a8a16103cb01c511092cdaee883b9f04df7e3f18699b0bc1553c1dd093372

See more details on using hashes here.

File details

Details for the file musicdiff-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: musicdiff-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 30.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.9

File hashes

Hashes for musicdiff-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14140e15a5e94fa0a8cd52e01e77265dae1d0162a93a349e7fef2a67d490d041
MD5 721b24047aa5e4eb44d3d06db70af4b8
BLAKE2b-256 7c2a6c53e8443078a9a5702f9baa6ebde65fb53ec6f31b27200a6af57106a778

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page