]> git.donarmstrong.com Git - lilypond.git/blob - input/test/count-systems.ly
* scripts/lilypond-book.py (do_file): do not overwrite input file.
[lilypond.git] / input / test / count-systems.ly
1
2 \version "2.1.26"
3 \header{
4     
5     texidoc="@cindex Count Systems
6 Display the number of systems, or the system number of a
7 Grob.  This can be most useful to assertain that a piece uses a
8 specified number of lines.
9 " }
10
11 #(define (display-systemno smob)
12   (let* ((this-system (ly:grob-system smob))
13          (systems (ly:spanner-broken-into
14                    (ly:grob-original this-system))))
15     (display smob)
16     (display (list-index systems this-system))
17     (newline)))
18   
19
20 #(define (display-system-count smob)
21   (display (length
22             (ly:spanner-broken-into
23              (ly:grob-original
24               (ly:grob-system smob))))))
25
26   
27   
28 \score{
29     \notes\relative c''{
30         \override NoteHead  #'after-line-breaking-callback
31         % = #display-system-count
32         = #display-systemno
33         c1
34         d
35     }
36     \paper{ indent = 0.0\mm
37             linewidth = 10.0\mm
38                 raggedright = ##t
39         }
40 }
41