lilypond-user
[Top][All Lists]
Advanced

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

Re: Problems defining a BraceStaff


From: John Zaitseff
Subject: Re: Problems defining a BraceStaff
Date: Fri, 29 Feb 2008 21:00:38 +1100
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

Dear Mats / other LilyPonders,

Mats wrote:
> Do you want both the default ChoirStaff and the BraceStaff in the same
> score (or in the same .ly file)?

Yes, I do.  The solution you had suggested (redefining the ChoirStaff 
context) had already occurred to me...

> Otherwise, I think you only included your new context type halfway into
> the context hieararchy.  You also have to tell which contexts are accepted
> within your new context.
>
> Actually, instead of creating a new context from scratch, as you have
> attempted to do, it's often easier to use an existing context type as a
> starting point, for example [... cut ...]

Thanks, your comments gave me the hints I needed, as demonstrated below.

> If you haven't already looked in the file ly/engraver-init.ly, I recommend
> you to do so. It's the best way to understand how these things really
> work.

I indeed have looked into this file (and the related ly/performer-init.ly), 
although, as you mentioned, "the default definition of ChoirStaff is a bit 
complicated".

In the end, I came up with the following, which seems to work for me:

  \layout {
      \context {
          \GrandStaff
          \name "BraceStaff"
          \type "Engraver_group"
          \alias "ChoirStaff"

          \remove "Span_bar_engraver"
          \remove "Span_arpeggio_engraver"

          \accepts "Staff"
          \accepts "FiguredBass"
          \accepts "TabStaff"
          \accepts "Lyrics"
          \accepts "ChordNames"

          \description
            "Just like @code{ChoirStaff} but with a brace
             (@code{SystemStartBrace}) instead of a bracket
             (@code{SystemStartBracket}) at the start of each system."
      }

      \context {
          \Score
          \accepts "BraceStaff"
      }
  }

  \midi {
      \context {
          \GrandStaff
          \name "BraceStaff"
          \type "Performer_group"
          \alias "ChoirStaff"
      }

      \context {
          \Score
          \accepts "BraceStaff"
      }
  }

Once again, thank you for all your help!

Yours truly,

John Zaitseff

-- 
John Zaitseff                    ,--_|\    The ZAP Group
Phone:  +61 2 9643 7737         /      \   Sydney, Australia
E-mail: address@hidden   \_,--._*   http://www.zap.org.au/
                                      v




reply via email to

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