lilypond-user
[Top][All Lists]
Advanced

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

Re: removing non-empty staves


From: nothingwavering
Subject: Re: removing non-empty staves
Date: Tue, 4 Dec 2012 09:25:12 -0700

NOTE: follow-up question attached


Thank you, Keith and Wim, for responding to my posting.

It turns out that Keith's idea of using keepAliveInterfaces was just what I 
needed.

I had browsed the internals reference a bit to look for something like that and 
had happened across keepAliveInterfaces as a property of the 
Hara_kiri_engraver, but I didn't know how to set a property of an engraver.

Looks like I just needed to set it at the Staff level.  I also wouldn't have 
thought to use paired \set and \unset commands to turn this behavior on and off.

I found I was able to put these \set and \unset commands into variables that I 
could use as backslash escaped commands from within my music for greater 
brevity and readability:

        hideStaff = \set Staff.keepAliveInterfaces = #'() 
        showStaff = \unset Staff.keepAliveInterfaces 

FOLLOW-UP QUESTION:

Whom should I talk to to suggest putting getting these tweaks predefined in the 
"shipping" installation of Lilypond and documented in the official Lilypond 
manual?  

I venture to think this tweak is a useful enough and standard enough 
requirement that it ought to be made available as either A) preferably a 
default Lilypond command, or B) if not a default command, then a tweak 
documented in the Lilypond snippets section of the official documentation.

Does anyone know what the procedure is for proposing this kind of enhancement 
to Lilypond's built-in commands and/or its documentation?  I would like for 
this behavior to be more readily accessible to others who may be looking for 
this functionality.

Thanks again,
Christopher

On Dec 3, 2012, at 5:36 PM, Keith OHara <address@hidden> wrote:

> <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 }}
> 
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user




reply via email to

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