Skip to content

Commit 138f35b

Browse files
Merge branch 'develop'
2 parents 70345d2 + 5fb3065 commit 138f35b

9 files changed

Lines changed: 292 additions & 256 deletions

File tree

LICENSE

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
Copyright (c) 2021-2025 Greg Chapman
2+
Copyright (c) 2021-2026 Greg Chapman
33

44
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:
55

@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3737
The core of the MEI parsing portion of this software was based on the MEI parser
3838
in https://github.com/cuthbertLab/music21, which uses the BSD 3-Clause License:
3939

40-
Copyright (c) 2006-2025 Michael Scott Asato Cuthbert
40+
Copyright (c) 2006-2026 Michael Scott Asato Cuthbert
4141
All rights reserved.
4242

4343
Redistribution and use in source and binary forms, with or without
@@ -61,3 +61,17 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
6161
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
6262
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
6363
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64+
65+
The ABC reader/writer in this software uses abc2xml.py and xml2abc.py, which
66+
use the Lesser GNU General Public Licence:
67+
68+
Copyright (C) 2012-2025: Willem G. Vree
69+
70+
This program is free software; you can redistribute it and/or modify it under
71+
the terms of the Lesser GNU General Public License as published by the Free
72+
Software Foundation;
73+
74+
This program is distributed in the hope that it will be useful, but WITHOUT
75+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
76+
FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public Licence for more
77+
details. <http://www.gnu.org/licenses/lgpl.html>

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# converter21
2-
A music21-extending converter package that contains alternate music21 Humdrum and MEI converters (a Humdrum parser/writer, and a MEI parser/writer). converter21 is also a command line tool for conversion between various music notation file formats.
2+
A music21-extending converter package that contains music21 extensions that read/write Humdrum, MEI, and ABC files. converter21 is also a command line tool for conversion between many music notation file formats.
33

44
The Humdrum portion of this software is derived/translated from the C++ code in [humlib](https://github.com/craigsapp/humlib), by Craig Stuart Sapp.
55

66
The core of the MEI parsing portion of this software was based on the MEI converter in [music21](https://github.com/cuthbertlab/music21), by Michael Scott Asato Cuthbert.
77

8+
The ABC portion of this software uses [abc2xml.py](https://wim.vree.org/svgParse/abc2xml.html) and [xml2abc.py](https://wim.vree.org/svgParse/xml2abc.html), by Willem G. Vree.
9+
810
## Setup
9-
Requires Python 3.10 or later. Depends on [music21](https://pypi.org/project/music21) v9.9.1, which should also be configured (instructions [here](https://www.music21.org/music21docs/usersGuide/usersGuide_01_installing.html)) to display a musical score (e.g. with Musescore). Some of the tests depend on [musicdiff](https://pypi.org/project/musicdiff), but converter21 itself does not.
11+
Requires Python 3.10 or later. Depends on [music21](https://github.com/cuthbertlab/music21) v9.9.1, which should also be configured (instructions [here](https://www.music21.org/music21docs/usersGuide/usersGuide_01_installing.html)) to display a musical score (e.g. with Musescore). Some of the tests depend on [musicdiff](https://github.com/gregchapman-dev/musicdiff), but converter21 itself does not.
1012

1113
## Command line tool usage:
1214
```
@@ -39,7 +41,7 @@ Call converter21.register() to get music21 to use converter21's alternate Humdru
3941

4042
## License
4143
The MIT License (MIT)
42-
Copyright (c) 2021-2025 Greg Chapman
44+
Copyright (c) 2021-2026 Greg Chapman
4345

4446
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:
4547

@@ -77,7 +79,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
7779
The core of the MEI parsing portion of this software was based on the MEI parser
7880
in [music21](https://github.com/cuthbertLab/music21), which uses the BSD 3-Clause License:
7981

80-
Copyright (c) 2006-2025 Michael Scott Asato Cuthbert
82+
Copyright (c) 2006-2026 Michael Scott Asato Cuthbert
8183
All rights reserved.
8284

8385
Redistribution and use in source and binary forms, with or without
@@ -101,3 +103,17 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
101103
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
102104
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
103105
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
106+
107+
The ABC reader/writer in this software uses [abc2xml.py](https://wim.vree.org/svgParse/abc2xml.html) and [xml2abc.py](https://wim.vree.org/svgParse/xml2abc.html), which
108+
use the [Lesser GNU General Public Licence](<http://www.gnu.org/licenses/lgpl.html>):
109+
110+
Copyright (C) 2012-2025: Willem G. Vree
111+
112+
This program is free software; you can redistribute it and/or modify it under
113+
the terms of the Lesser GNU General Public License as published by the Free
114+
Software Foundation;
115+
116+
This program is distributed in the hope that it will be useful, but WITHOUT
117+
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
118+
FOR A PARTICULAR PURPOSE. See the [Lesser GNU General Public Licence](<http://www.gnu.org/licenses/lgpl.html>) for more
119+
details.

activeBranches.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
gregc/moreMusicSiteFixes:
2-
Initial tie work is here. The rest of this has been merged into develop.
3-
4-
develop:
2+
Initial tie work is here. The rest of this has been merged into main v4.0.0.
3+
4+
main (v4.0.0):
5+
Add ABC import/export (including Opus support)
6+
Humdrum/MEI import/export:
7+
add Opus support (three options with MEI)
8+
Support styled lyrics
9+
Better color support
10+
All: support PedalMarks
11+
Humdrum import: stem direction fixes
512
Merged gregc/spannerAnchorFixes:
613
Fix MEI export of SpannerAnchors, so it doesn't cause gaps to be exported.
7-
Release this as soon as gregc/moreAccurateSpannerStartStop PR is accepted
8-
in music21.
914

1015
main (v3.5.0):
1116
Merged gregc/moreNotation:

converter21/mei/m21objectconvert.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,31 @@ def m21RestToMei(
267267

268268
M21ObjectConvert._addStylisticAttributes(obj, attr)
269269

270-
if obj.hasStyleInformation and obj.style.hideObjectOnPrint:
271-
attr.pop('visible', None) # remove @visible="false", since <space> is always invisible
272-
tb.start('space', attr)
273-
tb.end('space')
270+
if obj.duration.type == 'complex' and M21ObjectConvert.isMeasureDuration(obj):
271+
# mRest or mSpace is the only way to encode this duration
272+
if obj.hasStyleInformation and obj.style.hideObjectOnPrint:
273+
attr.pop('visible', None) # remove @visible="false" for <mSpace>
274+
tb.start('mSpace', attr)
275+
tb.end('mSpace')
276+
else:
277+
tb.start('mRest', attr)
278+
tb.end('mRest')
274279
else:
275-
tb.start('rest', attr)
276-
tb.end('rest')
280+
if obj.hasStyleInformation and obj.style.hideObjectOnPrint:
281+
attr.pop('visible', None) # remove @visible="false" for <space>
282+
tb.start('space', attr)
283+
tb.end('space')
284+
else:
285+
tb.start('rest', attr)
286+
tb.end('rest')
287+
288+
@staticmethod
289+
def isMeasureDuration(obj: m21.base.Music21Object) -> bool:
290+
timesig: m21.meter.TimeSignature | None = obj.getContextByClass(m21.meter.TimeSignature)
291+
measureDur: OffsetQL = 4.0
292+
if timesig is not None:
293+
measureDur = opFrac(4.0 * timesig.numerator / timesig.denominator)
294+
return obj.quarterLength == measureDur
277295

278296
@staticmethod
279297
def meiLocToM21DisplayName(

0 commit comments

Comments
 (0)