lilypond-user
[Top][All Lists]
Advanced

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

Re: How to merge two scores into one?


From: Malte Meyn
Subject: Re: How to merge two scores into one?
Date: Thu, 5 Jan 2017 23:08:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


Am 05.01.2017 um 22:45 schrieb Jeff Epstein:
> I'm not understanding how to merge two scores into one. The song just 
> continues, but it's a different section with a different voice configuration. 
> The first section has a single voice, the second has two. The only way I can 
> figure it out so far is to print out two scores. Is there a way to merge 
> these into a single score, so the song continues on the same line? Thanks.

It looks like \RemovesEmptyStaves and friends are what you are looking
for: This command removes staves which contain only rests from the score
so you can have two staves all the time but fill the verse of the lower
staff with rests. In LilyPond 2.18 you might need an extra \override.
The code below shows how the command is used.

\version "2.18.2"

\header {
  title = "How to hide empty staves"
}

melodyTop = \relative {
  \clef treble
  \key c \major
  \time 4/4
  c'8 d e f g a b4
  \break
  c8 b a g f e d4
  \break
  c d e f g a b c
  \break
  R1*2
}

melodyBottom = \relative {
  \clef bass
  \key c \major
  \time 4/4
  R1
  c'2 f,2
  R1*2
  c1 c2 c
}

lyricsTop = \lyricmode {
  do re mi fa so la ti
  do ti la so fa me re
  so -- lo so -- lo so -- lo so -- lo
}

lyricsBottom = \lyricmode {
  do fa
  bass so -- lo
}

\score {
  <<
    \new Voice = "top" { \autoBeamOff \melodyTop }
    \new Lyrics \lyricsto "top" \lyricsTop
    \new Voice = "bottom" { \autoBeamOff \melodyBottom }
    \new Lyrics \lyricsto "bottom" \lyricsBottom
    %% might be easier:
    %{
    { \autoBeamOff \melodyTop }
    \addlyrics \lyricsTop
    { \autoBeamOff \melodyBottom }
    \addlyrics \lyricsBottom
    %}
  >>
  \layout {
    \context {
      \Staff
      %% LilyPond 2.18
      %% removes empty staves (but not in the first line)
      \RemoveEmptyStaves
      %% removes empty staves in the first line
      \override VerticalAxisGroup.remove-first = ##t
      %% LilyPond 2.19
      %% removes empty staves everywhere;
      %% \RemoveEmptyStaves still exists in 2.19
      %\RemoveAllEmptyStaves
    }
  }
}



reply via email to

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