On Mon, Aug 4, 2014 at 9:26 AM, David Kastrup [via Lilypond] 
<ml-node+s1069038n165304...@n5.nabble.com> wrote:
> Richard Shann <[hidden email]> writes: 
> 
> > The documentation says that staff groups can be nested, but many 
> don't 
> > appear to work, e.g. this 
> > 
> > \version "2.18.0" 
> > \score { 
> >         << 
> >              \new GrandStaff << 
> >                                 \new Staff { s1*4/4 } 
> >                                  \new ChoirStaff << 
> >                                                     \new Staff 
> > { s1*4/4 } 
> >                                                     \new Staff 
> > { s1*4/4 } 
> >                                                     \new Staff 
> > { s1*4/4 } 
> >                                                 >> 
> >                              >> 
> >         >> 
> >     } 
> > 
> > has no GrandStaff. 
> > Is something missing at 
> > 
> http://www.lilypond.org/doc/v2.18/Documentation/notation/displaying-staves
> > and can anyone explain the rules (I am trying to write a staff 
> braces 
> > checker ...)
> 
> #(for-each 
>   (lambda (cd) 
>    (format #t "~a can accept: ~{~a~^, ~}\n" (car cd) 
>     (or (ly:context-def-lookup (cdr cd) 'accepts)))) 
>   (ly:output-find-context-def #{ \layout { } #})) 
> 
> -- 
> David Kastrup 
> 
> _______________________________________________ 
> lilypond-user mailing list 
> [hidden email] 
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 
> 
> If you reply to this email, your message will be added to the 
> discussion below:
> http://lilypond.1069038.n5.nabble.com/Many-staff-contexts-do-not-nest-tp165299p165304.html
> To start a new topic under User, email 
> ml-node+s1069038n...@n5.nabble.com 
> To unsubscribe from Lilypond, click here.
> NAML
> 

David,

Nice solution!

Richard,

If you'd like to know what the default nesting hierarchy is, you can 
refer to "engraver-init.ly", which shows this heirarchy of the 
different contexts that support nesting (recursion removed for 
simplicity):

Score accepts...
|- GrandStaff
|
|- StaffGroup accepts...
|   |- GrandStaff
|   |- PianoStaff
|   |- ChoirStaff
|   |- StaffGroup
|
|- ChoirStaff accepts...
    |- GrandStaff
    |- PianoStaff
    |- StaffGroup

I believe that this is what is causing the stencil to not show up like 
you were experiencing since the GrandStaff context, by default, doesn't 
accept a ChoirStaff one. However, if you'd really like to do that (I 
think this probably isn't your real goal), you can simply tell LilyPond 
to accept it and the proper nested braces/brackets appear as you would 
expect:

\version "2.18.0"
\score {
  <<
    \new GrandStaff <<
      \new Staff { s1*4/4 }
      \new ChoirStaff <<
        \new Staff { s1*4/4 }
        \new Staff { s1*4/4 }
        \new Staff { s1*4/4 }
      >>
    >>
  >>
  \layout {
    \context {
      \GrandStaff
      \accepts "ChoirStaff"
    }
  }
}

It looks a little funny to me, but that's how you would implement this 
behavior.

Regards,
Abraham


nested-staves-solution.png (14K) 
<http://lilypond.1069038.n5.nabble.com/attachment/165306/0/nested-staves-solution.png>




--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Many-staff-contexts-do-not-nest-tp165299p165306.html
Sent from the User mailing list archive at Nabble.com.
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to