lilypond-user
[Top][All Lists]
Advanced

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

Re: removing non-empty staves


From: Keith OHara
Subject: Re: removing non-empty staves
Date: Tue, 4 Dec 2012 00:36:01 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

 <nothingwavering <at> gmail.com> writes:

> I'm familiar with the instruction
>       \context {   \Staff \RemoveEmptyStaves }

> Is there a way to tell Lilypond to stop showing a non-empty staff 
> (that contains notes) and reclaim its space after the next line break?  

There is a variable called keepAliveInterfaces that describes what contents
LilyPond considers before removing "empty" staves.  (It is only mentioned 
in the documentation in the Internals Reference, but you can see its usual 
definition in 'engraver-init.ly' included in the LilyPond installation.)

You could set this variable to an empty list for the Staff that you want 
to disappear at the next line, and then "unset" it so that LilyPond uses
the default definition when you need that Staff to return.  Or you can 
probably do something more clever.  

If this or some other solution works well for you, you might recommend 
it as a solution/workaround for an outstanding bug 
<http://code.google.com/p/lilypond/issues/detail?id=2779>


\version "2.16.0"
\paper { #(set-paper-size "a6") indent = 2.5\cm short-indent = 1.2\cm }

violinI = \repeat unfold 8 {c''1}

violinIIa = \relative c' {
  \override Staff.VerticalAxisGroup #'remove-first = ##t
  \set Staff.shortInstrumentName = "outer"  
  \set Staff.keepAliveInterfaces = #'()
  c4 d e f g f e d
  \unset Staff.keepAliveInterfaces
  <>_"divisi"
  e f g a b a g f
  \set Staff.keepAliveInterfaces = #'()
  <>_"unison"
  c d e f g f e d
  c d e f c1 }

violinIIb = \relative c' {
  c4 d e f g f e d 
  \set Staff.shortInstrumentName = "inner"
  c d e f g f e d 
  \set Staff.shortInstrumentName = "" 
  c d e f g f e d
  c d e f c1 } 

\new StaffGroup <<
  \new Staff \with {
    instrumentName = "1st Violins"
    shortInstrumentName = "Vn1"  
  } \violinI
  \new GrandStaff \with {
    instrumentName = "2nd Violins"
    shortInstrumentName = "Vn2"  
  } <<
    \new Staff \violinIIa
    \new Staff \violinIIb >> >>
\layout {
  \context {
    \Staff \RemoveEmptyStaves }}




reply via email to

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