lilypond-user
[Top][All Lists]
Advanced

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

Re: Hiding a staff with notes in it


From: Evan O'Dorney
Subject: Re: Hiding a staff with notes in it
Date: Wed, 17 Aug 2016 21:07:30 -0700

Wow! I'll have to try it out.

Evan


On Aug 17, 2016 6:37 PM, "Vaughan McAlley" <address@hidden> wrote:
On 18 August 2016 at 09:42, Evan O'Dorney <address@hidden> wrote:
> Hi all,
>
> Is there a way to allow Lilypond to hide a staff on certain systems, similar
> to \RemoveEmptyStaffContext, but applicable to certain non-empty staves? My
> situation is that I have a choral piece where the 1st and 2nd sopranos
> divide, and I would like to see two staves of identical material leading up
> to the point on the system where the division happens. (The parts are
> dissimilar enough to preclude notating the divisi on one staff.) For
> example:
>
> <<
>   \new Staff = "s1" {
>     \relative g' {
>       \repeat unfold 30 { g2 } a1
>     }
>   }
>   \new Staff = "s2" {
>     \relative g' {
>       % The second staff may be hidden
>       \repeat unfold 30 { g2 }
>       % The second staff must be shown
>       f1
>     }
>   }
>>>
>
> Thanks,
> Evan
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

This is what I use:

\version "2.18.2"

hideMusic = { \set Staff.keepAliveInterfaces = #'() }
showMusic =   \unset Staff.keepAliveInterfaces

\score {
   <<
      \new Staff = "s1" {
         \relative g' {
            \repeat unfold 30 { g2 } a1
         }
      }
      \new Staff = "s2" {
         \relative g' {
            % The second staff may be hidden
            \hideMusic
            \repeat unfold 30 { g2 }
            % The second staff must be shown
            \showMusic
            f1
         }
      }
   >>
   \layout {
      \context {
         \Staff
         \RemoveEmptyStaves
         % Remove the first staff
         \override VerticalAxisGroup.remove-first = ##t
      }
   }
}

Cheers,
Vaughan

_______________________________________________
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]