Urs Liska <u...@openlilylib.org> writes:

> Hi,
>
> when I'm trying to determine the the position in a piece when inside a
> music function I think I have to use either
> ly:context-current-moment
> or
> ly:context-now

That's stupid: they do the same thing.  Why do we have the same function
twice?

> Both functions take a 'context' as argument, but I don't see where
> this should be taken from.
>
> so
> a)
> how do I get a current context from when inside a Scheme function?

That one's easy: there first _has_ to be a current context.  Contexts
are only created when a music expression is getting iterated.  So you
need to have your Scheme function called during iteration.  The easiest
way to do this is to use \applyMusic.

It will be called for every iteration of a score, so if you are doing
midi, you'll get it called there as well.

> and
> b)
> how would I proceed to determine the position in a score when the
> Scheme function is called?

Seems like it would do that.

Again: what are you trying to do?

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to