Skip to content

Commit 5fa05b8

Browse files
Squash merge of v3.4.0 from develop.
Squashed commit of the following: commit e81bb0c Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Feb 4 13:10:19 2025 -0800 Prepare for v3.4.0 commit a879917 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Feb 4 12:13:37 2025 -0800 Humdrum import: if acceptSyntaxErrors, return an empty Score rather than propagating an exception. commit e4366df Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Feb 1 15:11:24 2025 -0800 Tests: handle new 'extrasymboledit' and 'extrainfoedit' from musicdiff. commit dd29f44 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 31 13:57:55 2025 -0800 Tests: diffall should now use extra.kind instead of extra.content for the count dict key. commit 71b1595 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Thu Jan 30 11:26:00 2025 -0800 Squashed commit of the following: commit e73b3b7 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Thu Jan 30 11:17:52 2025 -0800 Update LICENSE, README, and setup.py for release 3.3 commit 00609ee Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Thu Jan 30 11:04:56 2025 -0800 Squashed merge of develop for Release 3.3. Squashed commit of the following: commit ac4a7a2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Jan 27 15:57:13 2025 -0800 ReleaseNotes update. commit a8fb106 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Jan 26 12:09:04 2025 -0800 Update ReleaseNotes 3.3 commit 6aaa3aa Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 14:27:03 2025 -0800 New release notes for v3.3.0 commit f9cfa3d Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 11:30:15 2025 -0800 Tests: showdiff*.py now print SER even if SER is 0. commit edf0f33 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 11:23:57 2025 -0800 Tests: diffall*.py now output SER even if there are no diffs. commit f306950 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 15:43:55 2025 -0800 Shared: In fixupBadDurations, no longer copy timesigs. Instead do a better job of finding the timesig you need. commit 7c539aa Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 14:15:40 2025 -0800 Shared: in fixupBadDurations, don't insert 4/4 when there's nothing at start of score. commit 7b28622 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:50:36 2025 -0800 Shared: fix bug in timesig adding code. commit 87fd5fb Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:41:51 2025 -0800 Shared: in fixupBadDurations, when inserting missing timesigs, make them invisible. commit f838375 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:41:22 2025 -0800 Tests: diffall tests now also output SER info. commit ea1aa7d Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 3 18:52:57 2025 -0800 Shared: More fixups in fixupBadDurations (missing timesigs and too-long whole measure rests (QL=4.0)). commit 6fd954b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 3 12:56:26 2025 -0800 Shared: splitComplexRest... now handles rests with visual vs gestural (i.e. unlinked) durations. fixupBadDurations adds full measure hidden rest when appending empty measures. fixupBadDurations slides overlapping/underlapping notes into alignment again. commit 7a40320 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 30 14:47:09 2024 -0800 Shared: when appending hidden rests to a measure to line up with a simultaneous measure, append to all voices if there are any, else append to the measure. commit d1f7df0 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 30 14:19:16 2024 -0800 Humdrum export/Shared: fix up complex hidden rests on the input score, don't fix overlapping notes (yet). commit 1a9df60 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:37:13 2024 -0800 Shared: first cut at fixupBadDurations (trying to deal with Photoscore MusicXML score issues). commit 746c7fc Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:36:51 2024 -0800 More lint. commit 07749a7 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:29:04 2024 -0800 Lint. commit 6c782d0 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:28:15 2024 -0800 Humdrum import: plumbing for optionally fixing syntax errors. commit a708362 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:27:10 2024 -0800 Pylint: max-positional-arguments=10 commit 42e0407 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 21:50:18 2024 -0800 New test Humdrum file. commit 2169218 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 19:15:10 2024 -0800 Humdrum import: fix mismatched token count errors. commit aad515e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 18:23:24 2024 -0800 Humdrum input: first ignored syntax error implemented, to see how it looks. commit f818f08 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 12:22:56 2024 -0800 Humdrum import: better "accept syntax errors" plumbing. commit 56ce4b3 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 21:47:11 2024 -0800 First cut at fixing Humdrum syntax errors. commit 22b70a5 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 20:05:27 2024 -0800 Tests: diffall tests were overwriting eachother's output files sometimes. Avoid that. commit 736a8da Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 19:25:20 2024 -0800 Tests: the showdiff* tests also don't need to check for different n_of_parts. commit e495070 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Nov 29 15:01:43 2024 -0800 Tests: musicdiff can handle different number of parts. Stop working around that limitation. commit 18d64dd Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Oct 1 15:29:39 2024 -0700 Shared: Add new M21Utilities.assureXmlIdAndId(obj, prefix). commit 9cfdb29 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Sep 17 13:23:07 2024 -0700 Don't raise exception from StreamFreezer, either. commit cb42b5b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Sep 17 10:52:04 2024 -0700 Do not raise exceptions when thawing a score. commit b7a4873 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Sep 2 13:47:48 2024 -0700 New M21Utilities routine to assure all obj.xmlids and then copy them all to obj.id (with the exception of voice.id, which we leave intact for cross-staff voices). commit 027031b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Sep 2 12:08:53 2024 -0700 Clean up that score deannotation a bit. commit 90cce68 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Sep 1 16:54:03 2024 -0700 Humdrum export: same thing - clean up all those custom m21 attributes we use during export. commit 173bc62 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Sep 1 16:08:43 2024 -0700 MEI export: carefully make a note of every custom m21 attribute we add to m21 objects during export, and remove them all during MeiScore.deannotateScore(). MEI import: rename all custom m21 attributes we add during import from 'mei_*' to 'meireader_*', so they don't conflict with the exporter's custom m21 attributes. commit f94d673 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 16:30:14 2024 -0700 MEI export: don't start or end a tie on a note within a chordSYMBOL. Similarly, beams and tuplets. commit 906fc4a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 13:20:00 2024 -0700 delint. commit 3750e2a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 13:18:29 2024 -0700 Shared: new M21Utilities for 3rd parties. commit 80820fe Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Aug 27 11:04:32 2024 -0700 Shared: first cut at M21Utilities FreezeThaw stuff (borrowed from music21 and modified for our purposes). commit 600f365 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 26 11:17:14 2024 -0700 Shared: rename M21Utilities._updatePitches(cs) to M21Utilities.updatePitches(cs), so external clients can call it. commit e59b05a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Aug 25 15:29:25 2024 -0700 MEI import: Keep more xml:ids as obj.id (ChordSymbol and TextExpression, etc). commit 588a46e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Aug 24 15:42:14 2024 -0700 MEI export: more xmlids; layer@n now gets a low integer always, and if voice.id is a string it goes in layer@label. voice.c21_label overrides voice.id in layer@label. commit 20736f2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Wed Aug 21 17:55:43 2024 -0700 Shared: More xmlid stuff. commit 6057c1e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Wed Aug 21 14:48:30 2024 -0700 Shared/MEI export: Move XmlId routines and the various MeiWhateverSpanners to M21Utilities. commit f799bf1 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 19 15:45:17 2024 -0700 lint commit eedc0b2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 19 15:33:01 2024 -0700 MEI import/export: move some ChordSymbol utilities to M21Utilities, for other clients to use. commit 6a0d146 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 16 14:27:09 2024 -0700 A little <harm> cleanup. Should make no difference (ha!). commit ba9f1a7 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Aug 11 15:19:54 2024 -0700 MEI export: handle barline type 'heavy-light' (MEI doesn't have it). commit ac4a7a2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Jan 27 15:57:13 2025 -0800 ReleaseNotes update. commit a8fb106 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Jan 26 12:09:04 2025 -0800 Update ReleaseNotes 3.3 commit 6aaa3aa Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 14:27:03 2025 -0800 New release notes for v3.3.0 commit f9cfa3d Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 11:30:15 2025 -0800 Tests: showdiff*.py now print SER even if SER is 0. commit edf0f33 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 24 11:23:57 2025 -0800 Tests: diffall*.py now output SER even if there are no diffs. commit f306950 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 15:43:55 2025 -0800 Shared: In fixupBadDurations, no longer copy timesigs. Instead do a better job of finding the timesig you need. commit 7c539aa Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 14:15:40 2025 -0800 Shared: in fixupBadDurations, don't insert 4/4 when there's nothing at start of score. commit 7b28622 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:50:36 2025 -0800 Shared: fix bug in timesig adding code. commit 87fd5fb Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:41:51 2025 -0800 Shared: in fixupBadDurations, when inserting missing timesigs, make them invisible. commit f838375 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Jan 21 13:41:22 2025 -0800 Tests: diffall tests now also output SER info. commit ea1aa7d Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 3 18:52:57 2025 -0800 Shared: More fixups in fixupBadDurations (missing timesigs and too-long whole measure rests (QL=4.0)). commit 6fd954b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Jan 3 12:56:26 2025 -0800 Shared: splitComplexRest... now handles rests with visual vs gestural (i.e. unlinked) durations. fixupBadDurations adds full measure hidden rest when appending empty measures. fixupBadDurations slides overlapping/underlapping notes into alignment again. commit 7a40320 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 30 14:47:09 2024 -0800 Shared: when appending hidden rests to a measure to line up with a simultaneous measure, append to all voices if there are any, else append to the measure. commit d1f7df0 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 30 14:19:16 2024 -0800 Humdrum export/Shared: fix up complex hidden rests on the input score, don't fix overlapping notes (yet). commit 1a9df60 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:37:13 2024 -0800 Shared: first cut at fixupBadDurations (trying to deal with Photoscore MusicXML score issues). commit 746c7fc Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:36:51 2024 -0800 More lint. commit 07749a7 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:29:04 2024 -0800 Lint. commit 6c782d0 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:28:15 2024 -0800 Humdrum import: plumbing for optionally fixing syntax errors. commit a708362 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Dec 28 14:27:10 2024 -0800 Pylint: max-positional-arguments=10 commit 42e0407 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 21:50:18 2024 -0800 New test Humdrum file. commit 2169218 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 19:15:10 2024 -0800 Humdrum import: fix mismatched token count errors. commit aad515e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 18:23:24 2024 -0800 Humdrum input: first ignored syntax error implemented, to see how it looks. commit f818f08 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Dec 2 12:22:56 2024 -0800 Humdrum import: better "accept syntax errors" plumbing. commit 56ce4b3 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 21:47:11 2024 -0800 First cut at fixing Humdrum syntax errors. commit 22b70a5 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 20:05:27 2024 -0800 Tests: diffall tests were overwriting eachother's output files sometimes. Avoid that. commit 736a8da Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Dec 1 19:25:20 2024 -0800 Tests: the showdiff* tests also don't need to check for different n_of_parts. commit e495070 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Nov 29 15:01:43 2024 -0800 Tests: musicdiff can handle different number of parts. Stop working around that limitation. commit 18d64dd Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Oct 1 15:29:39 2024 -0700 Shared: Add new M21Utilities.assureXmlIdAndId(obj, prefix). commit 9cfdb29 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Sep 17 13:23:07 2024 -0700 Don't raise exception from StreamFreezer, either. commit cb42b5b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Sep 17 10:52:04 2024 -0700 Do not raise exceptions when thawing a score. commit b7a4873 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Sep 2 13:47:48 2024 -0700 New M21Utilities routine to assure all obj.xmlids and then copy them all to obj.id (with the exception of voice.id, which we leave intact for cross-staff voices). commit 027031b Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Sep 2 12:08:53 2024 -0700 Clean up that score deannotation a bit. commit 90cce68 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Sep 1 16:54:03 2024 -0700 Humdrum export: same thing - clean up all those custom m21 attributes we use during export. commit 173bc62 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Sep 1 16:08:43 2024 -0700 MEI export: carefully make a note of every custom m21 attribute we add to m21 objects during export, and remove them all during MeiScore.deannotateScore(). MEI import: rename all custom m21 attributes we add during import from 'mei_*' to 'meireader_*', so they don't conflict with the exporter's custom m21 attributes. commit f94d673 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 16:30:14 2024 -0700 MEI export: don't start or end a tie on a note within a chordSYMBOL. Similarly, beams and tuplets. commit 906fc4a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 13:20:00 2024 -0700 delint. commit 3750e2a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 30 13:18:29 2024 -0700 Shared: new M21Utilities for 3rd parties. commit 80820fe Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Tue Aug 27 11:04:32 2024 -0700 Shared: first cut at M21Utilities FreezeThaw stuff (borrowed from music21 and modified for our purposes). commit 600f365 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 26 11:17:14 2024 -0700 Shared: rename M21Utilities._updatePitches(cs) to M21Utilities.updatePitches(cs), so external clients can call it. commit e59b05a Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Aug 25 15:29:25 2024 -0700 MEI import: Keep more xml:ids as obj.id (ChordSymbol and TextExpression, etc). commit 588a46e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sat Aug 24 15:42:14 2024 -0700 MEI export: more xmlids; layer@n now gets a low integer always, and if voice.id is a string it goes in layer@label. voice.c21_label overrides voice.id in layer@label. commit 20736f2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Wed Aug 21 17:55:43 2024 -0700 Shared: More xmlid stuff. commit 6057c1e Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Wed Aug 21 14:48:30 2024 -0700 Shared/MEI export: Move XmlId routines and the various MeiWhateverSpanners to M21Utilities. commit f799bf1 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 19 15:45:17 2024 -0700 lint commit eedc0b2 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Mon Aug 19 15:33:01 2024 -0700 MEI import/export: move some ChordSymbol utilities to M21Utilities, for other clients to use. commit 6a0d146 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Fri Aug 16 14:27:09 2024 -0700 A little <harm> cleanup. Should make no difference (ha!). commit ba9f1a7 Author: Greg Chapman <75333244+gregchapman-dev@users.noreply.github.com> Date: Sun Aug 11 15:19:54 2024 -0700 MEI export: handle barline type 'heavy-light' (MEI doesn't have it).
1 parent e73b3b7 commit 5fa05b8

