Am 21.03.2017 um 10:46 schrieb Malte Meyn:
> (By the way: I think that the way LilyPond handles it (using “grace” and
> “real time”) is pretty good but not perfect. \grace only needs grace
> time but \afterGrace needs real time for vertical alignment (but not for
> input of the notes)—it would be nice to have 1. \grace before barlines
> and 2. grace/afterGrace notes that are vertically aligned indepentently
> from real time notes if you don’t want them between the real notes. And
> maybe 3. some function that helps to align f. e. 7 grace notes in the
> right and 6 in the left hand without having to scale them by hand -> a
> function that takes notes and scales them so that they get a given total
> length. Maybe if I find some time I’ll make some sketches that
> illustrate 2. and pseudo code that illustrates 3.)
Something like this?
\version "2.19.54"
scaledGrace =
#(define-music-function (duration mus)(fraction? ly:music?)
(let* ((real-len (ly:music-length mus))
(dur (ly:make-moment (/ (car duration) (cdr duration))))
(ratio-mom (ly:moment-div dur real-len))
(ratio (cons (ly:moment-main-numerator ratio-mom)
(ly:moment-main-denominator ratio-mom))))
#{
\grace \scaleDurations #ratio #mus
#}))
{
<<
{
c''2
\scaledGrace 1/4 {
c''16 [ d'' e'' ]
}
f''2
}
\\
{
c'2
\scaledGrace 1/4 {
c'16 b c' d' e'
}
f'2
}
>>
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user