From 4faa2f72246a1061a095dac7d7389bb3c24d663e Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Mon, 6 Feb 2012 11:22:37 +0100 Subject: [PATCH] Replace duration-of-note with a more simple-minded variant working for chord repeats as well --- scm/music-functions.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 4586fbfb66..1666084735 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -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))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -- 2.39.2