From: Reinhold Kainhofer Date: Mon, 24 Mar 2008 19:16:02 +0000 (+0100) Subject: MusicXML: Convert brackets as ligature brackets X-Git-Tag: release/2.11.43-2~3^2~2 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=9a44242e970ad466f91c87c4bd9f812796e8517f;p=lilypond.git MusicXML: Convert brackets as ligature brackets --- diff --git a/python/musicexp.py b/python/musicexp.py index 862b5d8c4f..2ae8a6784f 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -859,9 +859,17 @@ class TextSpannerEvent (SpanEvent): 1:'\\stopTextSpan'}.get (self.span_direction, '') class BracketSpannerEvent (SpanEvent): + # Ligature brackets use prefix-notation!!! + def print_before_note (self, printer): + if self.span_direction == -1: + printer.dump ('\[') + # the the bracket after the last note + def print_after_note (self, printer): + if self.span_direction == 1: + printer.dump ('\]') + # we're printing everything in print_(before|after)_note... def ly_expression (self): - return {-1: '\\startGroup', - 1:'\\stopGroup'}.get (self.span_direction, '') + return ''; class OctaveShiftEvent (SpanEvent): diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index f808a8325b..622cba2e8b 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -727,15 +727,10 @@ def musicxml_barline_to_lily (barline): return retval.values () -# Brackets need a special engraver added the Staff context! -def musicxml_bracket_to_ly (): - layout_information.set_context_item ('Staff', '\consists "Horizontal_bracket_engraver" % for \\startGroup and \\stopGroup brackets') - return musicexp.BracketSpannerEvent () - spanner_event_dict = { 'beam' : musicexp.BeamEvent, 'dashes' : musicexp.TextSpannerEvent, - 'bracket' : musicxml_bracket_to_ly, + 'bracket' : musicexp.BracketSpannerEvent, 'glissando' : musicexp.GlissandoEvent, 'octave-shift' : musicexp.OctaveShiftEvent, 'pedal' : musicexp.PedalEvent,