[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Counters
From: |
Dan Eble |
Subject: |
Counters |
Date: |
Sun, 22 Apr 2018 20:23:12 -0400 |
While pondering how an “nth time only” feature might work, I considered what it
might take to generalize the way the Mark engraver handles updating the
rehearsal mark number and make it expressible in ly code instead.
I have a working prototype that uses all the following features and I’m looking
for feedback on these ideas (votes on what to submit first, naming suggestions,
cold water, all is accepted). The code is not ready for review.
I want to increment a context property:
\increment Score.counterForX
Further, I want to postpone the operation until the end of the time step:
\post \increment Score.counterForX
Further, I want to ensure that the operation occurs only once during the time
step, even if the music is iterated more than once in the relevant context.
\exclusive <unique_value> \post \increment Score.counterForX
Further, I want some help picking unique values that will not collide, say by
using the input location:
\exclusive \here \post \increment Score.counterForX
For more general use, the user should not need to know in which context a
property is being tracked. For example, things that are usually engraved at
Score level might sometimes be engraved at StaffGroup level. Therefore:
... \increment WhereDefined.counterForX
For completeness, the \context command should have the same option, and I see
no reason not to allow a list of property names in that case (all required to
match).
\context \wheredefined x,y,z { ... }
\context = “ID” \wheredefined x,y,z { ... }
\context Staff = “ID” \wheredefined x,y,z { ... }
Thanks and regards,
—
Dan
[Prev in Thread] |
Current Thread |
[Next in Thread] |