On Wed, Jun 3, 2026 at 7:55 PM David Rogers <[email protected]> wrote:
> Gabriel Ellsworth <[email protected]> writes: > > > > In case this is helpful inspiration … here is an example of a > > Wiki page that intentionally shows multiple ways of doing the > > same basic thing all within a single page/snippet: Typesetting > > IPA transcriptions for lyrics - LilyPond wiki. > > Thanks! I think in my case the snippet that's already there > shouldn't be replaced, but kept. Mine was better for my purpose > today, but I wouldn't claim it was objectively better, or better > for everyone. > > I think that if you look at the IPA transcriptions snippet, one snippet includes all of the methods. You could change the existing snippet to include both methods, I think. > _______ > > [ > https://wiki.lilypond.community/wiki/Chord_names_and_lyrics_without_a_staff] > > shows how to use <code>\Devnull</code> to eliminate the melody > from a lead sheet, to print only the chord symbols and the lyrics. > In some cases, <code>\Devnull</code> gives unwanted or unexpected > results, particularly with tied notes. This second approach to > showing chord names and lyrics without a staff, thanks to > [https://lists.nongnu.org/archive/html/lilypond-user/2024-09/msg00206.html > Saul Tobin's post on lilypond-user], is very similar to the > existing solution, but avoids the use of <code>\Devnull</code> by > modifying the <code>\Score</code> and <code>\Staff</code> to > accept a <code>NullVoice</code> directly. I think that Saul's post is unnecessarily complicated for the outcome you want. There's no need (IMO) to use \RemoveAllEmptyStaves. Just have the Score accept the NullVoice context. At least that seems to work for me. \version "2.24" text = \lyricmode { Ho ho, ho ho ho. Hey hey. Ha ha, ha. } nullMelody = \relative c'' { e4 e e2 e2 e r8 e8~ e~ e~ e e~ e~ e \tuplet 3/2 { d2 c d } } harmonies = \chordmode { a1:m | d:m | e:7 | a:m | } \layout { \context { \Score \accepts NullVoice } } \score { << \new ChordNames \harmonies \new NullVoice = "vocal" \nullMelody \new Lyrics \lyricsto "vocal" \text >> \layout { } } I actually think it might not be a bad idea to replace the existing snippet with the new one. Devnull contexts existed before NullVoice contexts; I think that NullVoice is strictly better in every use case with which I am familiar thant Devnull. Of course, in this particular use case you need to let the Score accept a NullVoice for it to work. HTH, Carl
