lilypond-user
[Top][All Lists]
Advanced

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

Re: thanks again for the editionEngraver


From: Janek Warchoł
Subject: Re: thanks again for the editionEngraver
Date: Wed, 30 Jul 2014 21:28:30 +0200

2014-07-30 20:47 GMT+02:00 David Kastrup <address@hidden>:
> Janek Warchoł <address@hidden> writes:
>
>> Hi,
>>
>> 2014-07-30 0:54 GMT+02:00 David Kastrup <address@hidden>:
>>> Janek Warchoł <address@hidden> writes:
>>>> As i said, defining new instrument contexts is very cheap - you can just do
>>>>
>>>> \newInstrument "ViolinI" "Violin" "StaffGroup"\with { } \with { }
>>>> \newInstrument "ViolinII" "Violin" "StaffGroup"\with { } \with { }
>>>>
>>>> and have ViolinI and ViolinII available.
>>>
>>> Would it be feasible to put the context mods _before_ some reasonably
>>> related argument, possibly like
>>>
>>> \newInstrument \with {} "ViolinI" "Violin" \with {} "StaffGroup"
>>>
>>> or probably
>>>
>>> \newInstrument "Violin" \with {} "ViolinI" \with {} "StaffGroup" ?
>>>
>>> Because when they are before a related non-optional argument, one can
>>> make them optional.  Then if they are just \with {} anyway, you can omit
>>> them.
>>
>> Good idea!  I'm fine with changing the order of the arguments; the
>> function is still in the experimental phase and there's not much code
>> depending on it.
>>
>> However, i'm not yet sure what would be the most intuitive and
>> optional-argument friendly order of arguments; somehow your suggestion
>> doesn't seem natural for me (but i don't feel strongly about it).
>> Does anyone else have opinions?
>
> Well, if the optional arguments should be independently optional, they
> must each be followed by a mandatory argument.  To me it makes the most
> sense to place them before the argument they "apply to": that
> arrangement should always work.

Indeed.  The problem is that they don't really have matching arguments
to which they "apply" (maybe this is an indication that it would be a
good idea to change the function). See below.

> I don't actually know which of the names are context types, and which
> are context names.  So I cannot really vouch for the best order.

Right now, the syntax is:
\newInstrument
"foo" -> name of the resulting "instrument".  The function will
actually create two contexts: fooStaff and fooVoice.
"bar" -> name of the "instrument" to inherit from.  E.g. fooStaff will
be derived from barStaff, and fooVoice from barVoice.  With "default",
fooStaff and fooVoice will inherit from "plain" Staff and Voice,
respectively.
"StaffGroup" -> name of the "grouping" context that will accept
fooStaff.  Actually, i'd like to get rid of this (if it would be
possible and reasonable to do so, that's something to be checked).
\with { } -> settings for fooStaff
\with { } -> settings for fooVoice

As you can see, it's hard to speak about "matching" arguments.  One
can only say that both \with {} clauses _together_ apply to
parent-name ("bar" in this case).

Would it make sense to have
\newInstrument "foo" \with {} \with {} "bar" "StaffGroup"
?
And if only one \with {} was supplied, it would be interpreted as
Staff-level settings.

More details at
https://github.com/openlilylib/openlilylib/blob/master/templates/predefined-instruments/context-creating-function.ily#L98

best,
Janek



reply via email to

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