]> git.donarmstrong.com Git - lilypond.git/blob - input/test/count-systems.ly
* lily/bar-line.cc (compound_barline): fix : for staff without
[lilypond.git] / input / test / count-systems.ly
1
2 \version "2.3.8"
3 \header{
4     
5     texidoc="@cindex Count Systems
6 After a line break, some function may called by overriding 
7 @code{after-line-breaking-callback}. This can be most useful to assertain 
8 that a piece uses a specified number of lines; typically the number of
9 lines (or systems) is not engraved, but it can be printed to console when 
10 generating the output. The number of lines may be associated either
11 to the number of systems or the system number of a grob.
12 " }
13
14 %% -- jcn:
15 %% See, e.g., input/mutopia/J.S.Bach/baerenreiter-sarabande.ly for
16 %% an application:
17
18 %% We want this to perfectly match the Baerenreiter spacing.
19 %% If we're not using 6 systems, there's definately a problem.
20 %% #(define (assert-system-count smob n) ...
21
22 #(define (display-systemno smob)
23   (let* ((this-system (ly:grob-system smob))
24          (systems (ly:spanner-broken-into
25                    (ly:grob-original this-system))))
26    (display smob)
27    (display systems)
28    (display this-system)
29    
30    (display (list-index systems this-system))
31    (newline)))
32   
33
34 #(define (display-system-count smob)
35   (display (length
36             (ly:spanner-broken-into
37              (ly:grob-original
38               (ly:grob-system smob))))))
39
40   
41   
42 \score{
43     \relative c''{
44         \override NoteHead  #'after-line-breaking-callback
45          = #display-system-count
46 %       = #display-systemno
47         c1
48         d
49     }
50     \paper{ indent = 0.0\mm
51             linewidth = 10.0\mm
52                 raggedright = ##t
53         }
54 }
55