lilypond-user
[Top][All Lists]
Advanced

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

Re: Hiding unused staffs??


From: David Kastrup
Subject: Re: Hiding unused staffs??
Date: Wed, 13 Nov 2019 00:32:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Guy Stalnaker <address@hidden> writes:

> All,
>
> I'm writing a choral composition where there are varying numbers of
> voices in play at any one time. Starts out 4-voice SATB, then 6-voices
> (SAATBB), then 4 voices (TTBB), then 3 voices (SSA), then 6, then 8.
>
> I know I can simply code 8 voices, assigning rests where voices don't
> sing. That's easy.
>
> I know I can use the terrific method to remove empty staves if I do
> the above.
>
> I know I can use \new Staff inside a polyphonic context.
>
> Yet each of these methods has problems.
>
> There can be empty staffs throughout the work. Or there can be empty
> staves that appear and then then vanish. Or a \new Staff starts
> halfway across the page (truly ugly).
>
> Though the code gets ugly using the \new Staff method, is there an
> elegant way to get LP to align \new Staff always at the beginning of a
> line?
>
> Or is there a different and better way to do as I describe.
>
> Much thanks for any recommendations!

Does the following from the regression tests help any?

\version "2.19.13"

\header {
  texidoc = "The @code{VerticalAxisGroup.remove-layer}
property can be used for typesetting temporary divisi staves where
the switch to split staves is done only at line breaks such that all
complex passages are rendered in separate staves."
}

boring = \set Staff.keepAliveInterfaces = #'()
tricky = \unset Staff.keepAliveInterfaces

violI=\relative d' {
  \boring \repeat unfold 100 d4
  \tricky <d g'>2
  \boring \repeat unfold 98 d4
  \bar "|."
}

violII=\relative g {
  \boring \repeat unfold 100 g4
  \tricky <g d'>2
  \boring \repeat unfold 98 g4
  \bar "|."
}

\score {
  \new StaffGroup \with { \consists "Keep_alive_together_engraver" }
  <<
    \new Staff \with { instrumentName = "Violin I"
                       shortInstrumentName = "V I"
                       \override VerticalAxisGroup.remove-empty = ##t
                       \override VerticalAxisGroup.remove-first = ##t
                       \override VerticalAxisGroup.remove-layer = 1
                     }
    \violI
    \new Staff \with { instrumentName = "Violin II"
                       shortInstrumentName = "V II"
                       \override VerticalAxisGroup.remove-empty = ##t
                       \override VerticalAxisGroup.remove-first = ##t
                       \override VerticalAxisGroup.remove-layer = 1
                     }
    \violII
    \new Staff \with { instrumentName = "Violins"
                       shortInstrumentName = "V I&II"
                       \override VerticalAxisGroup.remove-layer = 2
                     }
    <<  \violI \\ \violII  >>
  >>
  \layout {
    short-indent = 2\cm
    indent = 3\cm
  }
}

-- 
David Kastrup

reply via email to

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