]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/autochange.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / autochange.scm
index e4a27d7063703ca8eb73ad8847480741d59b263a..b7169c8a99a31f2662584cb394a98e4cc0ad6dac 100644 (file)
               (evs (map car (cdar event-list)))
               (now (car now-tun))
               (notes (filter (lambda (x)
-                               (equal? (ly:event-property  x 'class) 'note-event))
+                               (equal? (ly:music-property  x 'name) 'NoteEvent))
                              evs))
               (pitch (if (pair? notes)
-                         (ly:event-property (car notes) 'pitch)
+                         (ly:music-property (car notes) 'pitch)
                          #f)))
          ;; tail recursive.
          (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
               (if pitch #f now)
               (cdr event-list) acc)))))
   
+  (set! noticed '())
   (let* ((m (make-music 'AutoChangeMusic))
-       (m1 (make-non-relative-music (context-spec-music music 'Voice "one")))
-        (context-list (recording-group-emulate music part-combine-listener))
-        (evs (car context-list))
-         (rev (reverse! (cdar context-list)))
+        (context (ly:run-translator (make-non-relative-music music) part-combine-listener))
+        (evs (last-pair noticed))
         (split (reverse! (generate-split-list
                           #f
-                          rev
+                          (if (pair? evs)
+                              (reverse! (cdar evs) '()) '())
                           '())
                          '())))
     (set! (ly:music-property m 'element) music)
     (set! (ly:music-property m 'split-list) split)
+    (set! noticed '())
     m))