12 files changed

Lines changed: 82 additions & 44 deletions

ReleaseNotes_3.4.0.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Changes since 3.3.0:
2+
Very small update to work with musicdiff v4.2.0.

converter21/HumdrumConverter.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,19 @@ def parseData(
4343
Create HumdrumFile object from a string, and create a music21 Stream from it.
4444
'''
4545
# print("parsing krn string", file=sys.stderr)
46-
hf = HumdrumFile(acceptSyntaxErrors=acceptSyntaxErrors)
47-
hf.readString(dataString)
48-
self.stream = hf.createMusic21Stream()
49-
self.humdrumFile = hf
46+
try:
47+
hf = HumdrumFile(acceptSyntaxErrors=acceptSyntaxErrors)
48+
hf.readString(dataString)
49+
self.stream = hf.createMusic21Stream()
50+
self.humdrumFile = hf
51+
except Exception as e:
52+
if acceptSyntaxErrors:
53+
# acceptSyntaxErrors means "do not raise exceptions on syntax errors".
54+
# if HumdrumFile raised an exception, it could not work around all the
55+
# syntax errors, so we must return an empty score.
56+
return stream.Score()
57+
raise e
58+
5059
return self.stream
5160

5261
# pylint: disable=arguments-differ
@@ -63,9 +72,18 @@ def parseFile(
6372
may be utf-8 or latin-1, so we need to handle various text encodings ourselves.
6473
'''
6574
# print("parsing krn file", file=sys.stderr)
66-
hf = HumdrumFile(fileName=filePath, acceptSyntaxErrors=acceptSyntaxErrors)
67-
self.stream = hf.createMusic21Stream()
68-
self.humdrumFile = hf
75+
try:
76+
hf = HumdrumFile(fileName=filePath, acceptSyntaxErrors=acceptSyntaxErrors)
77+
self.stream = hf.createMusic21Stream()
78+
self.humdrumFile = hf
79+
except Exception as e:
80+
if acceptSyntaxErrors:
81+
# acceptSyntaxErrors means "do not raise exceptions on syntax errors".
82+
# if HumdrumFile raised an exception, it could not work around all the
83+
# syntax errors, so we must return an empty score.
84+
return stream.Score()
85+
raise e
86+
6987
return self.stream
7088

7189
# pylint: disable=arguments-differ

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import setuptools
1212

1313
# must be kept up to date with converter21/shared/sharedconstants.py:_CONVERTER21_VERSION et al
14-
converter21version = '3.3.0'
14+
converter21version = '3.4.0'
1515

1616
if __name__ == '__main__':
1717
setuptools.setup(

tests/diffallHumImportVsHumExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,35 @@ def oplistSummary(
165165
elif op[0] == 'extradel':
166166
# op[1] only
167167
assert isinstance(op[1], AnnExtra)
168-
key = op[1].content
168+
key = op[1].kind
169169
if counts.get(key, None) is None:
170170
counts[key] = 0
171171
counts[key] += 1
172172
elif op[0] == 'extrains':
173173
# op[2] only
174174
assert isinstance(op[2], AnnExtra)
175-
key = op[2].content
175+
key = op[2].kind
176176
if counts.get(key, None) is None:
177177
counts[key] = 0
178178
counts[key] += 1
179179
elif op[0] in ('extrasub',
180180
'extracontentedit',
181+
'extrasymboledit',
182+
'extrainfoedit',
181183
'extraoffsetedit',
182184
'extradurationedit'):
183185
# op[1] and op[2]
184186
assert isinstance(op[1], AnnExtra)
185187
assert isinstance(op[2], AnnExtra)
186-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
188+
key = op[1].kind
187189
if counts.get(key, None) is None:
188190
counts[key] = 0
189191
counts[key] += 1
190192
elif op[0] == 'extrastyleedit':
191193
# op[1] and op[2]
192194
assert isinstance(op[1], AnnExtra)
193195
assert isinstance(op[2], AnnExtra)
194-
key = op[1].content + ':style'
196+
key = op[1].kind + ':style'
195197
if counts.get(key, None) is None:
196198
counts[key] = 0
197199
counts[key] += 1

tests/diffallHumImportVsMeiExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,35 @@ def oplistSummary(
165165
elif op[0] == 'extradel':
166166
# op[1] only
167167
assert isinstance(op[1], AnnExtra)
168-
key = op[1].content
168+
key = op[1].kind
169169
if counts.get(key, None) is None:
170170
counts[key] = 0
171171
counts[key] += 1
172172
elif op[0] == 'extrains':
173173
# op[2] only
174174
assert isinstance(op[2], AnnExtra)
175-
key = op[2].content
175+
key = op[2].kind
176176
if counts.get(key, None) is None:
177177
counts[key] = 0
178178
counts[key] += 1
179179
elif op[0] in ('extrasub',
180180
'extracontentedit',
181+
'extrasymboledit',
182+
'extrainfoedit',
181183
'extraoffsetedit',
182184
'extradurationedit'):
183185
# op[1] and op[2]
184186
assert isinstance(op[1], AnnExtra)
185187
assert isinstance(op[2], AnnExtra)
186-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
188+
key = op[1].kind
187189
if counts.get(key, None) is None:
188190
counts[key] = 0
189191
counts[key] += 1
190192
elif op[0] == 'extrastyleedit':
191193
# op[1] and op[2]
192194
assert isinstance(op[1], AnnExtra)
193195
assert isinstance(op[2], AnnExtra)
194-
key = op[1].content + ':style'
196+
key = op[1].kind + ':style'
195197
if counts.get(key, None) is None:
196198
counts[key] = 0
197199
counts[key] += 1

tests/diffallHumVerovioVsMeiExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,35 @@ def oplistSummary(
165165
elif op[0] == 'extradel':
166166
# op[1] only
167167
assert isinstance(op[1], AnnExtra)
168-
key = op[1].content
168+
key = op[1].kind
169169
if counts.get(key, None) is None:
170170
counts[key] = 0
171171
counts[key] += 1
172172
elif op[0] == 'extrains':
173173
# op[2] only
174174
assert isinstance(op[2], AnnExtra)
175-
key = op[2].content
175+
key = op[2].kind
176176
if counts.get(key, None) is None:
177177
counts[key] = 0
178178
counts[key] += 1
179179
elif op[0] in ('extrasub',
180180
'extracontentedit',
181+
'extrasymboledit',
182+
'extrainfoedit',
181183
'extraoffsetedit',
182184
'extradurationedit'):
183185
# op[1] and op[2]
184186
assert isinstance(op[1], AnnExtra)
185187
assert isinstance(op[2], AnnExtra)
186-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
188+
key = op[1].kind
187189
if counts.get(key, None) is None:
188190
counts[key] = 0
189191
counts[key] += 1
190192
elif op[0] == 'extrastyleedit':
191193
# op[1] and op[2]
192194
assert isinstance(op[1], AnnExtra)
193195
assert isinstance(op[2], AnnExtra)
194-
key = op[1].content + ':style'
196+
key = op[1].kind + ':style'
195197
if counts.get(key, None) is None:
196198
counts[key] = 0
197199
counts[key] += 1

tests/diffallHumVsMeiImport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,33 +165,35 @@ def oplistSummary(
165165
elif op[0] == 'extradel':
166166
# op[1] only
167167
assert isinstance(op[1], AnnExtra)
168-
key = op[1].content
168+
key = op[1].kind
169169
if counts.get(key, None) is None:
170170
counts[key] = 0
171171
counts[key] += 1
172172
elif op[0] == 'extrains':
173173
# op[2] only
174174
assert isinstance(op[2], AnnExtra)
175-
key = op[2].content
175+
key = op[2].kind
176176
if counts.get(key, None) is None:
177177
counts[key] = 0
178178
counts[key] += 1
179179
elif op[0] in ('extrasub',
180180
'extracontentedit',
181+
'extrasymboledit',
182+
'extrainfoedit',
181183
'extraoffsetedit',
182184
'extradurationedit'):
183185
# op[1] and op[2]
184186
assert isinstance(op[1], AnnExtra)
185187
assert isinstance(op[2], AnnExtra)
186-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
188+
key = op[1].kind
187189
if counts.get(key, None) is None:
188190
counts[key] = 0
189191
counts[key] += 1
190192
elif op[0] == 'extrastyleedit':
191193
# op[1] and op[2]
192194
assert isinstance(op[1], AnnExtra)
193195
assert isinstance(op[2], AnnExtra)
194-
key = op[1].content + ':style'
196+
key = op[1].kind + ':style'
195197
if counts.get(key, None) is None:
196198
counts[key] = 0
197199
counts[key] += 1

tests/diffallMeiImportVsMeiExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,33 +164,35 @@ def oplistSummary(
164164
elif op[0] == 'extradel':
165165
# op[1] only
166166
assert isinstance(op[1], AnnExtra)
167-
key = op[1].content
167+
key = op[1].kind
168168
if counts.get(key, None) is None:
169169
counts[key] = 0
170170
counts[key] += 1
171171
elif op[0] == 'extrains':
172172
# op[2] only
173173
assert isinstance(op[2], AnnExtra)
174-
key = op[2].content
174+
key = op[2].kind
175175
if counts.get(key, None) is None:
176176
counts[key] = 0
177177
counts[key] += 1
178178
elif op[0] in ('extrasub',
179179
'extracontentedit',
180+
'extrasymboledit',
181+
'extrainfoedit',
180182
'extraoffsetedit',
181183
'extradurationedit'):
182184
# op[1] and op[2]
183185
assert isinstance(op[1], AnnExtra)
184186
assert isinstance(op[2], AnnExtra)
185-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
187+
key = op[1].kind
186188
if counts.get(key, None) is None:
187189
counts[key] = 0
188190
counts[key] += 1
189191
elif op[0] == 'extrastyleedit':
190192
# op[1] and op[2]
191193
assert isinstance(op[1], AnnExtra)
192194
assert isinstance(op[2], AnnExtra)
193-
key = op[1].content + ':style'
195+
key = op[1].kind + ':style'
194196
if counts.get(key, None) is None:
195197
counts[key] = 0
196198
counts[key] += 1

tests/diffallMusicXMLImportVsHumdrumExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,35 @@ def oplistSummary(
166166
elif op[0] == 'extradel':
167167
# op[1] only
168168
assert isinstance(op[1], AnnExtra)
169-
key = op[1].content
169+
key = op[1].kind
170170
if counts.get(key, None) is None:
171171
counts[key] = 0
172172
counts[key] += 1
173173
elif op[0] == 'extrains':
174174
# op[2] only
175175
assert isinstance(op[2], AnnExtra)
176-
key = op[2].content
176+
key = op[2].kind
177177
if counts.get(key, None) is None:
178178
counts[key] = 0
179179
counts[key] += 1
180180
elif op[0] in ('extrasub',
181181
'extracontentedit',
182+
'extrasymboledit',
183+
'extrainfoedit',
182184
'extraoffsetedit',
183185
'extradurationedit'):
184186
# op[1] and op[2]
185187
assert isinstance(op[1], AnnExtra)
186188
assert isinstance(op[2], AnnExtra)
187-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
189+
key = op[1].kind
188190
if counts.get(key, None) is None:
189191
counts[key] = 0
190192
counts[key] += 1
191193
elif op[0] == 'extrastyleedit':
192194
# op[1] and op[2]
193195
assert isinstance(op[1], AnnExtra)
194196
assert isinstance(op[2], AnnExtra)
195-
key = op[1].content + ':style'
197+
key = op[1].kind + ':style'
196198
if counts.get(key, None) is None:
197199
counts[key] = 0
198200
counts[key] += 1

tests/diffallMusicXMLImportVsMeiExport.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,35 @@ def oplistSummary(
166166
elif op[0] == 'extradel':
167167
# op[1] only
168168
assert isinstance(op[1], AnnExtra)
169-
key = op[1].content
169+
key = op[1].kind
170170
if counts.get(key, None) is None:
171171
counts[key] = 0
172172
counts[key] += 1
173173
elif op[0] == 'extrains':
174174
# op[2] only
175175
assert isinstance(op[2], AnnExtra)
176-
key = op[2].content
176+
key = op[2].kind
177177
if counts.get(key, None) is None:
178178
counts[key] = 0
179179
counts[key] += 1
180180
elif op[0] in ('extrasub',
181181
'extracontentedit',
182+
'extrasymboledit',
183+
'extrainfoedit',
182184
'extraoffsetedit',
183185
'extradurationedit'):
184186
# op[1] and op[2]
185187
assert isinstance(op[1], AnnExtra)
186188
assert isinstance(op[2], AnnExtra)
187-
key = op[1].content # a little weird for "extracontentedit", but that's pretty rare
189+
key = op[1].kind
188190
if counts.get(key, None) is None:
189191
counts[key] = 0
190192
counts[key] += 1
191193
elif op[0] == 'extrastyleedit':
192194
# op[1] and op[2]
193195
assert isinstance(op[1], AnnExtra)
194196
assert isinstance(op[2], AnnExtra)
195-
key = op[1].content + ':style'
197+
key = op[1].kind + ':style'
196198
if counts.get(key, None) is None:
197199
counts[key] = 0
198200
counts[key] += 1

0 commit comments

Comments
 (0)