]> git.donarmstrong.com Git - lilypond.git/commitdiff
Replace duration-of-note with a more simple-minded variant working for chord repeats...
authorDavid Kastrup <dak@gnu.org>
Mon, 6 Feb 2012 10:22:37 +0000 (11:22 +0100)
committerDavid Kastrup <dak@gnu.org>
Mon, 6 Feb 2012 11:17:34 +0000 (12:17 +0100)
scm/music-functions.scm

index 4586fbfb665dc120c3d5868f2863e2476b3e66f1..1666084735b997db40fb812d1f4d26a76712775b 100644 (file)
@@ -1581,13 +1581,16 @@ Entries that conform with the current key signature are not invalidated."
         (ly:music-property (car evs) 'pitch))))
 
 (define-public (duration-of-note event-chord)
-  (let ((evs (filter (lambda (x)
-                      (music-has-type x 'rhythmic-event))
-                    (cons event-chord
-                          (ly:music-property event-chord 'elements)))))
-
-    (and (pair? evs)
-        (ly:music-property (car evs) 'duration))))
+  (cond
+   ((pair? event-chord)
+    (or (duration-of-note (car event-chord))
+       (duration-of-note (cdr event-chord))))
+   ((ly:music? event-chord)
+    (let ((dur (ly:music-property event-chord 'duration)))
+      (if (ly:duration? dur)
+         dur
+         (duration-of-note (ly:music-property event-chord 'elements)))))
+   (else #f)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;