lilypond-user
[Top][All Lists]
Advanced

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

Re: Many staff contexts do not nest


From: tisimst
Subject: Re: Many staff contexts do not nest
Date: Mon, 4 Aug 2014 08:40:10 -0700 (PDT)

On Mon, Aug 4, 2014 at 9:26 AM, David Kastrup [via Lilypond] <[hidden email]> 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 [hidden email]
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) Download Attachment


View this message in context: Re: Many staff contexts do not nest
Sent from the User mailing list archive at Nabble.com.

reply via email to

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