1\version "2.21.1"
2
3\header {
4  texidoc = "If @code{after-writing} is set in the @code{\\midi}
5block, it is called after every MIDI file that is written.  The
6visual and MIDI output are not important in this test."
7
8  AA = "a0"
9  EE = "e0"
10}
11
12#(ly:set-option 'warning-as-error #t)
13
14\midi {
15  after-writing =
16  #(lambda (performance file-name)
17    (let* ((headers (ly:performance-headers performance))
18           (AA (ly:modules-lookup headers 'AA))
19           (BB (ly:modules-lookup headers 'BB))
20           (CC (ly:modules-lookup headers 'CC))
21           (DD (ly:modules-lookup headers 'DD))
22           (EE (ly:modules-lookup headers 'EE))
23           (FF (ly:modules-lookup headers 'FF))
24           (GG (ly:modules-lookup headers 'GG)))
25     (ly:warning "~a ~a ~a ~a ~a ~a ~a" AA BB CC DD EE FF GG)))
26}
27
28\book {
29  \header { BB = "b1" EE = "e1" FF = "f1" }
30  \bookpart {
31    \header { CC = "c2" FF = "f2" GG = "g2" }
32
33    %% this score tests that variables can be introduced (A-D) and
34    %% overridden (E-G)
35    #(ly:expect-warning "a0 b1 c2 d3 e1 f2 g3")
36    \score {
37      { c'1 }
38      \header { DD = "d3" GG = "g3" }
39      \layout { }
40      \midi { }
41    }
42  }
43}
44