lilypond-devel
[Top][All Lists]

## Re: Context paths (and the Edition Engraver)

 From: Kieren MacMillan Subject: Re: Context paths (and the Edition Engraver) Date: Tue, 21 Jan 2020 07:30:40 -0500

```Hi all,

[Single-level quotes are David Kastrup’s; double-level quotes are Dan Eble’s.]

> Comments from the EE crowd?

Not sure how much of a "crowd" we are…  ;)

>> One of the things in Kieren's intro to the Edition Engraver (EE) that
>> resonated with me was the context paths.
[…]
>> The ability to refer to contexts this way is a great idea, though IMHO it
>> needs some work to reduce ambiguity.

I agree on both points. (Perhaps one of my first contributions in 2020 should
be a less-ambiguous set of documented examples for the EE?)

>>  \context along.Voice.B { ... }
>>  \set along.Voice.B.property = #...
>>  \change Voice = ChoirStaff.A.Staff.B

An interesting proposal.

> I think that this would warrant closely analysing what the EE does and
> checking whether its way of specifying things is a natural match to what
> might be useful with LilyPond, or at least can be made so without
> impacting its usefulness.

Agreed.

\new Staff = "piano_upper"

mechanism, we could have a

\new Staff piano.upper

"id" that could be used for addressing by both Lilypond proper *and* the EE [or
any other extension/addon]? Other than the obvious coding requirement to make
the switch, is there any real impact on Lilypond itself switching from '=
"name"' syntax to 'name' syntax? Even if Lilypond didn’t yet recognize/react to
a path like "score.ps.piano.upper.Voice.A" (the way the EE already does), such
a change would at least align the two labelling/addressing methods.

Alternatively, we could consider changing the EE to do addressing the way it’s
done in Lilypond proper… but I feel like that would be a step backwards.

>> It would be wise to ask whether there are use cases
>> for any "pronouns" (like `.` and `..` in file paths, and `this`

Interesting… Because of the way timing works (or, in this case, doesn’t!) in
the EE, I sometimes have to write (e.g.)

\editionMod my-edition 10 1/4 id-to-a-staff.Score \override …

because addressing the Score directly doesn’t work at that moment. I suppose
this would be a possible place for "addressing pronouns" and the like.

> we don't want subtly different and/or less than useful semantics.

Agreed.

>> I also think I have a pretty good use case for finding "the closest
>> enclosing context where a given property is defined,"

I believe I could imagine a lot of such use cases.  =)

Cheers,
Kieren.
________________________________

Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info