]> git.donarmstrong.com Git - lilypond.git/blob - input/test/count-systems.ly
* input/test/chord-names-jazz.ly:
[lilypond.git] / input / test / count-systems.ly
1
2 \version "2.1.26"
3 \header{
4     
5     texidoc="@cindex Count Systems
6 The function which controls the printing of the system number may be also
7 overridden to print, for example, the number of systems or the system
8 number of a grob.
9 " }
10
11 % Original comment has no sense? -HJJ:
12 % This can be most useful to assertain that a piece uses a specified number of lines.
13
14 %% What is the problem? -- jcn:
15 %% See, eg, 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
23 #(define (display-systemno smob)
24   (let* ((this-system (ly:grob-system smob))
25          (systems (ly:spanner-broken-into
26                    (ly:grob-original this-system))))
27     (display smob)
28     (display (list-index systems this-system))
29     (newline)))
30   
31
32 #(define (display-system-count smob)
33   (display (length
34             (ly:spanner-broken-into
35              (ly:grob-original
36               (ly:grob-system smob))))))
37
38   
39   
40 \score{
41     \notes\relative c''{
42         \override NoteHead  #'after-line-breaking-callback
43         % = #display-system-count
44         = #display-systemno
45         c1
46         d
47     }
48     \paper{ indent = 0.0\mm
49             linewidth = 10.0\mm
50                 raggedright = ##t
51         }
52 }
53