]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/musicexp.py
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / python / musicexp.py
index adce6911013d207cbb5042f068d3ab975ad9b0a5..2ae8a6784f3ea480f3343d6539323fd79ec706d0 100644 (file)
@@ -2,9 +2,9 @@ import inspect
 import sys
 import string
 import re
-import lilylib
+import lilylib as ly
 
-_ = lilylib._
+_ = ly._
 
 from rational import Rational
 
@@ -155,8 +155,12 @@ class Duration:
     def ly_expression (self, factor = None):
         if not factor:
             factor = self.factor
-            
-        str = '%d%s' % (1 << self.duration_log, '.'*self.dots)
+
+        if self.duration_log < 0:
+            str = {-1: "\\breve", -2: "\\longa"}.get (self.duration_log, "1")
+        else:
+            str = '%d' % (1 << self.duration_log)
+        str += '.'*self.dots
 
         if factor <> Rational (1,1):
             if factor.denominator () <> 1:
@@ -855,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):