lilypond-user
[Top][All Lists]
Advanced

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

Re: \lyricsto and \tag problems


From: David Kastrup
Subject: Re: \lyricsto and \tag problems
Date: Sat, 11 Oct 2014 14:58:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Noeck <address@hidden> writes:

> Hi,
>
> this is the usual way I write a song (melody with lyrics):
>
> \version "2.18.2"
>
> <<
>   \new Staff \new Voice = sop { c' d' e' f' }
>   \new Lyrics \lyricsto sop \keepWithTag "A" \lyricmode {
>     An \tag "A" example \tag "B" text
>   }
>>>
>
> (The melody is usually a variable and the \lyricmode { … }, too.)
>
> It compiles nicely with LP 2.18.2.

More by accident than anything else.  \lyricsto is a
\lyricmode-introducing command and so it needs to be followed by some
music enclosed with matched braces.

What happens if it isn't?  Take a look at the output from the following
minimal addition (2.16 syntax because I don't have 2.18 available
currently):

\version "2.16.2"

\displayMusic <<
  \new Staff \new Voice = sop { c' d' e' f' }
  \new Lyrics \lyricsto sop \keepWithTag #'A \lyricmode {
    An \tag #'A example \tag #'B text
  } g a
>>

In the graphical output, the "g" is conspicuously absent.  Looking at
the console output, it becomes clear that this because it occurs in a
Voice context but ends up being a lyric event: since the parser was not
able to work with matched braces concerning the argument of \lyricsto,
it reverted to using lookahead while still being in \lyricmode.  Once it
considered g while being in lyricmode, the characterization stuck.

This is not really something convert-ly can hope to fix since it would
have the same problem of figuring out just where an argument _not_
enclosed by braces is supposed to end.

So this never worked reliably before.  And that could not really be
fixed.  So instead, LilyPond treats \lyricsto exactly like other
mode-changing commands.

Changing some construct from "worked most of the time as expected" to
"refuses to work" does not look like an improvement.  At least, people
are more likely to remember that \lyricsto by itself is invoking
\lyricmode and save typing in that manner.  Your use case could be
rewritten as

\new Lyrics \keepWithTag A \lyricsto sop { an \tag A example \tag B text }

which is shorted than before but uses a different order of elements.

-- 
David Kastrup




reply via email to

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