]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/apply-context.ly
* lily/beam-engraver.cc: move new-beam-event to beam-event
[lilypond.git] / input / regression / apply-context.ly
1
2 \version "1.9.1"
3
4
5 \header {
6
7 texidoc = "With \\applycontext, \\properties can be modified
8 procedurally. Applications include: checking bar numbers, smart
9 octavation.
10
11
12 This example prints a bar-number during processing on stdout.
13 "
14
15 }
16
17     \paper { raggedright= ##t }
18
19
20 \score { \notes \relative c'' {
21     c1 c1
22
23     %% todo: should put something interesting in the .tex output.
24     
25     \applycontext
26         #(lambda (tr)
27          (format #t "\nWe were called in barnumber ~a.\n"
28           (ly:get-context-property tr 'currentBarNumber)))
29     c1 c1
30 }}