From 1651046f900d47c5be6f3db47b3485bd07d3ec4e Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Tue, 13 Jul 2010 23:17:26 +0100 Subject: [PATCH] Fix bare stem tremolos. * scm/music-functions.scm (make-repeat): don't use length of 'elements for non-sequential repeat tremolos --- scm/music-functions.scm | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index 9f173ff..ae02fb6 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -265,9 +265,14 @@ through MUSIC." (set! (ly:music-property r 'element) main) (set! (ly:music-property r 'repeat-count) (max times 1)) (set! (ly:music-property r 'elements) talts) - (if (and (equal? name "tremolo") (> (length (ly:music-property main 'elements)) 0)) + (if (and (equal? name "tremolo") + (pair? (ly:music-property main 'elements))) ;; This works for single-note and multi-note tremolos! - (let* ((children (length (ly:music-property main 'elements))) + (let* ((children (if (music-is-of-type? main 'sequential-music) + ;; \repeat tremolo n { ... } + (length (ly:music-property main 'elements)) + ;; \repeat tremolo n c4 + 1)) ;; # of dots is equal to the 1 in bitwise representation (minus 1)! (dots (1- (logcount (* times children)))) ;; The remaining missing multiplicator to scale the notes by @@ -282,7 +287,6 @@ through MUSIC." (set! (ly:music-property r 'tremolo-type) tremolo-type) (if (not (integer? mult)) (ly:warning (_ "invalid tremolo repeat count: ~a") times)) - ;; \repeat tremolo n c4 ;; Adjust the time of the notes (ly:music-compress r (ly:make-moment 1 children)) ;; Adjust the displayed note durations -- 1.7.0.4