lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vertical positioning of rests


From: Leo Correia de Verdier
Subject: Re: Vertical positioning of rests
Date: Thu, 23 Sep 2021 15:35:53 +0200

I’m unsure if the following can count as an MWE, but here it goes:

%%%%%%%%%%%%%%%%%%%%%%
\version "2.22.1"

 #(define (move-rest-after-line-breaking grob)
                                   (let ((stil (ly:grob-property grob 'stencil))
                                         (y-offs (ly:grob-property grob 
'Y-offset))
                                         (staff-pos (ly:grob-property grob 
'staff-position)))
                                     
                                     ;here I would probably do a call to 
ly:stencil-translate-axis
                                     ;or possibly change the grob's values and 
re-calculate the 
                                     ;stencil, but i'm unsure if the latter is 
possible
                                     
                                     (pretty-print y-offs) 
                                     (pretty-print staff-pos)
                                     ))

{ \override Staff.Rest.after-line-breaking = #move-rest-after-line-breaking r2 
  << { r4 f''4}
     \\
     { e'4 r4 } >> 
}
%%%%%%%%%%%%%%%%%%%%%%

> 23 sep. 2021 kl. 12:44 skrev Leo Correia de Verdier 
> <leo.correia.de.verdier@gmail.com>:
> 
> Dear list!
> 
> I’m attempting to write a function that would have to move rests vertically 
> after line breaking. I would need to move them (grob or stencil) to an 
> determined position in relation to the staff, but I cannot find what property 
> of the grob determines its vertical placement. Y-offset is zero, both for the 
> rest itself and its parent note-column and staff position is not set, even 
> though the rests are displayed different positions on the staff. Do you have 
> anywhere to point me?
> 
> Thanks!
> /Leo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]