On Sat, 2023-10-14 at 17:04 +0200, Valentin Petzel wrote:
> Hello Graham,
> 
> there are multiple ways to solve the problem and having different
> voice 
> contexts for different lyrics is surely one of the better ways to
> handle it. 
> You can it do cleaner like this:
> 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> instrumental =
> #(define-music-function (m) (ly:music?)
>    #{ \context Voice = "instrumental" $m #})
> 
> notes = {
>   \instrumental \repeat unfold 8 c'4
>   \repeat unfold 8 d'4
> }
> 
> words = \lyricmode { 
>    one two three four 
> }
> 
> <<
>   \new Voice = "cantor" \notes
>   \new Lyrics \lyricsto cantor { \words } 
> > > 
> 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> The issue with this is that this will cause trouble with engravers
> sitting at 
> the voice level, so things like slurs and ties between these sections
> will 
> fail.

And in the real-life example (five parts, each with three
verse...chorus sections) I was getting into all sorts of self-inflicted
trouble with many instantiated Voices, and lyrics no longer attaching
to the correct voice.  I was even starting to read up on "Keeping
contexts alive" -- desperate measures by my standards!

> 
> One other way that does not have this issue would be to have the
> Lyric 
> engraver believe that the instrumental notes are part of a melisma,
> which 
> leads to the engraver ignoring them:
> 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> notes = {
>   \set melismaBusy = ##t
>   \after 1*2 \unset melismaBusy
>   \repeat unfold 12 c'4
> }
> 
> words = \lyricmode { 
>   one two three four 
> }
> 
> <<
>   \new Voice = "cantor" \notes
>   \new Lyrics \lyricsto cantor { \words } 
> > > 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> If you have lyrics before this it would be wise to only do this after
> the first 
> instrumental note and add a single "" to the Lyrics to avoid it
> extending a 
> previous melisma, so instead of
> 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> notes = {
>   4 4( 4 4)
>   \set melismaBusy = ##t
>   \after 1*2 \unset melismaBusy
>   \repeat unfold 12 c'4
> }
> 
> words = \lyricmode { 
>   first text __
>   one two three four 
> }
> 
> <<
>   \new Voice = "cantor" \notes
>   \new Lyrics \lyricsto cantor { \words } 
> > > 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> you’d get
> 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> notes = {
>   4 4( 4 4)
>   \after 4 \set melismaBusy = ##t
>   \after 1*2 \unset melismaBusy
>   \repeat unfold 12 c'4
> }
> 
> words = \lyricmode { 
>   first text __
>   ""
>   one two three four 
> }
> 
> <<
>   \new Voice = "cantor" \notes
>   \new Lyrics \lyricsto cantor { \words } 
> > > 
> % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Cheers,
> Valentin

This is _very_ helpful.  Thanks!  I can now preserve a structure in my
file, that better reflects the musical structure of the piece.

I'm trying to alias the use of melismaBusy, to help avert my future
confusion over the semantic overloading of melismas, so ...

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% =========
% comments... explanation ... ref. to lilypond-user ... attribution.
suppressLyrics = \after 4 \set melismaBusy = ##t \etc 
% ... not sure why \etc is needed there.
reenableLyrics = \unset melismaBusy
% =========

notes = {
  4 4( 4 4)
  \suppressLyrics
  \after 1*2 \reenableLyrics
  \repeat unfold 12 c'4
}

words = \lyricmode { 
  first text __
  "" % extra syllable (see \suppressLyrics)
  one two three four 
}

<<
  \new Voice = "cantor" \notes
  \new Lyrics \lyricsto cantor { \words } 
>>
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Reply via email to