/usr/share/lilypond/2.16.2/scm/autochange.scm is in lilypond-data 2.16.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; autochange.scm - fairly related to part combining.
(define-public (make-autochange-music parser 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)
(ly:in-event-class? x 'note-event))
evs))
(pitch (if (pair? notes)
(ly:event-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)))))
(let* ((m (make-music 'AutoChangeMusic))
(m1 (make-non-relative-music (context-spec-music music 'Voice "one")))
(context-list (recording-group-emulate music
(ly:parser-lookup parser 'partCombineListener)))
(evs (car context-list))
(rev (reverse! (cdar context-list)))
(split (reverse! (generate-split-list
#f
rev
'())
'())))
(set! (ly:music-property m 'element) music)
(set! (ly:music-property m 'split-list) split)
m))
|