Fix crash
[orchestrallily.git] / testsuite / custom-contexts-handlers.ly
blob0fc6428209d2dd19a27e8c7d21f404a46f2bc976
1 \version "2.13.17"
2 \include "../orchestrallily.ly"
4 \header { title = "Using your custom contexts with OrchestralLily" }
6 % Define our own contexts "SquareStaffGroup" and "ThreeStaff":
7 \layout{
8 \context { \StaffGroup
9 \name "SquareStaffGroup"
10 \alias StaffGroup
11 \description "Staff group with a square bracket"
12 systemStartDelimiter = #'SystemStartSquare
13 \accepts "Staff"
14 \accepts "ThreeStaff"
16 \context { \Staff
17 \name "ThreeStaff"
18 \alias Staff
19 \description "Staff with only three lines"
20 \override StaffSymbol #'line-count = #3
22 \context { \Voice
23 \name "RedVoice"
24 \alias Voice
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...
30 \context { \Staff
31 \accepts "RedVoice"
33 \context { \Score
34 \accepts "SquareStaffGroup"
35 \accepts "ThreeStaff"
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")