Hi Kevin,
yes, you need to get a context object. If you want to use it inside some
music expression \applyContext is the key:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
doSomething =
\applyContext #(lambda (context)
(display
(ly:context-property context 'currentBarNumber)
))
{ c''4 \doSomething d'' }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
If you are going to write an engraver you can find some informations in
the archive.
HTH
Jan-Peter
Am 23.03.2018 um 01:55 schrieb Kevin Barry:
Hi All,
I would like to be able to get the current bar number context property
so that I can do something with it (like printing it in markup for example).
I have tried the following scheme function:
(ly:context-property 'Score 'currentBarNumber)
but it errors out, telling me that Score is not a context. Do I need to
get the context object somehow?
Any help appreciated.
Kevin
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user