3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4 ;; autochange - fairly related to part combining.
6 (define-public (make-autochange-music parser music)
7 (define (generate-split-list change-moment event-list acc)
10 (let* ((now-tun (caar event-list))
11 (evs (map car (cdar event-list)))
13 (notes (filter (lambda (x)
14 (equal? (ly:event-property x 'class) 'note-event))
16 (pitch (if (pair? notes)
17 (ly:event-property (car notes) 'pitch)
20 (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
21 (generate-split-list #f
28 (sign (ly:pitch-steps pitch))) acc))
31 (cdr event-list) acc)))))
33 (let* ((m (make-music 'AutoChangeMusic))
34 (m1 (make-non-relative-music (context-spec-music music 'Voice "one")))
35 (context-list (recording-group-emulate music
36 (ly:parser-lookup parser 'partCombineListener)))
37 (evs (car context-list))
38 (rev (reverse! (cdar context-list)))
39 (split (reverse! (generate-split-list
44 (set! (ly:music-property m 'element) music)
45 (set! (ly:music-property m 'split-list) split)