]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1676: Properly count the notes in a chord tremolo (ignore all non-note events)
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 10 Jul 2011 21:12:12 +0000 (23:12 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 12 Jul 2011 17:17:54 +0000 (19:17 +0200)
input/regression/chord-tremolo-other-commands.ly [new file with mode: 0644]
scm/music-functions.scm

diff --git a/input/regression/chord-tremolo-other-commands.ly b/input/regression/chord-tremolo-other-commands.ly
new file mode 100644 (file)
index 0000000..f8c347b
--- /dev/null
@@ -0,0 +1,24 @@
+\version "2.15.5"
+
+\header {
+  texidoc = "
+To calculate the total duration of chord tremolos, only real notes shall be 
+counted, no other commands.
+"
+}
+
+right = \relative c'' {
+  s2
+}
+
+left = \relative c' {
+  % This tremolo contains just two notes (but three lilypond events/commands!)
+  \repeat tremolo 4 { f,16 \change Staff = "right" f'} 
+}
+
+\score {
+  \new PianoStaff <<
+    \new Staff = "right" { \right }
+    \new Staff = "left" { \clef bass \left }
+  >>
+}
index 7c52d41846632b8ffda35086e6cdf49b032949ec..8d828db8694c2fdb3ac7c8b1cf7876715b128c15 100644 (file)
@@ -278,7 +278,7 @@ through MUSIC."
        ;; This works for single-note and multi-note tremolos!
        (let* ((children (if (music-is-of-type? main 'sequential-music)
                             ;; \repeat tremolo n { ... }
-                            (length (ly:music-property main 'elements))
+                            (length (extract-named-music main 'EventChord))
                             ;; \repeat tremolo n c4
                             1))
               ;; # of dots is equal to the 1 in bitwise representation (minus 1)!
@@ -304,7 +304,7 @@ through MUSIC."
 (define (calc-repeat-slash-count music)
   "Given the child-list @var{music} in @code{PercentRepeatMusic},
 calculate the number of slashes based on the durations.  Returns @code{0}
-if durations in in @var{music} vary, allowing slash beats and double-percent
+if durations in @var{music} vary, allowing slash beats and double-percent
 beats to be distinguished."
   (let* ((durs (map (lambda (elt)
                      (duration-of-note elt))