Maybe one addition:
fromEnd =
#(define-music-function (delta ev mus) (ly:duration? ly:music? ly:music?)
(_i "Add music @var{ev} with a distance of @var{delta} before the end of
@var{ev} is usually a post-event.")
#{
\context Bottom
<<
{
\skip $(make-duration-of-length (- (ly:music-length mus)
(ly:duration-length delta)))
<> $ev
}
#mus
>> #})
{
<>(
<>\<
\after 2 \>
\after 16*15 )
\fromEnd 16 \!
\fromEnd 8 ->
\repeat unfold 8 {e''16 d''} |
}
In ordner to make this work with slightly older LilyPond versions, one
has to replace "-" by "ly:moment-sub":
\skip $(make-duration-of-length (ly:moment-sub
(ly:music-length mus)
(ly:duration-length delta)))
The operator overloading that allows for "naive" arithmetic with moments
was only added sometime in the 2.25.x series.
Lukas