lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble hiding NullVoice


From: Lukas-Fabian Moser
Subject: Re: Trouble hiding NullVoice
Date: Sun, 27 Mar 2022 11:03:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

Hi Samanth(a),

I'm producing a bassline score, with chords, notes and lyrics.

As the bassline notes are ... sparse, I'm trying to use a NullVoice to hold the rhythm and aligning the lyrics to that (I gather this is an approach used by others)

Despite much googling/reading of docs/internals/snippets/etc I'm totally failing to prevent a staff appearing for the NullVoice.

I'm fairly new to Lilypond and am still trying to wrap my head around contexts/grobs/etc and would be grateful for any advice as to how to resolve this issue.

I've attached a cutdown .ly and the pdf it produces.

Don't worry, it'll all become clear soon enough. And you hit a comparatively subtle point: Since you're not creating a Staff context explicitly, you're relying on LilyPond to create staves automatically, and it seems a new Voice (or NullVoice) causes a new Staff to be created.

Replacing your

\score {
  {
...

by

\score {
  \new Staff {
...

already does the trick.

In general, I would not recommend adding multiple sections of simultaneous music << ... >> one after another to make up a piece. Most often, it's more convenient to construct a _complete_ bass music variable (which of course may be comprised of multiple sections defined independently), similarly for the other voices, and then combine them in a << ... >> expression.

So (pseudocode), I prefer

\score {
  <<
    \new Staff \firstInstrument
    \new Staff \secondInstrument
  >>
}

with

firstInstrument = {
  \firstInstrumentIntro
  \firstInstrumentVerse
}

etc.

Lukas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]