Another way to get the extra Staff not to appear is to add the following to
your \layout block:

  \context {
    \Score
    \accepts NullVoice
  }

As an aside directed more at the dev community: is there any good reason
not to make this the default behavior (and similar for StaffGroup, etc.)?
NullVoice is defined with both Staff and Voice as aliases. I would have
assumed this meant that it could be used anywhere that Staff could be used.

Saul


On Fri, Sep 20, 2024 at 10:25 PM Saul Tobin <saul.james.to...@gmail.com>
wrote:

> The easiest way to get the staff not to appear would be to put NullVoice
> inside a Staff or similar context that you want to appear.
>
> On Fri, Sep 20, 2024 at 8:19 PM Walt North <waltno...@gmail.com> wrote:
>
>> Thanks, that took care of the alignment.
>>
>> However now I see an empty staff.  Is it expected I would then have to
>> remove all empty staves?  I tried that but may not have it right
>>
>>
>> \version "2.24.2"
>>
>> \language "english"
>>
>> \layout {
>>   indent = 0
>>   \context {
>>     \NullVoice
>>     \RemoveAllEmptyStaves
>>   }
>> }
>>
>> verseLyricsMelody = \relative c' {
>>   c4 c c c~ | c c c c |
>> }
>>
>> verseOneLyrics = \lyricmode {
>>   one two three four five six seven eight
>> }
>>
>> \new Score {
>>   <<
>>     \new Voice = "verse" { \break \verseLyricsMelody }
>>     \new Lyrics \lyricsto "verse" { \verseOneLyrics }
>>   >>
>>   <<
>>     \new NullVoice  = "verseB" { \break  \verseLyricsMelody }
>>     \new Lyrics \lyricsto "verseB" { \verseOneLyrics }
>>
>>   >>
>>
>>
>>
>> }
>>
>>
>>
>> On 9/20/2024 4:58 PM, Saul Tobin wrote:
>>
>> My understanding is that Devnull is not intended for alignment of lyrics
>> because it does not have the necessary engraver to create the invisible
>> grobs used for alignment. It appears to me in your example that actually
>> the lyrics are just being spaced evenly without alignment to anything.
>> Nullvoice is intended for your use case.
>>
>> On Fri, Sep 20, 2024, 6:06 PM Walt North <waltno...@gmail.com> wrote:
>>
>>> Am I missing something?  It seems like using devnull to align lyrics to
>>> does pay attention to ties.  Ties do seem to be honored when using voice
>>> for alignment.
>>>
>>> Below is a stripped down example with screenshot.
>>>
>>> \version "2.24.2"
>>>
>>> \language "english"
>>>
>>> \layout {
>>>   indent = 0
>>> }
>>>
>>> verseLyricsMelody = \relative c' {
>>>   c4 c c c~ | c c c c |
>>> }
>>>
>>> verseOneLyrics = \lyricmode {
>>>   one two three four five six seven eight
>>> }
>>>
>>> \new Score {
>>>   <<
>>>     \new Voice = "verse" { \break \verseLyricsMelody }
>>>     \new Lyrics \lyricsto "verse" { \verseOneLyrics }
>>>   >>
>>>   <<
>>>     \new Devnull  = "verseB" { \break  \verseLyricsMelody }
>>>     \new Lyrics \lyricsto "verseB" { \verseOneLyrics }
>>>   >>
>>> }
>>>
>>>
>>>

Reply via email to