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