MIDI: fix regtest failure
[lilypond/patrick.git] / input / regression / scheme-book-scores.ly
blobcd500bea6c169c9beb9a3ad6d8aa54d0159a29d8
1 \version "2.13.4"
3 \header {
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
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 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)))))
33 oneNoteScore =
34 #(define-music-function (parser location) ()
35 (add-one-note-score parser)
36 (make-music 'Music 'void #t))
38 %%%
40 \header {
41 title = "Main Title"
42 subtitle = "Main subtitle"
43 piece = "Piecetitle"
46 \oneNoteScore
48 \bookpart {
49 \header { title ="Title 1" subtitle="Sub1"}
50 \oneNoteScore
51 \score { \relative c' c1 }
52 \oneNoteScore
56 \bookpart {
57 \score { \relative c' c1 }
58 \oneNoteScore
61 \oneNoteScore