On 22.01.2016 16:11, Simon Albrecht wrote:
The feature is designed for a very specific case: Renaissance vocal
music, one voice per staff, no chords, no dynamics etc. With this
callback, I crop those stems which protrude beyond the staff, such as
to allow for still closer vertical spacing.
Oops, there was an else-statement missing. Here again:
%%%%%%%%%%%%%%
\version "2.19.35"
#(define crop-outside-staff-stem
(lambda (grob)
(let* ((note-col (ly:grob-parent grob 0))
(note-heads (ly:grob-object note-col 'note-heads)) ; is a
Grob array
(note-head (ly:grob-array-ref note-heads 0)) ; we don’t
have chords anyway
(staff-pos (ly:grob-staff-position note-head))
(stem-len (ly:grob-property grob 'length))
(delta (case (abs staff-pos)
((3) -0.3)
((2) -1)
((1) -1.5)
((0) -1.8)
(else 0))))
(ly:grob-set-property! grob 'length (+ stem-len delta)))))
mus = {
a'4 b' c'' d'' e'' f'' g''
}
{
\time 7/4
\mus
\override Stem.before-line-breaking = #crop-outside-staff-stem
\mus
}
%%%%%%%%%%%%%%%
Best, Simon
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user