]> git.donarmstrong.com Git - lilypond.git/blob - input/regression/scheme-book-scores.ly
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / input / regression / scheme-book-scores.ly
1 \version "2.19.22"
2
3 \header {
4
5   texidoc = "Scores can be generated with scheme, too, and inserted into the
6 current book(part). Generated and explicit scores can be mixed, the header
7 informations from top- and booklevel stack correctly."
8
9 }
10
11 #(use-modules (scm display-lily))
12
13 % Sample score, which adds a score (containing just one note) to the current
14 % book/bookpart/at toplevel using scheme rather than the parser.
15 % That score is supposed to use the global header information, too.
16 #(define add-one-note-score 
17    (let ((pitch 0))
18         (lambda (parser)
19           (let* ((scmpitch (ly:make-pitch 0 pitch 0))
20                  (music (make-music 'EventChord
21                           'elements (list (make-music 'NoteEvent
22                                             'duration (ly:make-duration 2 0 1/1)
23                                             'pitch scmpitch))))
24                  (score (scorify-music music))
25                  (layout (ly:output-def-clone $defaultlayout))
26                  (desc (markup #:large #:line ((ly:format "Score with a ~a"
27                                 (note-name->lily-string scmpitch))))))
28             (ly:score-add-output-def! score layout)
29             (add-text desc)
30             (add-score score))
31             (set! pitch (modulo (1+ pitch) 7)))))
32
33 oneNoteScore =
34 #(define-void-function () ()
35    (add-one-note-score (*parser*)))
36
37 %%%
38
39 \header {
40   title = "Main Title"
41   subtitle = "Main subtitle"
42   piece = "Piecetitle"
43 }
44
45 \oneNoteScore
46
47 \bookpart {
48   \header { title ="Title 1" subtitle="Sub1"}
49   \oneNoteScore
50   \score { \relative c' c1 }
51   \oneNoteScore
52 }
53
54
55 \bookpart {
56   \score { \relative c' c1 }
57   \oneNoteScore
58 }
59
60 \oneNoteScore
61