]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/part-combiner.scm
Merge branch 'master' of /home/jcharles/GIT/Lily/. into translation
[lilypond.git] / scm / part-combiner.scm
index dadce948634ccae8db3a4eef0d17e4fd7828bbf3..dd3152cbb7125bfd025e2a85cefdd95f4fa73b5f 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2004--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2004--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
@@ -198,6 +198,13 @@ Voice-state objects
 
   (helper 0 '()))
 
+(define recording-group-functions
+  ;;Selected parts from @var{toplevel-music-functions} not requiring @code{parser}.
+  (list
+   (lambda (music) (expand-repeat-chords! '(rhythmic-event) music))
+   expand-repeat-notes!))
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (define-public (recording-group-emulate music odef)
   "Interpret @var{music} according to @var{odef}, but store all events
@@ -240,7 +247,10 @@ LilyPond version 2.8 and earlier."
     (ly:add-listener new-context-listener
                      (ly:context-events-below global) 'AnnounceNewContext)
     (ly:add-listener mom-listener (ly:context-event-source global) 'Prepare)
-    (ly:interpret-music-expression (make-non-relative-music music) global)
+    (ly:interpret-music-expression
+     (make-non-relative-music
+      (fold (lambda (x m) (x m)) music recording-group-functions))
+     global)
     context-list))
 
 (define-public (make-part-combine-music parser music-list direction)
@@ -275,9 +285,9 @@ LilyPond version 2.8 and earlier."
     (define (analyse-forced-combine result-idx prev-res)
 
       (define (get-forced-event x)
-        (if (ly:in-event-class? x 'part-combine-force-event)
-            (cons (ly:event-property x 'forced-type) (ly:event-property x 'once))
-            #f))
+        (and (ly:in-event-class? x 'part-combine-force-event)
+             (cons (ly:event-property x 'forced-type)
+                   (ly:event-property x 'once))))
       (define (part-combine-events vs)
         (if (not vs)
             '()
@@ -338,7 +348,7 @@ Only set if not set previously.
                  (prev (configuration prev-ss)))
             (if (symbol? prev)
                 (put prev))))
-        (map copy-one-state (span-state vs)))
+        (for-each copy-one-state (span-state vs)))
 
       (define (analyse-notes now-state)
         (let* ((vs1 (car (voice-states now-state)))