Keeping a Lyrics context alive: Difference between revisions

m New category
Tags: Mobile edit Mobile web edit
mNo edit summary
 
Line 1: Line 1:
If you temporarily have additional lyrics to a voice you can keep the lyrics context alive with the following construct. Unless you do this, a further temporary lyrics context would create a separate line (if it happens on the same system of music).
If you temporarily have additional lyrics to a voice you can keep the lyrics context alive with the following construct. Unless you do this, a further temporary lyrics context would create a separate line (if it happens on the same system of music).


The solution is to create one or more named lyrics context(s) with
The solution is to create one or more named <code>Lyrics</code> context(s) with


<code>\new Lyrics = &quot;lyr1&quot;</code><br />
\new Lyrics = "lyr1"
<code>\new Lyrics = &quot;lyr2&quot;</code><br />
\new Lyrics = "lyr2"
...


'''before''' they are filled with the lyrics text.
'''before''' they are filled with the lyrics text.


It is noteable that the definition of the contexts '''must''' use \new while later references ''must'' use \context
Note that the definition of the contexts '''must''' use <code>\new ...</code> while later references ''must'' use <code>\context ...</code>.


<lilypond version="2.24">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=781
\score {
\score {
   \new Staff <<
   \new Staff <<
Line 21: Line 19:
         b \repeat volta 2 {b}
         b \repeat volta 2 {b}
     } }
     } }
     \context Lyrics ="line1" \with{ associatedVoice = "melody" } \lyricmode  
     \context Lyrics = "line1" \with{
    {
      associatedVoice = "melody"
       one  
    } \lyricmode {
       one
       <<  % this is the 1st temporary lyric part
       <<  % this is the 1st temporary lyric part
         \context Lyrics = "line1" { one }
         \context Lyrics = "line1" { one }
         \context Lyrics = "line2" { two }  
         \context Lyrics = "line2" { two }
         % the context "line2" dies here
         % the context "line2" dies here
       >>
       >>
       one  
       one
       <<  % this is the 2nd temporary lyric part
       <<  % this is the 2nd temporary lyric part
         \context Lyrics = "line1" { one }
         \context Lyrics = "line1" { one }
Line 39: Line 38:
</lilypond>
</lilypond>


[[Category:Vocal music]]
[[Category:Vocal music]]
[[Category:Vocal music]]
[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Snippet]]
[[Category:Snippet]]