lilypond-user
[Top][All Lists]
Advanced

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

Re: New snippet: remove staff if another is alive (for wind divisi)


From: Thomas Morley
Subject: Re: New snippet: remove staff if another is alive (for wind divisi)
Date: Wed, 8 Aug 2018 23:58:25 +0200

2018-08-08 22:21 GMT+02:00 Thomas Morley <address@hidden>:

>
> Well, this whole post was meant to explain my thoughts while coding
> the example from my previous mail.
> I expected the code to fail like my previous.
> It doesn't.
> Though, even after your hints above, what's the essential difference?
>
> I'll investigate.


The essential difference is the rhythm of the control-voice.
The code below never prints single instrument staves.
But changing in controlDivisi
s4 s s s -> s1
works.

Changing
s4 s s s -> $#{ s4 s s s #}
works as well.

WTF?

\version "2.19.82"

one = { e'1 f'4 g' a' f' g'1 }
two = { c'1 d'1 e'1 }
breaks = { s1 \break s1 \break s1 }

switchOff = \set Staff.keepAliveInterfaces = #'()
switchOn = \unset Staff.keepAliveInterfaces

controlDivisi = {
  \switchOn
%  s1
%  s4 s s s
  $#{ s4 s s s #}
  \switchOff
  s
  \switchOn
  s1
}
\new StaffGroup \with { \consists "Keep_alive_together_engraver" }
  <<
  \new Staff = "single1"
    \with {
      \override VerticalAxisGroup.remove-layer = 2
    }
    << \breaks \one >>
  \new Staff = "single2"
    \with {
      \override VerticalAxisGroup.remove-layer = 2
    }
    << \breaks \two >>
  \new Staff = "divisi"
    \with {
      \RemoveAllEmptyStaves
      \override VerticalAxisGroup.remove-layer = 1
    }
    <<
      \controlDivisi
      \new Voice { \voiceOne \one } \new Voice { \voiceTwo \two }
    >>
>>

Cheers,
  Harm



reply via email to

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