lilypond-user
[Top][All Lists]
Advanced

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

Re: addlyrics does not work properly


From: Simon Albrecht
Subject: Re: addlyrics does not work properly
Date: Wed, 11 Nov 2015 20:51:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Hello Niels,
and welcome to the list.

On 11.11.2015 16:39, Niels wrote:
If I comment out the line with the text (cor -- di -- ae su ) the last line (eis 4. eis8 cis4 a4. a8 cis4) will be compiled and appear in the pdf file. However, If I want the text with the notes (a'4.^\markup{"alto solo"} a8 gis4~gis fis2) the last line disappears. Could anyone tell me what I did wrong? partII=\relative c'{ \compressFullBarRests %\global \time 3/4 \tempo "Andante" \clef "C" R2.*22 <<{\tiny \clef "G" a'4.^\markup{"alto solo"} a8 gis4~gis fis2} \addlyrics { %cor -- di -- ae su }>> \normalsize \clef "C" eis 4. eis8 cis4 a4. a8 cis4 }

Code formatting is _important_, and extremely so if you post code in public. What you gave us here, is a nightmare, to be plain. Not only is it impossible to read, it won’t compile either because of the comments. If it was your mailing interface that screwed up, use an attachment for the code.
Here’s how it should be formatted:
%%%%%%%%%%%%
\version "2.18.2"

\relative c' {
  \compressFullBarRests
  %\global
  \time 3/4
  \tempo "Andante"
  \clef "C"
  R2.*22
  <<
    {
      \tiny
      \clef "G"
      a'4.^\markup { "alto solo" } a8 gis4~
      gis4 fis2
    }
    \addlyrics {
      %cor -- di -- ae su
    }
  >>
  \normalsize
  \clef "C"
  eis 4. eis8 cis4
  a4. a8 cis4
}
%%%%%%%%%%%%
Most things will be obvious from this example, but a few notes:
– It is considered best practice to surround all kinds of braces with spaces (same for ‘=’). There are people who like to leave these out, which has its advantages, but with them, the code is easier to read. A ~ should have a space at least after it. – The auto-formatting of Frescobaldi <http://frescobaldi.org> generally does a great job. This concerns line breaks (not

\foo { bar
  baz }

but

\foo { bar baz }

or

\foo {
  bar
  baz
}

and indenting.

– Only one measure of music per line. There can be exceptions to this in music where measures play a different role (e.g. mensural music), but in almost every other case it’s a very useful guideline, even if there’s only one note in a bar for some time. (Except obviously for something like R2.*22) – Post complete, compilable examples, that is including a version statement (which is important in this issue also) and consisting of more than a variable definition :-)

Now on the actual topic: You have encountered a bug, issue 2010, which has been fixed before version 2.19.16. So you probably need to upgrade to a version newer than that to get around the problem. Unfortunately I don’t know of any workaround in 2.18. Another thing: What you want is actually a cue, see <http://lilypond.org/doc/v2.18/Documentation/notation/writing-parts#formatting-cue-notes>. So I’d suggest doing
%%%%%%%%%%%%
\version "2.19.28"

\relative c' {
  \compressFullBarRests
  %\global
  \time 3/4
  \tempo "Andante"
  \clef "C"
  R2.*22
  <<
    \new CueVoice = "cue" \with { instrumentCueName = "alto solo" } {
      \clef "G"
      a'4. a8 gis4~
      gis4 fis2
    }
    \new Lyrics \lyricsto "cue" {
cor -- di -- ae \once\override LyricText.self-alignment-X = #-0.5 "su -"
    }
  >>
  \normalsize
  \clef "C"
  eis4. eis8 cis4
  a4. a8 cis4
}
%%%%%%%%%%

\addlyrics is generally unreliable, so it’s wise to use \lyricsto wherever possible.

HTH, Simon



reply via email to

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