2 #(define (voicify-list lst number)
3 "Make a list of Musics.
5 voicify-list :: [ [Music ] ] -> number -> [Music]
6 LST is a list music-lists.
10 (cons (context-spec-music
11 (make-sequential-music
13 (make-voice-props-set number)
14 (make-simultaneous-music (car lst))))
16 "Voice" (number->string number))
17 (voicify-list (cdr lst) (+ number 1))
21 #(define (voicify-chord ch)
22 "Split the parts of a chord into different Voices using separator"
23 (let* ((es (ly-get-mus-property ch 'elements)))
26 (ly-set-mus-property ch 'elements
27 (voicify-list (split-list es music-separator?) 0))
31 #(define (voicify-music m)
32 "Recursively split chords that are separated with \\ "
39 ((es (ly-get-mus-property m 'elements))
40 (e (ly-get-mus-property m 'element))
44 (and (equal? (ly-music-name m) "Simultaneous_music")
45 (reduce (lambda (x y ) (or x y)) (map music-separator? es)))
49 (ly-set-mus-property m 'elements (map voicify-music es)))
51 (ly-set-mus-property m 'element (voicify-music e)))
58 \score { \notes \context Staff \relative c''
59 \apply #voicify-music {
60 c4 <g' \\ c, \\ f \\ d > f g < c \\ d> a