lilypond-user
[Top][All Lists]
Advanced

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

Re: Strange error from \new Voice


From: David Wright
Subject: Re: Strange error from \new Voice
Date: Fri, 10 Apr 2020 23:39:25 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri 10 Apr 2020 at 09:58:57 (+0200), Michael Gerdau wrote:
> > When working with addlyrics it was outside the \new staff construct like
> > here:
> > 
> > tenorVoicePart = \new Staff \with {
> >   instrumentName = "Tenor"
> >   midiInstrument = "choir aahs"
> > } { \clef "treble_8" \tenorVoice }
> > \addlyrics { \verseVoice }
> > 
> > Now, it is within
> > 
> > Soprano = \new Staff \with {
> >   instrumentName = "Sopran"
> > } <<
> >   \new Voice = "SI" { \voiceOne \SopranoVoiceI }
> >   \new Voice = "SII" { \voiceTwo \SopranoVoiceII }
> >   \new Lyrics \lyricsto "SI" { \VerseSopranoVoiceI }
> >>>
> > 
> > That should be mentioned.
> 
> I'm surprised that works. I always do it like this:
> Soprano = <<
>   \new Staff \with {
>     instrumentName = "Sopran"
>   } <<
>     \new Voice = "SI" { \voiceOne \SopranoVoiceI }
>     \new Voice = "SII" { \voiceTwo \SopranoVoiceII }
>   >>
>   \new Lyrics \lyricsto "SI" { \VerseSopranoVoiceI }
> >>
> 
> That's what's documented under the link that Joram already provided.

I shall attempt to explain (corrections welcomed).

The OP posted¹:

    Soprano = \new Staff \with {
      instrumentName = "Sopran"
    } <<
      \new Voice = "SI" { \voiceOne \SopranoVoiceI }
      \new Voice = "SII" { \voiceTwo \SopranoVoiceII }
    >>
    \addlyrics { \VerseSopranoVoiceI }²

\addlyrics nowadays works on the Staff (2.18.2 would fail here³), and
sets the lyrics with one syllable per musical moment, whichever voice
it occurs in. See my example from earlier today. Of course, that's not
what the OP wanted, because it doesn't respect ties and slurs etc in
either voice.

Your first post suggested:

    Soprano = \new Staff \with {
      instrumentName = "Sopran"
    } <<
      \new Voice = "SI" { \voiceOne \SopranoVoiceI }
      \new Voice = "SII" { \voiceTwo \SopranoVoiceII }
    >>
    \new Lyrics \lyricsto "SI" { \VerseSopranoVoiceI }

LP now tries to set a score consisting solely of Lyrics (because
\new Lyrics is actually at top-level), at which it fails.

In your last post, you've written:

    Soprano = <<
      \new Staff \with {
        instrumentName = "Sopran"
      } <<
        \new Voice = "SI" { \voiceOne \SopranoVoiceI }
        \new Voice = "SII" { \voiceTwo \SopranoVoiceII }
      >>
      \new Lyrics \lyricsto "SI" { \VerseSopranoVoiceI }
    >>

Now the outer << >> brackets bundle the lyrics together with the
Staff, which contains notes, so LP has no problem setting them.

Similarly, the example that surprised you, above, has the Voices
and Lyrics bracketed together, so no problem.

¹ The marginal indentation is for clarity, but all these examples
  are top-level and would be pushed leftwards.

² I have "corrected" the OP's indentation. Originally, this line was
  indented by two spaces, making it look as if it was inside
  something, whereas it's really just the end of the \new Staff's
  definition.

³ 2.18.2 understands \new Voice { … } \addlyrics { … }

  2.20   understands \new Voice { … } \addlyrics { … }
            and also \new Staff { … } \addlyrics { … }

Cheers,
David.



reply via email to

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