X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fmusicexp.py;h=61598f28e51e7c58258cc5532c163ce84e45bcb3;hb=1d6225cfe11ea59fe84ee6a29b5735b0798c5ec6;hp=b1df9417f7531cfadcddf8bd72f9cd87d6852ccd;hpb=791d2a229662aac907cf9a26d8a93df8c857cb53;p=lilypond.git diff --git a/python/musicexp.py b/python/musicexp.py index b1df9417f7..61598f28e5 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -508,13 +508,25 @@ class TimeScaledMusic (MusicWrapper): (base_number_function, base_duration)) func.newline () elif self.display_type == "both": # TODO: Implement this using actual_type and normal_type! - warning (_ ("Tuplet brackets displaying both note durations are not implemented, using default")) if self.display_number == None: func ("\\once \\override TupletNumber #'stencil = ##f") func.newline () elif self.display_number == "both": - func ("\\once \\override TupletNumber #'text = #%s" % base_number_function) - func.newline () + den_duration = self.normal_type.ly_expression (None, True) + # If we don't have an actual type set, use the normal duration! + if self.actual_type: + num_duration = self.actual_type.ly_expression (None, True) + else: + num_duration = den_duration + if (self.display_denominator or self.display_numerator): + func ("\\once \\override TupletNumber #'text = #(tuplet-number::non-default-fraction-with-notes %s \"%s\" %s \"%s\")" % + (self.display_denominator, den_duration, + self.display_numerator, num_duration)) + func.newline () + else: + func ("\\once \\override TupletNumber #'text = #(tuplet-number::fraction-with-notes \"%s\" \"%s\")" % + (den_duration, num_duration)) + func.newline () else: if self.display_number == None: func ("\\once \\override TupletNumber #'stencil = ##f") @@ -892,10 +904,10 @@ class BarLine (Music): self.type = None def print_ly (self, printer): - bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': ":", + bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': "dashed", 'heavy': "|", 'light-light': "||", 'light-heavy': "|.", 'heavy-light': ".|", 'heavy-heavy': ".|.", 'tick': "'", - 'short': "'", 'none': "" }.get (self.type, None) + 'short': "'|", 'none': "" }.get (self.type, None) if bar_symbol <> None: printer.dump ('\\bar "%s"' % bar_symbol) else: @@ -1468,11 +1480,6 @@ class KeySignatureChange (Music): elif self.non_standard_alterations: alterations = [self.format_non_standard_alteration (a) for a in self.non_standard_alterations] - # TODO: Check if the alterations should really be given in reverse - # order of if that's just a bug in Lilypond. If it's a bug, - # fix it and remove the following call, otherwise add a - # proper comment here! - alterations.reverse () return "\\set Staff.keySignature = #`(%s)" % string.join (alterations, " ") else: return '' @@ -1700,6 +1707,14 @@ class MultiMeasureRest(Music): return 'R%s' % self.duration.ly_expression () +class Break (Music): + def __init__ (self, tp="break"): + Music.__init__ (self) + self.type = tp + def print_ly (self, printer): + if self.type: + printer.dump ("\\%s" % self.type) + class StaffGroup: def __init__ (self, command = "StaffGroup"): self.stafftype = command