|
From: | Thomas Morley |
Subject: | Re: How to change the stem-length? |
Date: | Wed, 9 Nov 2011 00:15:19 +0100 |
(...)
The function will be consistent if you hijack a different property. To wit, quantized-positions. By the time you call ly:beam::print, the stencil values for the stem may have already been cached, in which case they will not be recalculated for length.
Cheers,
MS
\version "2.15.16"
(let ((pos (ly:beam::set-stem-lengths grob)))
#(set-global-staff-size 20)
#(define ((stem-change y) grob)
(begin
(ly:grob-set-property! grob 'color red)pos))
(map
(lambda (n)
(ly:grob-set-property! n 'length y))
(ly:grob-array->list (ly:grob-object grob 'stems))))
\override Beam #'quantized-positions = #(stem-change 20)
%---- Test
top = \change Staff = "1"
bottom = \change Staff = "2"
music = \relative c {
\override Beam #'auto-knee-gap = #0
\bottom c32[ g' \top eis'']
c[ b \bottom g,]
\top e''[ \bottom c,, \top g'']
\bottom c,,64[ \top g'' e' \bottom c,, \top c'']
f,,32 [f''' f,,, f''']
}
\score {
\new PianoStaff <<
\new Staff = "1" {
s4 s8 s16
}
\new Staff = "2" {
\clef bass
\music
}
>>
}
[Prev in Thread] | Current Thread | [Next in Thread] |