Hi Jan-Peter
...
\version "2.19.57"
test =
#(define-music-function (mus)(ly:music?)
(let* ((elms (ly:music-property mus 'elements))
; first and last music-element ...
(frst (first elms)) ; TODO test for list? and ly:music?
(lst (last elms)) ; TODO test for list? and ly:music?
(fartic (ly:music-property frst 'articulations '())) ; look
for eventchords ...
(lartic (ly:music-property lst 'articulations '()))
)
(ly:music-set-property! frst 'articulations `(,@fartic
,(make-music 'NoteGroupingEvent 'span-direction -1)))
(ly:music-set-property! lst 'articulations `(,@lartic
,(make-music 'NoteGroupingEvent 'span-direction 1)))
#{
#mus
#}))
\new Staff \with {
\consists "Horizontal_bracket_engraver"
} {
\test { c' d' e' f' } g' a' b' c''
}
HTH
Yes, it does. I don't think there's an even more straightforward
solution (like the <> for the first element) to this. I successfully
integrated it into my code.
But what would be the cases where the element is a list? instead of
ly:music? And what does the "eventchords" comment refer to?