From: Reinhold Kainhofer Date: Wed, 20 Aug 2008 23:47:44 +0000 (+0200) Subject: MusicXML: Implement harp-pedals, now that it's available in lilypond X-Git-Tag: release/2.11.57-1~34^2~4 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5c16cff0e4116626034028b7a8d6311776164215;p=lilypond.git MusicXML: Implement harp-pedals, now that it's available in lilypond --- diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 886479a893..e835d68753 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -1157,6 +1157,21 @@ def musicxml_rehearsal_to_ly_mark (mxl_event): ev = musicexp.MarkEvent ("\\markup { %s }" % text) return ev +def musicxml_harp_pedals_to_ly (mxl_event): + count = 0 + result = "\\harp-pedal #\"" + for t in mxl_event.get_named_children ('pedal-tuning'): + alter = t.get_named_child ('pedal-alter') + if alter: + val = int (alter.get_text ().strip ()) + result += {1: "v", 0: "-", -1: "^"}.get (val, "") + count += 1 + if count == 3: + result += "|" + ev = musicexp.MarkupEvent () + ev.contents = result + "\"" + return ev + def musicxml_eyeglasses_to_ly (mxl_event): needed_additional_definitions.append ("eyeglasses") return musicexp.MarkEvent ("\\eyeglasses") @@ -1222,7 +1237,7 @@ directions_dict = { # 'damp' : ??? # 'damp-all' : ??? 'eyeglasses': musicxml_eyeglasses_to_ly, -# 'harp-pedals' : ??? + 'harp-pedals' : musicxml_harp_pedals_to_ly, # 'image' : ??? 'metronome' : musicxml_metronome_to_ly, 'rehearsal' : musicxml_rehearsal_to_ly_mark,