X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fmusicxml2ly.py;h=14c09dadbded444d28d8077e1d695c70481af767;hb=ce1940b6a390c8df724ce2bfb28e9bcf50530b8b;hp=c04101870c6459a33f9a61ad89db6bb3efd93811;hpb=2a8a5dfc4c5f42b693ee4730d7a6223430db5dba;p=lilypond.git diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index c04101870c..14c09dadbd 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -756,11 +756,13 @@ def musicxml_spanner_to_lily_event (mxl_event): return ev def musicxml_direction_to_indicator (direction): - return { "above": 1, "upright": 1, "up":1, "below": -1, "downright": -1, "down": -1 }.get (direction, 0) + return { "above": 1, "upright": 1, "up":1, "below": -1, "downright": -1, "down": -1, "inverted": -1 }.get (direction, 0) def musicxml_fermata_to_lily_event (mxl_event): ev = musicexp.ArticulationEvent () - ev.type = "fermata" + txt = mxl_event.get_text () + # The contents of the element defined the shape, possible are normal, angled and square + ev.type = { "angled": "shortfermata", "square": "longfermata" }.get (txt, "fermata") if hasattr (mxl_event, 'type'): dir = musicxml_direction_to_indicator (mxl_event.type) if dir and options.convert_directions: @@ -776,9 +778,9 @@ def musicxml_tremolo_to_lily_event (mxl_event): ev = musicexp.TremoloEvent () txt = mxl_event.get_text () if txt: - ev.bars = mxl_event.get_text () + ev.bars = txt else: - ev.bars = "3" + ev.bars = "3" return ev def musicxml_falloff_to_lily_event (mxl_event): @@ -796,6 +798,13 @@ def musicxml_bend_to_lily_event (mxl_event): ev.alter = mxl_event.bend_alter () return ev +def musicxml_caesura_to_lily_event (mxl_event): + ev = musicexp.MarkupEvent () + # FIXME: default to straight or curved caesura? + ev.contents = "\\musicglyph #\"scripts.caesura.straight\"" + ev.force_direction = 1 + return ev + def musicxml_fingering_event (mxl_event): ev = musicexp.ShortArticulationEvent () ev.type = mxl_event.get_text () @@ -845,7 +854,7 @@ articulations_dict = { "accidental-mark": musicxml_accidental_mark, "bend": musicxml_bend_to_lily_event, "breath-mark": (musicexp.NoDirectionArticulationEvent, "breathe"), - #"caesura": "caesura", + "caesura": musicxml_caesura_to_lily_event, #"delayed-turn": "?", "detached-legato": (musicexp.ShortArticulationEvent, "_"), # or "portato" "doit": musicxml_doit_to_lily_event, @@ -878,7 +887,7 @@ articulations_dict = { "strong-accent": (musicexp.ShortArticulationEvent, "^"), # or "marcato" #"tap": "", "tenuto": (musicexp.ShortArticulationEvent, "-"), # or "tenuto" - #"thumb-position": "", + "thumb-position": "thumb", #"toe": "", "turn": "turn", "tremolo": musicxml_tremolo_to_lily_event,