2 \include "../orchestrallily.ly"
4 \header { title
= "Using your custom contexts with OrchestralLily" }
6 % Define our own contexts "SquareStaffGroup" and "ThreeStaff":
9 \name "SquareStaffGroup"
11 \description "Staff group with a square bracket"
12 systemStartDelimiter
= #'SystemStartSquare
19 \description "Staff with only three lines"
20 \override StaffSymbol
#'line-count
= #3
25 \description "Voice printed all in red"
26 \override NoteHead
#'color
= #red
27 \override Stem
#'color
= #blue
29 % Hook the new contexts into the hierarchy...
34 \accepts "SquareStaffGroup"
39 % Register the contexts with OrchestralLily, we can use the default handlers!
40 #(oly
:register
_staff
_type
_handler
"SquareStaffGroup" oly
:staff
_group
_handler
)
41 #(oly
:register
_staff
_type
_handler
"ThreeStaff" oly
:staff
_handler
)
42 #(oly
:register
_voice
_type
_handler
"RedVoice" oly
:voice
_handler
)
44 \orchestralScoreStructure #'(
45 ("Group" "SquareStaffGroup" ("StaffI" "StaffII"))
46 ("StaffI" "ThreeStaff" ())
48 \orchestralVoiceTypes #'(
49 ("StaffII" "RedVoice")
52 TestStaffIMusic
= \relative c'' { c2 d2 }
53 TestStaffIIMusic
= \relative c'' { b4 b b b }
55 \createScore #"Test" #'("Group")