Hello everyone,

I don’t know where the “Lyric syllable magnetic snap” snippet is mainly stored, I grabbed it from the list years ago and attach it in the version that I have, from December 2011 and with links to user list archive. I hope I’m not somehow behind time with this, having followed the user list only sporadically in the years since.

I have tracked down why I always got warnings about “infinity or nan” in every vocal music score I engraved: with the snippet, the last syllable of a LyricWord gets a #ly:text-interface::print stencil with #empty-markup as text, which results in multiple warnings each time Lily tries to apply whiteout to such a syllable. (tiny example below)

This is fixed by, in line 187 of the attached file, replacing ly:text-interface::print with point-stencil (an infinitely small stencil, IIUC). To avoid misunderstandings: the attached version does NOT have the fix applied.

I’m not aware of this snippet being available anywhere except the list archives. Surely it would be a good candidate for the LSR and OLL, wouldn’t it?

Best, Simon

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.25.5"

\include "lyr-syl-magn-snap.ily"

\layout {
  \context {
    \Lyrics
    \override LyricText.whiteout = 1
  }
}

<<
  { 2 2 }
  \addlyrics { aaaaaaaaaaaaaaaaaaaaaaaaaaa -- bbbbbbbbbbbbbbbbbbbbbbbbb }
>>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.23.5"

\include "lyr-syl-magn-snap.ily"

<<
  \new Voice = "foo" \relative c' {
    \repeat unfold 16 { a8 b a2 a8 b }
  }
  \new Lyrics \lyricsto "foo" {
    \override Lyrics.LyricWord.after-line-breaking = #(lyric-word-compressor 0)
    \override Lyrics.LyricHyphen.minimum-distance = #0
    \override Lyrics.LyricSpace.minimum-distance = #1
    \repeat unfold 10 { foo }
    \repeat unfold 10 { foo -- \markup \caps bar }
    \repeat unfold 10 { \markup \bold syl -- la -- ble }
    a \markup \with-color #red ran -- \markup \box dom string of mo -- no -- syl -- la -- bic
    and mul -- ti -- \markup \fontsize #5 syl -- la -- bic
    \markup \bold \underline ver -- \markup \italic bi -- age
    \markup {
      \stencil #(make-circle-stencil 0.5 0 #f)
    }
  }
>>

<<
  \new Voice = "foo" \relative c' {
    \repeat unfold 16 { a8 b a2 a8 b }
  }
  \new Lyrics \lyricsto "foo" {
    \override Lyrics.LyricWord.after-line-breaking = #(lyric-word-compressor 0.4)
    \override Lyrics.LyricHyphen.minimum-distance = #0
    \override Lyrics.LyricSpace.minimum-distance = #1
    \repeat unfold 10 { foo }
    \repeat unfold 10 { foo -- \markup \caps bar }
    \repeat unfold 10 { \markup \bold syl -- la -- ble }
    a ran -- \markup \box dom string of
    \wordunderline mo -- no -- syl -- \markup \underline la -- bic
    and \wordbox mul -- ti -- \markup \fontsize #5 syl -- la -- \markup \box bic
    \wordunderline ver -- \markup \italic bi -- age
    \markup {
      \stencil #(make-circle-stencil 0.5 0 #f)
    }
  }
>>

\layout {
  ragged-last = ##t
}

Reply via email to