]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix bare stem tremolos.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 13 Jul 2010 22:17:26 +0000 (23:17 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Wed, 14 Jul 2010 00:20:37 +0000 (02:20 +0200)
* scm/music-functions.scm (make-repeat):

  don't use length of 'elements for non-sequential repeat tremolos

scm/music-functions.scm

index 9f173ff7641d6544e73852dddc47e232a9fa32e9..ae02fb614a154a45a2aa553bf7ea91a52df40e15 100644 (file)
@@ -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