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 8.2+), numpy, and converter21 (version 2.0+). 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) 2023, 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-2.0.0.tar.gz (30.8 kB view details)

Uploaded Source

Built Distribution

musicdiff-2.0.0-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: musicdiff-2.0.0.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for musicdiff-2.0.0.tar.gz
Algorithm Hash digest
SHA256 ce40267754829b38be602089db44a3a53d98fb3a766ac30e5fc25e152f890be0
MD5 bd04987e78078edc09af98a244334a74
BLAKE2b-256 4a7da6783125f23a512d60b13d8ce51266b07a975c465610c9b27169c81fca17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: musicdiff-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for musicdiff-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 058201105219c829394216fac3d2961d427cf067ee1cc13e0211f6a5d65df164
MD5 f4fb952e5489f45f558785d542c27569
BLAKE2b-256 5ceb4f3b3081479699a3a6721413181f4e45bafd83cbf19b0a4421a450305c7b

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