It is also possible to define new contexts from scratch. To do this, you must define give the new context a name. In the following example, a very simple Staff context is created: one that will put note heads on a staff symbol.
\translator {
\type "Engraver_group_engraver"
\name "SimpleStaff"
\alias "Staff"
\consists "Staff_symbol_engraver"
\consists "Note_head_engraver"
\consistsend "Axis_group_engraver"
}
The argument of \type is the name for a special engraver that
handles cooperation between simple engravers such as
Note_head_engraver and Staff_symbol_engraver. This
should always be Engraver_group_engraver (unless you are
defining a Score context from scratch, in which case
Score_engraver must be used).
The complete list of context modifiers is the following:
\alias alternate-name:
This specifies a different name. In the above example,
\property Staff.X = Y will also work on SimpleStaffs.
\consistsend engravername:
Analogous to \consists, but makes sure that
engravername is always added to the end of the list of
engravers.
Engravers that group context objects into axis groups or alignments
need to be at the end of the list. \consistsend insures that
engravers stay at the end even if a user adds or removes engravers.
\accepts contextname:
This context can contains contextname contexts. The first
\accepts is created as a default context when events (e.g. notes
or rests) are encountered.
\denies:
The opposite of \accepts.
\name contextname:
This sets the type name of the context, e.g. Staff,
Voice. If the name is not specified, the translator will not
do anything.
|
This page is for LilyPond-2.0.3 (stable-branch). Report errors to <bug-lilypond@gnu.org>. |