]> git.donarmstrong.com Git - lilypond.git/blob - input/bugs/context-weirdness.ly
patch::: 1.4.1.jcn3
[lilypond.git] / input / bugs / context-weirdness.ly
1 \header {
2 texidoc = "context level weirdness.  after some commands, explicit
3  \context Voice commands must be inserted; otherwise subsequent property
4  settings fail silently"
5 }
6
7 % from les-nereides.ly
8
9  #(define (make-text-checker text)
10   (lambda (elt) (equal? text (ly-get-grob-property elt 'text))))
11
12 \score {
13   \context PianoStaff <
14     \context Staff=upper \notes\relative c' {
15         \property Score.timing = ##f
16
17         \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4)
18         c-"foe"
19         
20         \translator Staff=lower
21
22         % staff switch moves us
23         % implicitely to staff level: text-checker won't see "foe"
24         \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4)
25         c-"foe"
26
27         % get back to Voice level: it works again
28         \context Voice
29         \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4)
30         c-"foe"
31
32         \clef treble
33         
34         % clef change moves us
35         % implicitely to staff level: text-checker won't see "foe"
36         \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4)
37         c-"foe"
38
39         % get back to Voice level: it works again
40         \context Voice
41         \outputproperty #(make-text-checker "foe") #'extra-offset = #'(-2 . 4)
42         c-"foe"
43         
44     }
45     \context Staff=lower \notes\relative c' {
46       s
47     }
48   >
49   \paper {
50     linewidth = -1.0
51   }
52 }