lilypond-user
[Top][All Lists]
Advanced

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

Re: How to extract the current time signature


From: David Kastrup
Subject: Re: How to extract the current time signature
Date: Fri, 08 Feb 2019 12:43:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> [Reviving a pretty ancient thread]

>> That works great! Thanks so much for your help. Perhaps I should have
>> mentioned it in the original post, but I'd like to be able to use the values
>> in time-sig-frac to automatically make a MultiMeasureRest with the duration
>> of the full measure, but when I attempt to do so, nothing gets added to my
>> score. Here's my latest and greatest:
>>
> I've just run into the very same issue (also trying to create a MMR
> for the current measure's duration.
>
> Looking at the code examples above I'm pretty sure the problem is not
> a "scoping" but a "timing" issue - I think \applyContext performs the
> context lookup long after the MMR has been created. This seems pretty
> clear because at the time a music-function is interpreted (and the
> duration would be needed to create the MMR) it is not clear where this
> music will end up. Consider the case when you define this in a
> variable which you'll then reuse multiple times (possibly starting at
> different moments in a measure or wrapped in \scaleDurations or
> \tuplet-s).
>
> So while I get why this doesn't work that way, is there any chance to
> create a one-measure MMR from a music-function?

You could try sequential music with an elements-callback field.  That
callback is called at a time for producing a list of music expressions
when a context is available.  Unfortunately, it does not get to see more
than the original music expression and thus has no idea about current
properties either.  But the first element it produces can be an
\applyContext that fetches the required information and modifies the
second element then which could be the MMR.

-- 
David Kastrup



reply via email to

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