]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/context-mod-context.ly
81241dc9821e18a5fcadde7411035ddaa83a460f
[lilypond.git] / input / regression / context-mod-context.ly
1 \version "2.16.0"
2
3 \header  {
4 texidoc = "Context modifications can be stored into a variable as a
5 \with object. They can be later inserted directly into a context definition."
6 }
7
8 % Some sample modifications to be inserted into a \with block later on
9 ctxmod = \with {
10   \remove "Time_signature_engraver"
11   \consists "Ambitus_engraver"
12   \override StaffSymbol #'line-count = 4
13 }
14
15 music = \relative c'' { \key fis \minor c1 d e }
16
17 \score { <<
18     \new Staff { \music}
19   >>
20   \layout {
21     \context { \Staff
22       \ctxmod
23       \override NoteHead #'style = #'petrucci
24     }
25   }
26 }
27
28
29 \score { <<
30     \new Staff { \music}
31   >>
32   \layout {
33     \context { \Staff
34       \override StaffSymbol #'line-count = 3
35       \override NoteHead #'style = #'petrucci
36     }
37     % Should override the above definitions, but not reset others
38     \context { \Staff
39       \ctxmod
40     }
41   }
42 }
43