On 11/01/2016 09:50 PM, Paul wrote:

so I'm not sure how or even whether this kind of thing can be done in user space (at least not with existing functions like map-some-music).

Well, here's a start on something, but still not sure how to pull it off fully:

\version "2.19.49"

split =
#(define-music-function (directions music) (list? ly:music?)

   (let* ((elts (ly:music-property music 'elements))
          (elts2 (map (lambda (el dir)

                        (display dir)(newline)
                        (display el)(newline)

;; do something with each sequential music element...
                        (if (equal? dir 'up)
                            #{ \voiceOne #el #}
                            #{ \voiceTwo #el #}))

                   elts directions)))

     (make-music 'SequentialMusic 'elements elts2)))


m = { { a4 b } { c'4 d' } { e'4 f' } }

\displayMusic \m

% \new Staff
% \displayMusic
\split up,down,up \m




_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to