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."
11 #(use-modules (scm display-lily))
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
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)
24 (score (scorify-music music parser))
25 (layout (ly:output-def-clone $defaultlayout))
26 (desc (markup #:large #:line ((ly:format "Score with a ~a"
27 (note-name->lily-string scmpitch parser))))))
28 (ly:score-add-output-def! score layout)
29 (add-text parser desc)
30 (add-score parser score))
31 (set! pitch (modulo (1+ pitch) 7)))))
34 #(define-music-function (parser location) ()
35 (add-one-note-score parser)
36 (make-music 'Music 'void #t))
42 subtitle = "Main subtitle"
49 \header { title ="Title 1" subtitle="Sub1"}
51 \score { \relative c' c1 }
57 \score { \relative c' c1 }