lilypond-user
[Top][All Lists]
Advanced

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

Re: issues with "afterGrace" since 2.20


From: David Kastrup
Subject: Re: issues with "afterGrace" since 2.20
Date: Sat, 28 May 2022 15:03:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Lukas-Fabian Moser <lfm@gmx.de> writes:

>>> For the optional argument of \afterGrace, there would be some incentive
>>> in case of a duration to interpret it as a duration rather than as a
>>> scale factor.  That would, however, make this different from either what
>>> \afterGraceFraction accepts, or what its name insinuates.  Also it would
>>> make the predicate scale? be an inadequate description of what the
>>> argument's type is which would functionally be
>>> non-duration-scale-or-duration? which of course has the exact same
>>> implementation.
>> Correction: a duration (as opposed to a music-length) is _not_ permitted
>> by scale? but a non-negative exact rational number is (which 4 qualifies
>> as).
>>
>> duration-or-scale? would be possible in theory but would create too much
>> ambiguity for things like 2 .
>
> But is it really desirable to make it easy to use afterGrace factors
> >= 1? (We warn about them, but only if the factor is > 1. To be
> honest, I'm wary about the factor = 1 case...)

It's not really a matter of "easy to use" rather than to create
syntactic distinctions based on a value rather than a lexical identity.

For example, it would seem crazy to interpret 16 as a duration and 15 as
a number.  Because anywhere where 15 is acceptable as a number it would
seem like a mistake to interpret 16 differently.

So LilyPond will _syntactically_ treat 15 and 16 the same but then
complain about 15 as non-suitable for a duration.  Because it's more
likely than not that this is a typo.

There are very few exceptions from that concept.  One that I can think
of is that (ly:make-moment 1 1) and (ly:make-moment 1 -1) are treated
entirely differently due to compatibility considerations.

> Obviously it's impossible to allow both i) the OP's syntax (use a
> naked duration as main note) _and_ ii) durations as afterGrace
> offsets.
>
> At the moment we have neither. But one of them should be possible:
>
> For i), limit afterGraceFractions to proper fractions (< 1)
> For ii), distinguish factors from durations (offsets) by being < 1 or
> integers >= 1. (In the latter case, warn if the length of the duration
> exceeds the length of the main note.)

There would be some weak argument for a different form of ii: interpret
numbers as durations where they have the proper form.  However, at the
current point of time LilyPond interprets numbers preferably as numbers
because it seems undesirable to think of durations in contexts like

var = 4

or

\tweak xxx.value 4 ...

and you can always revert to

var = ##{ 4 #}

when you really really want a duration in those contexts.

In short: this seems like a can of worms that is hard to open without
the tab tearing off.

-- 
David Kastrup



reply via email to

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