lilypond-user
[Top][All Lists]
Advanced

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

Re: shortcut for creating new Staff "subclass" context?


From: Neil Puttock
Subject: Re: shortcut for creating new Staff "subclass" context?
Date: Tue, 8 Sep 2009 22:38:01 +0100

2009/9/8 Kieren MacMillan <address@hidden>:

> Is there anything like this? (From what I've read and experienced, \alias
> does *NOT* do this.)

Have you looked at engraver-init.ly?  It should give you an idea how
this works (see the definition for PianoStaff).

Here's a quick snippet which also demonstrates what \alias does:

\score {
  <<
    \new Staff \relative c' {
      c4 d e f
    }
    \new BlueStave \relative c' {
      % this works because we've made BlueStave an alias of Staff
      \override Staff.Clef #'color = #blue
      c4 d e f
    }
  >>
  \layout {
    \context {
      \Staff
      \name "BlueStave"
      \alias "Staff"
      \override StaffSymbol #'color = #blue
    }

    \context {
      \Score
      \accepts "BlueStave"
    }
  }
}

Regards,
Neil




reply via email to

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