lilypond-user
[Top][All Lists]
Advanced

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

Re: Trouble hiding NullVoice


From: Samantha Margerison
Subject: Re: Trouble hiding NullVoice
Date: Sun, 27 Mar 2022 12:48:33 +0100


Lukas, that is brilliant ... thank you SO much!!

I'd not come across #(skip-of-length introNotes) before and it will come in super useful!

I did put together a diagram to try to grok how contexts fit together and it is slowly sinking in lol

image.png


The clarity of using lyrics without timings is nice (as well as being easier to add) though this is only possible with the added work of entering the melody notes (and the score I create will only ever be used by me for playing bass, the other band members work from a song sheet created in chordpro format. In my real .ly file, I include the chords/notes/lyrics from other .ly files to cut down the clutter in the main one, I'm going to try both approaches in that and see how it goes.

Thank you once again for your time and knowledge, you've helped me move forward on my Lilypond journey!

Smanth


Sender notified by
Mailtrack
03/27/22, 12:46:35 PM

On Sun, 27 Mar 2022 at 11:47, Lukas-Fabian Moser <lfm@gmx.de> wrote:
Hi Samanth,

(Please keep the list in your replies, so future readers can follow the
discussion.)

> When I put in the \new Staff, it does indeed prevent the nullVoice
> from producing a staff ... however the chords now appear in the wrong
> line ... almost as if they are being put above where the NullVoice
> score would have been.

It's easier to define the "correct" order of contexts once and for all,
so I took the liberty of re-organizing your score a bit.

While doing , I noticed something else that I missed before: If you
enter the durations of your Lyrics words explicitly, you do not need a
(Null)Voice to align the lyrics to. There are two fundamentally
different ways of writing Lyrics in LilyPond:

- with explicit lengths (as you did: "When8. I16" etc.)
- without explicit lengths, but aligned to a Voice or NullVoice

So one can reduce to:

% When I'm Sixty Four - Bass Song Sheet
\version "2.22.2"
\language english

\header {
   title = "When I'm Sixty Four"
   subtitle = Bass
   composer = "McCartney/Lennon"
}

% Setup variables for Chords, Notes, Rhythm and Lyrics
introChords = \chordmode {
   c1 c1 f2 g2 |
   c1 c1 c1 |
}

verseChords = \chordmode {
   c1 c1 c1 g1:7 |
}

introNotes = \relative c, {
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   f4 r4 g4 r4 |
   \break
   c4 g4 c4 r4 |
   c4 r4 g4 r8 a16 b16 |
   c4 r4 g4 r4 |
   \bar "||"
   \break
}

verseNotes = \relative c, {
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   g4 r4 d'4\3 r4 |
   \break
}

verseOneLyrics = \lyricmode
{
   \set stanza = "1. "
   When8. I16 get4 old4 -- er4
   losing4 my4 hair2
   Many4 years4 from4 now4 "___"1
}

<<
   \new ChordNames {
     \introChords
     \verseChords
   }
   \new Staff \with {
     \easyHeadsOn
     \clef "bass_8"
   } {
     \introNotes
     \verseNotes
   }
   \new Lyrics {
     #(skip-of-length introNotes)
     \verseOneLyrics
   }
 >>

But it's often easier to actually use a (Null)Voice for this, since that
way we don't have to clutter the lyrics with durations. The way I'd
personally do it would be (as I often need the actual melody as well, I
went ahead and entered it with pitches - but these might also be omitted):

% When I'm Sixty Four - Bass Song Sheet
\version "2.22.2"
\language english

\header {
   title = "When I'm Sixty Four"
   subtitle = Bass
   composer = "McCartney/Lennon"
}

% Setup variables for Chords, Notes, Rhythm and Lyrics
introChords = \chordmode {
   c1 c1 f2 g2 |
   c1 c1 c1 |
}

verseChords = \chordmode {
   c1 c1 c1 g1:7 |
}

introNotes = \relative c, {
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   f4 r4 g4 r4 |
   \break
   c4 g4 c4 r4 |
   c4 r4 g4 r8 a16 b16 |
   c4 r4 g4 r4 |
   \bar "||"
   \break
}

verseNotes = \relative c, {
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   c4 r4 g4 r4 |
   g4 r4 d'4\3 r4 |
   \break
}

melody = \relative {
   R1*6
   e'8 ds e8 g4. e4 % If we're not interested in the pitches, we can
simply write 8 8 8 4. 4 etc.
   g8 a g c4. r4
   c8 e4. c4 a8 d8~
   d2 r
}

verseOneLyrics = \lyricmode
{
   \set stanza = "1. "
   When I get old -- er
   lo -- sing my hair
   Ma -- ny years from now __
}

<<
   \new ChordNames {
     \introChords
     \verseChords
   }
   \new Staff \with {
     \easyHeadsOn
     \clef "bass_8"
   }
   <<
     {
       \introNotes
       \verseNotes
     }
     \new NullVoice = mel \melody
   >>
   \new Lyrics \lyricsto mel {
     \verseOneLyrics
   }
 >>

\new StaffGroup <<
   \new ChordNames {
     \introChords
     \verseChords
   }
   \new Staff \with { \autoBeamOff }
   \new Voice = "mel" \melody
   \new Lyrics \lyricsto mel {
     \verseOneLyrics
   }
   \new Staff \with {
     \easyHeadsOn
     \clef "bass_8"
   }
   {
     \introNotes
     \verseNotes
   }
 >>

As you can see, this way one can generate different versions of the
score from the same variables, which is one of the main strengths of
LilyPond.

For the construct

\new Voice = someName { ... }
\new Lyrics \lyricsTo someName { ... }

there is the shorthand

\new Voice { ... } \addlyrics { ... }

but in my experience this is only really helpful in the simplest of use
cases, so I didn't use it here.

Lukas


reply via email to

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