]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/part-combiner.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / part-combiner.scm
index 65ce520d21fcf91c4d5dd3dc4ea54b39fff205df..56b43892b98d8b2759a5c6b83f0b9cbab778de14 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  source file of the GNU LilyPond music typesetter
 ;;;; 
-;;;; (c)  2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2004--2006    Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
 ;; todo: figure out how to make module,
 ;; without breaking nested ly scopes
@@ -188,7 +188,7 @@ Voice-state objects
 (define part-combine-listener '())
 
 ; UGH - should pass noticed setter to part-combine-listener
-(define-public (set-part-combine-listener x)
+(define-safe-public (set-part-combine-listener x)
   (set! part-combine-listener x))
 
 (define-public (notice-the-events-for-pc context lst)
@@ -430,7 +430,7 @@ the mark when there are no spanners active."
 
     (analyse-spanner-states voice-state-vec1)
     (analyse-spanner-states voice-state-vec2)
-    (if #t
+    (if #f
        (begin
          (display voice-state-vec1)
          (display "***\n")
@@ -451,51 +451,6 @@ the mark when there are no spanners active."
         (display result))
     result))
 
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; autochange - fairly related to part combining.
-
-(define-public (make-autochange-music music)
-  (define (generate-split-list change-moment event-list acc)
-    (if (null? event-list)
-       acc
-       (let* ((now-tun (caar event-list))
-              (evs (map car (cdar event-list)))
-              (now (car now-tun))
-              (notes (filter (lambda (x)
-                               (equal? (ly:music-property  x 'name) 'NoteEvent))
-                             evs))
-              (pitch (if (pair? notes)
-                         (ly:music-property (car notes) 'pitch)
-                         #f)))
-         ;; tail recursive.
-         (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
-             (generate-split-list #f
-                                  (cdr event-list)
-                                  (cons (cons
-
-                                         (if change-moment
-                                             change-moment
-                                             now)
-                                         (sign (ly:pitch-steps pitch))) acc))
-             (generate-split-list
-              (if pitch #f now)
-              (cdr event-list) acc)))))
-  
-  (set! noticed '())
-  (let* ((m (make-music 'AutoChangeMusic))
-        (context (ly:run-translator (make-non-relative-music music) part-combine-listener))
-        (evs (last-pair noticed))
-        (split (reverse! (generate-split-list
-                          #f
-                          (if (pair? evs)
-                              (reverse! (cdar evs) '()) '())
-                          '())
-                         '())))
-    (set! (ly:music-property m 'element) music)
-    (set! (ly:music-property m 'split-list) split)
-    (set! noticed '())
-    m))
-
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -506,7 +461,6 @@ the mark when there are no spanners active."
                                     part-combine-listener))
         (first-voice-handle (last-pair noticed)))
 
-    ;; (display (last-pair noticed))
     (if (pair? first-voice-handle)
        (hash-set! tab name
                   ;; cdr : skip name string