lilypond-user
[Top][All Lists]
Advanced

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

Re: Context question


From: David Kastrup
Subject: Re: Context question
Date: Sun, 11 Sep 2022 23:18:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

"John Schlomann" <jschlomann@wideopenwest.com> writes:

> Can someone please explain why the following won't work. I want get the
> current moment at the end of the music expression. Is this not a valid thing
> to do? Or perhaps I don't know how to specify the context. This code gives
> an unbound variable error.
>
>  
>
> \version "2.22.2"
>
>  
>
> \score {
>
>   \relative c'' {
>
>     \new Staff {
>
>       a b c d
>
>       #(display (ly:context-current-moment Staff))

Try \applyContext #(lambda (c) (display (ly:context-current-moment c)))

here.  #(display ...) is called when it is encountered.  \applyContext,
in contrast, creates a music expression that is called when the music is
interpreted, "iterated".

>
>     }
>
>   }
>
> }


-- 
David Kastrup



reply via email to

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