2017-11-03 9:42 GMT+01:00 Maurits Lamers <[email protected]>:
> Hi,
>
> I have been using scheme based engravers to capture all kinds of music
> events. Until now I have dealt with bar lines by reading out the whichBar
> property on the context of an event through
>
> (ly:context-property (ly:translator-context engraver) 'whichBar)
>
> However, this doesn't work for the final bar sign. I have also tried to read
> out the translator object given to the finalize function, but when I read out
> the whichBar property, it is invariably empty. What would be the best way to
> figure out which type of bar is used at the end of a piece?
>
> Thanks in advance!
>
> cheers
>
> Maurits
You could do:
\version "2.19.65"
\score {
{
r2 r
\break
\bar "S"
R1
\bar "|."
}
\layout {
\context {
\Staff
\consists
#(make-engraver
((stop-translation-timestep engraver)
(format #t "\nwhichBar: ~a"
(ly:context-property
(ly:translator-context engraver)
'whichBar)))
(acknowledgers
((bar-line-interface engraver grob source-engraver)
(ly:grob-set-property! grob 'after-line-breaking
(lambda (grob)
(format #t "\nglyph: ~a"
(ly:grob-property grob 'glyph))
(format #t "\nglyph-name: ~a"
(ly:grob-property grob 'glyph-name)))))))
}
}
}
Note the difference for the grob-properties, due to line-break.
Cheers,
Harm
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user