]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3648/4: Let \displayLilyMusic deal with pure rhythms
authorDavid Kastrup <dak@gnu.org>
Fri, 8 Nov 2013 17:40:41 +0000 (18:40 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 19 Nov 2013 10:11:56 +0000 (11:11 +0100)
input/regression/display-lily-tests.ly
scm/define-music-display-methods.scm

index a4abc604d1c09dbd86791a4e4e0a08caa3c1c4ae..10dccdded23fe18fc05ba38c22ff89e8b3d2f09b 100644 (file)
@@ -183,6 +183,9 @@ stderr of this run."
 \test ##[ \tuplet 3/2 { c4 d e \tuplet 5/2 { f4 e d2 d4 } c4 } #]
 \test ##[ \tuplet 3/2 2 { c4 d e \tuplet 5/2 2 { f4 e d2 d4 } c4 } #]
 
+%% pure rhythm
+\test ##[ { 4 4 8 \tuplet 3/2 { 8[ 16] } 16 } #]
+
 %% \relative and \tranpose
 \test #"NOT A BUG" ##[ \relative c' { c b } #] % RelativeOctaveMusic
 \test #"NOT A BUG" ##[ \transpose c d { c d } #]       % TransposedMusic
index fd759d52d154cae4c76e326fe09f7ea3303bcc77..32a747aba8504db978364bac70075ece2abe0179 100644 (file)
@@ -526,8 +526,17 @@ Otherwise, return #f."
                  (map-in-order (lambda (event)
                                  (music->lily-string event parser))
                                (ly:music-property note 'articulations))))
-        (else ;; unknown?
-         "")))
+        (else
+         ;; pure duration
+         ;; FIXME: { c4 c4 4 4 } must not be output as { c4 c 4 4 }
+         ;; quite tricky to do.  Do it when outputting sequences?
+         (format #f "~a~{~a~}"
+                 (duration->lily-string (ly:music-property note 'duration)
+                                        #:force-duration #t
+                                        #:remember #t)
+                 (map-in-order (lambda (event)
+                                 (music->lily-string event parser))
+                               (ly:music-property note 'articulations))))))
 
 (define-display-method ClusterNoteEvent (note parser)
   (simple-note->lily-string note parser))