From 33dd448c34f9f667c3d1c4722f5bc7c229251b6b Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Fri, 8 Nov 2013 18:40:41 +0100 Subject: [PATCH] Issue 3648/4: Let \displayLilyMusic deal with pure rhythms --- input/regression/display-lily-tests.ly | 3 +++ scm/define-music-display-methods.scm | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/input/regression/display-lily-tests.ly b/input/regression/display-lily-tests.ly index a4abc604d1..10dccdded2 100644 --- a/input/regression/display-lily-tests.ly +++ b/input/regression/display-lily-tests.ly @@ -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 diff --git a/scm/define-music-display-methods.scm b/scm/define-music-display-methods.scm index fd759d52d1..32a747aba8 100644 --- a/scm/define-music-display-methods.scm +++ b/scm/define-music-display-methods.scm @@ -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)) -- 2.39.2