From ffe05e602dccbe225ceb56a1657bce588616138a Mon Sep 17 00:00:00 2001 From: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun, 24 Jul 2022 16:19:21 -0700 Subject: [PATCH] Depend on (and install during setup) converter21. --- README.md | 2 +- musicdiff/__main__.py | 15 ++++++--------- pypi_README.md | 2 +- setup.py | 3 ++- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 11a3c3f..0cf64b5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ musicdiff is derived from: [music-score-diff](https://github.com/fosfrancesco/mu by [Francesco Foscarin](https://github.com/fosfrancesco). ## Setup -Depends on [music21](https://pypi.org/project/music21) (version 7.2+) and [numpy](https://pypi.org/project/numpy). 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). +Depends on [music21](https://pypi.org/project/music21) (version 7.2+), [numpy](https://pypi.org/project/numpy), and [converter21](https://pypi.org/project/converter21). 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). ## Usage On the command line: diff --git a/musicdiff/__main__.py b/musicdiff/__main__.py index 33a784d..7f3c514 100644 --- a/musicdiff/__main__.py +++ b/musicdiff/__main__.py @@ -18,11 +18,8 @@ from musicdiff import diff from musicdiff import DetailLevel -# To use the new Humdrum importer from converter21 in place of the one in music21: -# pip install converter21 -# Then uncomment all lines in this file marked "# c21" -# import music21 as m21 # c21 -# from converter21 import HumdrumConverter # c21 +import music21 as m21 +from converter21 import HumdrumConverter # ------------------------------------------------------------------------------ @@ -31,10 +28,10 @@ ''' if __name__ == "__main__": - # to use the new Humdrum importer from converter21 in place of the one in music21... - # m21.converter.unregisterSubconverter(m21.converter.subConverters.ConverterHumdrum) # c21 - # m21.converter.registerSubconverter(HumdrumConverter) # c21 - # print('registered converter21 humdrum importer', file=sys.stderr) # c21 + # Use the new Humdrum importer from converter21 in place of the one in music21... + # Comment out these two lines to go back to music21's built-in Humdrum importer. + m21.converter.unregisterSubconverter(m21.converter.subConverters.ConverterHumdrum) + m21.converter.registerSubconverter(HumdrumConverter) parser = argparse.ArgumentParser( prog='python3 -m musicdiff', diff --git a/pypi_README.md b/pypi_README.md index 47f4922..19994ac 100644 --- a/pypi_README.md +++ b/pypi_README.md @@ -7,7 +7,7 @@ musicdiff is derived from: [music-score-diff](https://github.com/fosfrancesco/mu by [Francesco Foscarin](https://github.com/fosfrancesco). ## Setup -Depends on [music21](https://pypi.org/project/music21) (version 7.2+) and [numpy](https://pypi.org/project/numpy). 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). +Depends on [music21](https://pypi.org/project/music21) (version 7.2+), [numpy](https://pypi.org/project/numpy), and [converter21](https://pypi.org/project/converter21). 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). ## Usage On the command line: diff --git a/setup.py b/setup.py index 11a1487..3fa4ca1 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages import pathlib -musicdiffversion = '1.2.0' +musicdiffversion = '1.3.0' here = pathlib.Path(__file__).parent.resolve() @@ -61,6 +61,7 @@ install_requires=[ 'music21>=7.2', 'numpy', + 'converter21>=1.2' ], project_urls={