|
From: | David Nalesnik |
Subject: | Re: How to catch extent of AccidentalPlacement? |
Date: | Sat, 12 Apr 2014 09:21:38 -0500 |
2014-03-12 1:27 GMT+01:00 Thomas Morley <address@hidden>:
> Hi,Noone with an idea?
>
> for some function I need to know the extent/length of the AccidentalPlacement.
>
> With 2.16.2 I used to do something like:
>
> info =
> \override Staff.AccidentalPlacement #'after-line-breaking =
> #(lambda (grob)
> (display (interval-length (ly:grob-extent grob grob X)))
> (newline))
>
> \relative c' {
> \info
> <c d>
> <cis d>1
> <cis dis>
> <cis dis eis>
> <cis dis eis fis>
> <cis dis eis fis gis>
> }
>
> and got different values.
>
> With 2.18.0 and 2.19.1 it always returns the same: 1.1
> Looks like a bug to me.
> How to do it different?
>
> Cheers,
> Harm
info =
\override Staff.AccidentalPlacement #'after-line-breaking =
#(lambda (grob)
(let* ((accs (map cadr (ly:grob-object grob 'accidental-grobs)))
(sys (ly:grob-system grob))
(X-exts (map (lambda (x) (ly:grob-extent x sys X)) accs))
(un (reduce interval-union '() X-exts)))
(display (interval-length un))
(newline)))
\relative c' {
\info
<c d>
<cis d>1
<cis dis>
<cis dis eis>
<cis dis eis fis>
<cis dis eis fis gis>
}
[Prev in Thread] | Current Thread | [Next in Thread] |