Re: Many staff contexts do not nest
- Original Message - From: Richard Shann rich...@rshann.plus.com To: 'lilypond-user' lilypond-user@gnu.org Sent: Monday, August 04, 2014 12:03 PM Subject: Many staff contexts do not nest 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 ...) Richard Shann Does http://lsr.di.unimi.it/LSR/Item?id=397 help at all? (It is quoted in the NR, too). -- Phil Holmes ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
On Mon, 2014-08-04 at 13:51 +0100, Phil Holmes wrote: - Original Message - From: Richard Shann rich...@rshann.plus.com To: 'lilypond-user' lilypond-user@gnu.org Sent: Monday, August 04, 2014 12:03 PM Subject: Many staff contexts do not nest 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 ...) Richard Shann Does http://lsr.di.unimi.it/LSR/Item?id=397 help at all? (It is quoted in the NR, too). It looks like it would help someone wanting to create nested staff braces, but what I was hoping was that there was some simple rationale behind the behavior of \new GrandStaff, \new ChoirStaff, \new StaffGroup when nested, as then I could write something that would check the LilyPond syntax for useless or invalid constructs ... Richard -- Phil Holmes ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
Richard Shann rich...@rshann.plus.com 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 lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
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
Re: Many staff contexts do not nest
On Mon, 2014-08-04 at 08:40 -0700, tisimst wrote: 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 Perhaps the following could be added to the Nested Staff Groups section of the page http://www.lilypond.org/doc/v2.18/Documentation/notation/displaying-staves By default Piano Staff, Grand Staff and Staff Group can be nested inside a Choir Staff and any of these can be nested inside a Staff Group. perhaps immediately before the sentence New nested staff group contexts can be defined. Thanks for the clarifications, I see what I can reasonably check now. Richard ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
On Mon, Aug 4, 2014 at 10:39 AM, Richard Shann rich...@rshann.plus.com wrote: Perhaps the following could be added to the Nested Staff Groups section of the page http://www.lilypond.org/doc/v2.18/Documentation/notation/displaying-staves By default Piano Staff, Grand Staff and Staff Group can be nested inside a Choir Staff and any of these can be nested inside a Staff Group. perhaps immediately before the sentence New nested staff group contexts can be defined. Thanks for the clarifications, I see what I can reasonably check now. Richard Well, it's not that other combinations CAN'T be nested at all, because you've shown that they can. It's just that the corresponding braces/brackets may not appear like one would expect them to. Not sure how to clarify this in the docs, but I think this must also be mentioned somehow. There's something in the behavior of \accepts that still allows them to be present, but the nomenclature makes it sound like they shouldn't be. Is it must me or is that a little weird... -Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
Abraham Lee tisimst.lilyp...@gmail.com writes: On Mon, Aug 4, 2014 at 10:39 AM, Richard Shann rich...@rshann.plus.com wrote: Perhaps the following could be added to the Nested Staff Groups section of the page http://www.lilypond.org/doc/v2.18/Documentation/notation/displaying-staves By default Piano Staff, Grand Staff and Staff Group can be nested inside a Choir Staff and any of these can be nested inside a Staff Group. perhaps immediately before the sentence New nested staff group contexts can be defined. Thanks for the clarifications, I see what I can reasonably check now. Richard Well, it's not that other combinations CAN'T be nested at all, because you've shown that they can. It's just that the corresponding braces/brackets may not appear like one would expect them to. No, if they are not accepted, they are created outside of the non-accepting staff. Not sure how to clarify this in the docs, but I think this must also be mentioned somehow. There's something in the behavior of \accepts that still allows them to be present, but the nomenclature makes it sound like they shouldn't be. Is it must me or is that a little weird... Here is a diagram. hier.pdf Description: Adobe PDF document -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Many staff contexts do not nest
On Mon, Aug 4, 2014 at 11:41 AM, David Kastrup d...@gnu.org wrote: Abraham Lee tisimst.lilyp...@gmail.com writes: On Mon, Aug 4, 2014 at 10:39 AM, Richard Shann rich...@rshann.plus.com wrote: Perhaps the following could be added to the Nested Staff Groups section of the page http://www.lilypond.org/doc/v2.18/Documentation/notation/displaying-staves By default Piano Staff, Grand Staff and Staff Group can be nested inside a Choir Staff and any of these can be nested inside a Staff Group. perhaps immediately before the sentence New nested staff group contexts can be defined. Thanks for the clarifications, I see what I can reasonably check now. Richard Well, it's not that other combinations CAN'T be nested at all, because you've shown that they can. It's just that the corresponding braces/brackets may not appear like one would expect them to. No, if they are not accepted, they are created outside of the non-accepting staff. Ok. Maybe that could be mentioned somewhere? Not sure how to clarify this in the docs, but I think this must also be mentioned somehow. There's something in the behavior of \accepts that still allows them to be present, but the nomenclature makes it sound like they shouldn't be. Is it must me or is that a little weird... Here is a diagram. -- David Kastrup Wow. That's cool, but precisely why I narrowed down my prior nesting tree :) Thanks for the clarification! -Abraham ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user