lilypond-devel
[Top][All Lists]
Advanced

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

Re: Context.Grob considered as symbol list


From: David Kastrup
Subject: Re: Context.Grob considered as symbol list
Date: Fri, 12 Oct 2012 16:36:10 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> I copied some extracts with (small) comments:
> (1)
>
>       -\tweak #'color #red c4
>       -<\tweak #'color #red c>4
>       +\tweak color #red c4
>       +<\tweak color #red c>4
>
>       -\once \override Glissando #'style = #'dashed-line
>       +\once \override Glissando style = #'dashed-line
>
>       (these are some examples among a plethora of others)
>
> This is great!!
>
> Ofcourse the argument still needs hash and '-sign (if needed)

The assignment value is not (at the current time) meddling with type
coercion where its interpretation depends on the property's declared
type predicate.  It is a possibility to change that eventually, then
just using dashed-line would be possible.  #red does not have
significant other options, but in fact \red would at least be a bit more
efficient as it avoids calling the Scheme interpreter.  We don't use it
like that elsewhere, though.

> Excursion (skip if you want):
> Recently I tried changing \label to give it a STRING-argument,
> planning to parse this STRING in some additional manner.
> Estimating the amount of work to change all other
> functions/definitions/commands related to \label I gave up and used a
> workaround.

#"xxx" still won't work for that, "xxx" will, two-words will, and
$(format #f "label~a" (+ 2 3)) will as well, as $ tells LilyPond to try
interpreting the argument like it came from LilyPond itself or from \xxx
rather than #"xxx" which tells LilyPond "This is a Scheme string and
nothing else".

> (3)
>
>       -    \footnote #'(1 . -1) #'Stem
>       -      \markup  { \teeny { Das ist ein Hals } } \default
>       +    \footnote #'(1 . -1)
>       +      \markup  { \teeny { Das ist ein Hals } } Stem
>
> Here I'm not convinced.

Welcome to the club.  I am not trying to sell this as an improvement.
It is damage control.  I got caught flatfooted by a footnote trying to
interpret "Tenuto" as a Grob symbol.  Removing the distinction between
symbols and strings at the user interface level breaks the optional
argument arrangement of \footnote.  Trying to distinguish between
unquoted and quoted strings here for disambiguation would make it hard
to decide on a behavior for $(stringexpression): is that a quoted or
unquoted LilyPond string?

It turns out that \footnote and \tweak were the main problem makers
here, and I am not particularly enamored with either solution.

> As a LilyPond-starter (I postulate a user not having read the NR
> carefully) I'd be puzzled by the single: Stem.
> The older version contains \default.
> This is puzzling, too. (Again, I think of a lazy user.)

Well, win some, lose some.

>
> Is it possible to do:
>
>       \footnote #'(1 . -1) Stem
>        \markup  { \teeny { Das ist ein Hals } }
> ?

How to distinguish from

        \footnote #'(1 . -1) "Stem"

?  The change I came up with brings \footnote somewhat in line with
\hide, \omit and at least gets rid of \default.  Now this was a change
in the "oh rats, what now?" line designed and implemented within few
hours.

I won't rule out that there might be a substantially better change.  I
just don't see it.  The only reliable mandatory argument sufficiently
different in type from a string is #(1 . -1) here, and that already
serves as argument delimiter for the optional footnote mark.  Sure, one
can always write

\footnote #'(1 . -1) \markup "Stem"

and LilyPond is clued in that "Stem" is not a symbol.  But I don't
really like that requirement.  Even with the chosen interface, it may
become necessary to write \markup "Stem" if the \footnote is used in
\lyricsmode and supposed to apply to _Lyrics_ called "Stem".  That's
similar for \hide and \omit, but at least it is confined to the rather
special \lyricsmode where you would rarely use such constructs.

Putting the grob name as an alternative to music at the end has the
advantage that we don't have a manner to produce the unusable
"time-based footnote without grob specification" case.  Moving it
elsewhere means that we have to use \default after all for not taking on
music at the end.

Unless we put the music in the middle, but that tends to lead to awkward
results fast if it is non-trivial.

However, one could change the current
\tweak Accidental.color into
\grob Accidental \tweak color ...
and similarly for other tweaks: \grob name would just take the next
music element, take a look at the last applied tweak and make it
specific to one grob type.  Better names welcome.  It would be used for
making a \tweak more specific.  That would get rid of the \tweak
anomaly and also provide the "directed tweak" interface for \footnote.

> Summary:
> I'm enthusiastic.

Well, that's good to hear.

> And your patch will solve some of the complaints I've listed here
> (putting together the results of the german user-poll):
> http://lists.gnu.org/archive/html/lilypond-devel/2012-10/msg00178.html

I don't see anything in there that would actually profit.  It may just
cause people to get further before saying "enough is enough" due to
perceived syntactical clutter without apparent beauty or meaning.

People feel like they know what LilyPond is talking about, never mind
that things actually get more complex if you are looking too closely.

-- 
David Kastrup



reply via email to

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