From 85206d351092c9d3fdeffe90a354fa0f9ac66686 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Tue, 13 Apr 2010 12:17:51 +0200 Subject: [PATCH] MusicXML: Add regtest for cautionary accidentals; cautionary (not editorial) accs are in parentheses --- .../01e-Pitches-ParenthesizedAccidentals.xml | 223 +++++++++++++++++ ...ches-ParenthesizedMicrotoneAccidentals.xml | 224 ++++++++++++++++++ scripts/musicxml2ly.py | 4 +- 3 files changed, 450 insertions(+), 1 deletion(-) create mode 100644 input/regression/musicxml/01e-Pitches-ParenthesizedAccidentals.xml create mode 100644 input/regression/musicxml/01f-Pitches-ParenthesizedMicrotoneAccidentals.xml diff --git a/input/regression/musicxml/01e-Pitches-ParenthesizedAccidentals.xml b/input/regression/musicxml/01e-Pitches-ParenthesizedAccidentals.xml new file mode 100644 index 0000000000..d10c459533 --- /dev/null +++ b/input/regression/musicxml/01e-Pitches-ParenthesizedAccidentals.xml @@ -0,0 +1,223 @@ + + + + + + Accidentals can be cautionary + or editorial. Each measure has a normal accidental, an editorial, + a cautionary and an editioal and cautionary accidental. + + + + + MusicXML Part + + + + + + + 1 + + 0 + major + + + + G + 2 + + + + + D + -1 + 4 + + 1 + 1 + quarter + flat + + + + D + -1 + 4 + + 1 + 1 + quarter + flat + + + + D + -1 + 4 + + 1 + 1 + quarter + flat + + + + D + -1 + 4 + + 1 + 1 + quarter + flat + + + + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + + + + D + -2 + 4 + + 1 + 1 + quarter + double-flat + + + + D + -2 + 4 + + 1 + 1 + quarter + double-flat + + + + D + -2 + 4 + + 1 + 1 + quarter + double-flat + + + + D + -2 + 4 + + 1 + 1 + quarter + double-flat + + + + + + + C + 2 + 4 + + 1 + 1 + quarter + double-sharp + + + + C + 2 + 4 + + 1 + 1 + quarter + double-sharp + + + + C + 2 + 4 + + 1 + 1 + quarter + double-sharp + + + + C + 2 + 4 + + 1 + 1 + quarter + double-sharp + + + + + diff --git a/input/regression/musicxml/01f-Pitches-ParenthesizedMicrotoneAccidentals.xml b/input/regression/musicxml/01f-Pitches-ParenthesizedMicrotoneAccidentals.xml new file mode 100644 index 0000000000..96158eef40 --- /dev/null +++ b/input/regression/musicxml/01f-Pitches-ParenthesizedMicrotoneAccidentals.xml @@ -0,0 +1,224 @@ + + + + + + Microtone accidentals can be + cautionary or editorial. Each measure has a normal accidental, + an editorial, a cautionary and an editioal and cautionary + accidental. + + + + + MusicXML Part + + + + + + + 1 + + 0 + major + + + + G + 2 + + + + + D + -0.5 + 4 + + 1 + 1 + quarter + quarter-flat + + + + D + -0.5 + 4 + + 1 + 1 + quarter + quarter-flat + + + + D + -0.5 + 4 + + 1 + 1 + quarter + quarter-flat + + + + D + -0.5 + 4 + + 1 + 1 + quarter + quarter-flat + + + + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + C + 1 + 4 + + 1 + 1 + quarter + sharp + + + + + + + D + -1.5 + 4 + + 1 + 1 + quarter + three-quarters-flat + + + + D + -1.5 + 4 + + 1 + 1 + quarter + three-quarters-flat + + + + D + -1.5 + 4 + + 1 + 1 + quarter + three-quarters-flat + + + + D + -1.5 + 4 + + 1 + 1 + quarter + three-quarters-flat + + + + + + + C + 1.5 + 4 + + 1 + 1 + quarter + three-quarters-sharp + + + + C + 1.5 + 4 + + 1 + 1 + quarter + three-quarters-sharp + + + + C + 1.5 + 4 + + 1 + 1 + quarter + three-quarters-sharp + + + + C + 1.5 + 4 + + 1 + 1 + quarter + three-quarters-sharp + + + + + diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 318020d8b5..9e4c91adff 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -1867,7 +1867,9 @@ def musicxml_note_to_lily_main_event (n): acc = n.get_maybe_exist_named_child ('accidental') if acc: # let's not force accs everywhere. - event.cautionary = acc.editorial + event.cautionary = acc.cautionary + # TODO: Handle editorial accidentals + # TODO: Handle the level-display setting for displaying brackets/parentheses elif n.get_maybe_exist_typed_child (musicxml.Unpitched): # Unpitched elements have display-step and can also have -- 2.39.5