Re: Unexpected bar boundaries with volta repeats and lyrics.

2023-12-10 Thread Paul Hodges
Here's my (rather tedious) suggestion for a workaround: so that the alternative 
starts with a note, not a rest, provide a note and hide it, then patch the rest 
in using another voice; the lyrics need a skip to avoid the dummy note.  It 
works (see below).



Paul


%



\version "2.25.10" 


music = \relative { 
   \time 4/4 
   \repeat volta 2 { 
      d'1 | 
      \alternative { 
         { d1 | } 
         { | << { \hideNotes d4 \unHideNotes } \new Voice { b'4\rest } >> d,2 
d4 | d1 } 
      } 
   } 
   \bar "|." 
} 


words = \lyricmode { 
   \repeat volta 2 { 
      a 
      \alternative { 
         { b } 
         { \skip1 c d e } 
      } 
   } 
} 


\score { 
   \new Staff << 
      \new Voice \music 
      \addlyrics \words 
   >> 
}


%%%



 From:   Kevin Pye  
 To:   Michael Werner  
 Cc:   Lilypond User  
 Sent:   09/12/2023 21:14 
 Subject:   Re: Unexpected bar boundaries with volta repeats and lyrics. 



Thank you,



Unfortunately, in this case (the real score from which the example was 
extracted) I need the words to be repeated so I can unfold them for midi 
output. I'll just have to do the unfold manually.



Kevin.



On Sat, 9 Dec 2023, at 23:45, Michael Werner wrote:


Hi Kevin,




On Fri, Dec 8, 2023 at 11:31 PM Kevin Pye  wrote:





What silly mistake am I making here?



Not all that silly. Though the docs do talk about putting lyrics into the same 
repeat structure as the music, there's one detail in 
http://lilypond.org/doc/v2.25/Documentation/notation/lyrics-and-repeats that 
you may have missed:



"... when one of the \alternative blocks starts with a rest, a repeat construct 
cannot be used around the words"



Change the lyrics block to just



words = \lyricmode {


    a b c d e 

}



and it should behave itself a bit better for you.

--




Michael




Re: Unexpected bar boundaries with volta repeats and lyrics.

2023-12-09 Thread David Wright
On Sun 10 Dec 2023 at 08:14:32 (+1100), Kevin Pye wrote:
> On Sat, 9 Dec 2023, at 23:45, Michael Werner wrote:
> > On Fri, Dec 8, 2023 at 11:31 PM Kevin Pye  wrote:
> >> What silly mistake am I making here?
> > 
> > Not all that silly. Though the docs do talk about putting lyrics into the 
> > same repeat structure as the music, there's one detail in 
> > http://lilypond.org/doc/v2.25/Documentation/notation/lyrics-and-repeats 
> > that you may have missed:
> > 
> > "... when one of the `\alternative` blocks starts with a rest, a repeat 
> > construct cannot be used around the words"
> > 
> > Change the lyrics block to just
> > 
> > words = \lyricmode {
> > a b c d e 
> > }
> > 
> > and it should behave itself a bit better for you.
> 
> Unfortunately, in this case (the real score from which the example was 
> extracted) I need the words to be repeated so I can unfold them for midi 
> output. I'll just have to do the unfold manually.

FTR the full sentence is "But when the repeated section has different
words, or when one of the \alternative blocks starts with a rest,
a repeat construct cannot be used around the words and \skip commands
have to be inserted manually to skip over the notes in the alternative
sections which do not apply."

So you need a \skip4 for the crochet rest.

The next bit is tedious; you need to add the duration to each lyric
syllable, in a similar way to the notes.

Finally, you need to associate the voice and lyrics with a
\set associatedVoice command.

I've added a couple of notes to the MWE. Unfortunately it probably
shows that I'm not up-to-date on the new ways of typesetting repeats.
I've got some reading to do.

Adding durations to lyrics is not popular. By the time the NR treats
repeats in §2.1.2, manual syllable durations are a distant memory
back in §2.1.1, until they make a fleeting return with dialogue over
music in §2.1.6.

Cheers,
David.
\paper { #(set-paper-size "a6landscape") }

music = \relative {
  \time 4/4
  \repeat volta 2 {
c'1 |
\alternative {
  { d1 | }
  { | r4 e2 f4 | g1 }
}
a2 bes2
  }
  \bar "|."
}

words = \lyricmode {
  \set associatedVoice = vvv
  \repeat volta 2 {
C1
\alternative {
  { D1 }
  { \skip4 E2 F4 G1 }
}
A2 B♭2
  }
}

\score {
  \new Staff <<
\new Voice = vvv \music
\new Lyrics \words
  >>
  \layout { }
  \midi { \tempo 4=120 }
}

\score {
  \unfoldRepeats
  \new Staff <<
\new Voice = vvv \music
\new Lyrics \words
  >>
  \layout { }
  \midi { \tempo 4=120 }
}


rpt-alt.pdf
Description: Adobe PDF document


rpt-alt.midi
Description: Binary data


rpt-alt-1.midi
Description: Binary data


Re: Unexpected bar boundaries with volta repeats and lyrics.

2023-12-09 Thread Kevin Pye
Thank you,

Unfortunately, in this case (the real score from which the example was 
extracted) I need the words to be repeated so I can unfold them for midi 
output. I'll just have to do the unfold manually.

Kevin.

On Sat, 9 Dec 2023, at 23:45, Michael Werner wrote:
> Hi Kevin,
> 
> On Fri, Dec 8, 2023 at 11:31 PM Kevin Pye  wrote:
>> __
>> What silly mistake am I making here?
> 
> Not all that silly. Though the docs do talk about putting lyrics into the 
> same repeat structure as the music, there's one detail in 
> http://lilypond.org/doc/v2.25/Documentation/notation/lyrics-and-repeats that 
> you may have missed:
> 
> "... when one of the `\alternative` blocks starts with a rest, a repeat 
> construct cannot be used around the words"
> 
> Change the lyrics block to just
> 
> words = \lyricmode {
> a b c d e 
> }
> 
> and it should behave itself a bit better for you.
> --
> Michael


Re: Unexpected bar boundaries with volta repeats and lyrics.

2023-12-09 Thread Michael Werner
Hi Kevin,

On Fri, Dec 8, 2023 at 11:31 PM Kevin Pye  wrote:

> What silly mistake am I making here?
>

Not all that silly. Though the docs do talk about putting lyrics into the
same repeat structure as the music, there's one detail in
http://lilypond.org/doc/v2.25/Documentation/notation/lyrics-and-repeats
that you may have missed:

"... when one of the \alternative blocks starts with a rest, a repeat
construct cannot be used around the words"

Change the lyrics block to just

words = \lyricmode {
a b c d e
}

and it should behave itself a bit better for you.
-- 
Michael


Unexpected bar boundaries with volta repeats and lyrics.

2023-12-08 Thread Kevin Pye
Compiling the following lilypond code:

\version "2.25.10" 

music = \relative { 
   \time 4/4 
   \repeat volta 2 { 
  d'1 | 
  \alternative { 
 { d1 | } 
 { | r4 d2 d4 | d1 } 
  } 
   } 
   \bar "|." 
} 

words = \lyricmode { 
   \repeat volta 2 { 
  a 
  \alternative { 
 { b } 
 { c d e } 
  } 
   } 
} 

\score { 
   \new Staff << 
  \new Voice \music 
  \addlyrics \words 
   >> 
}

gives the following output:

> lilypond test.ly 
GNU LilyPond 2.25.10 (running Guile 2.2) 
Processing `test.ly' 
Parsing... 
Interpreting music... 
test.ly:9:20: warning: bar check failed at: 3/4 
   { | r4 d2 d4 
| d1 } 
Preprocessing graphical objects... 
Finding the ideal number of pages... 
Fitting music on 1 page... 
Drawing systems... 
Converting to `test.pdf'... 
Success: compilation successfully completed

and the produced score is:


The same result is produced with 2.24.3 and 2.25.10.

Removing the lyrics, gives:
with no error messages and bar lines where I would expect them.

Similarly, if the bar "r4 d2 d4" is replaced with "d4 d2 d4", then the 
resultant output is:


which also has no error message and bar lines where I would expect.

What silly mistake am I making here?

Kevin.