3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % Desciption: Lilypond package to make writing large orchestral scores easier.
7 % Documentation: http://wiki.kainhofer.com/lilypond/orchestrallily
8 % Version: 0.02, 2008-03-06
9 % Author: Reinhold Kainhofer, reinhold@kainhofer.com
10 % Copyright: (C) 2008 by Reinhold Kainhofer
11 % License: GPL v3.0, http://www.gnu.org/licenses/gpl.html
14 % 0.01 (2008-03-02): Initial Version
15 % 0.02 (2008-03-06): Added basic MIDI support (*MidiInstrument and \setCreateMIDI)
16 % 0.03 (2008-07-xx): General staff/voice types, title pages, etc.
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 #(use-modules
(ice-
9 match
))
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %%%%% SCORE STRUCTURE AND AUTOMATIC GENERATION
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 % Helper function to filter all non-null entries
36 #(define
(not-null? x
) (not
(null? x
)))
38 % Helper function to extract a given variable, built from [Piece][Instrument]Identifier
39 #(define
(namedPieceInstrObject piece instr name
)
41 (fullname
(string-
>symbol
(string-append piece instr name
)))
42 (instrname
(string-
>symbol
(string-append instr name
)))
43 (piecename
(string-
>symbol
(string-append piece name
)))
46 ((defined? fullname
) (primitive-eval fullname
))
47 ((defined? instrname
) (primitive-eval instrname
))
48 ((defined? piecename
) (primitive-eval piecename
))
54 %% Print text as a justified paragraph, taken from the lilypond Notation Reference
55 #(define-markup-list-command
(paragraph layout props args
) (markup-list?
)
56 (let
((indent
(chain-assoc-get
'par-indent props
2)))
57 (interpret-markup-list layout props
58 (make-justified-lines-markup-list
(cons
(make-hspace-markup indent
)
61 conditionalBreak
= #(define-music-function
(parser location
) ()
62 #{ \tag #'instrumental-score
\pageBreak #}
65 #(define
(oly
:piece-title-markup title
) (markup
#:column
(#:line
(#:fontsize
#'3 #:bold title
))) )
67 #(define-markup-command
(piece-title layout props title
) (markup?
)
68 (interpret-markup layout props
(oly
:piece-title-markup title
))
71 #(define
(oly
:generate
_object
_name piece instr obj
)
72 (if
(and
(string? piece
) (string? instr
) (string? obj
))
73 (string-append piece instr obj
)
77 #(define
(oly
:generate
_staff
_name piece instr
) (oly
:generate
_object
_name piece instr
"St"))
79 #(define
(set-context-property context property value
)
80 (set
! (ly
:music-property context property
) value
)
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 % Score structure and voice types
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 #(define oly
:orchestral
_score
_structure
'())
90 #(define
(oly
:set
_score
_structure struct
)
92 (set
! oly
:orchestral
_score
_structure struct
)
93 (ly
:warning
(_ "oly:set_score_structure needs an association list as argument!"))
97 orchestralScoreStructure
= #(define-music-function
(parser location structure
) (list?
)
98 (oly
:set
_score
_structure structure
)
99 (make-music
'Music
'void
#t
)
102 #(define oly
:voice
_types
'())
104 #(define
(oly
:set
_voice
_types types
)
106 (set
! oly
:voice
_types types
)
107 (ly
:warning
(_ "oly:set_voice_types needs an association list as argument!"))
111 orchestralVoiceTypes
= #(define-music-function
(parser location types
) (list?
)
112 (oly
:set
_voice
_types types
)
113 (make-music
'Music
'void
#t
)
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 % Automatic staff and group generation
119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 % Retrieve all music definitions for the given
122 #(define
(oly
:get
_music
_object piece instrument
)
123 (namedPieceInstrObject piece instrument
"Music")
125 #(define
(oly
:get
_music
_objects piece instruments
)
126 (filter not-null?
(map
(lambda
(i
) (oly
:get
_music
_object piece i
)) instruments
))
129 % Given a property name and the extensions, either generate the pair to set
130 % the property or an empty list, if no pre-defined variable could be found
131 #(define
(oly
:generate
_property
_pair prop piece instr type
)
132 (let
* ((val
(namedPieceInstrObject piece instr type
)))
133 (if
(not-null? val
) (list
'assign prop val
) '() )
137 #(define
(oly
:staff
_type type
)
139 ((string? type
) (string-
>symbol type
))
140 ((symbol? type
) type
)
145 #(define
(oly
:extractPitch music
)
147 (elems
(if
(ly
:music? music
) (ly
:music-property music
'elements
)))
148 (note
(if
(pair? elems
) (car elems
)))
149 (pitch
(if
(ly
:music? note
) (ly
:music-property note
'pitch
)))
151 (if
(and
(not-null? music
) (not
(ly
:pitch? pitch
)))
152 (ly
:warning
"Unable to interpret as a pitch!")
158 #(define
(oly
:extractTranspositionPitch piece name
)
160 (trpFromPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeFrom")))
161 (trpToPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeTo")))
163 (if
(ly
:pitch? trpFromPitch
)
164 (if
(ly
:pitch? trpToPitch
)
166 (ly
:pitch-diff trpFromPitch trpToPitch
)
167 (ly
:pitch-diff trpFromPitch
(ly
:make-pitch
0 0 0))
169 (if
(ly
:pitch? trpToPitch
)
170 (ly
:pitch-diff
(ly
:make-pitch
0 0 0) trpToPitch
)
177 #(define
(oly
:voice
_handler
_internal parser piece name type music
)
179 (tempo
(namedPieceInstrObject piece name
"Tempo"))
180 (lyrics
(namedPieceInstrObject piece name
"Lyrics"))
181 (trpPitch
(oly
:extractTranspositionPitch piece name
))
185 (if
(ly
:music? lyrics
)
186 (set
! musiccontent
(append musiccontent
(list dynamicUp
)))
187 (if
(not-null? lyrics
) (ly
:warning
(_ "Wrong type (no lyrics) for lyrics for instrument ~S in piece ~S") name piece
))
189 ; Append the settings
, key and clef
(if defined
)
192 (let
* ((object
(namedPieceInstrObject piece name type
)))
193 (if
(ly
:music? object
)
194 (set
! musiccontent
(append musiccontent
(list object
)))
195 (if
(not-null? object
) (ly
:warning
(_ "Wrong type (no ly:music) for ~S for instrument ~S in piece ~S") type name piece
))
199 '("Settings" "Key" "Clef" "TimeSignature")
202 (if
(ly
:music? music
)
204 (set
! musiccontent
(make-simultaneous-music
(append musiccontent
(list music
))))
205 ;
(ly
:message
"Generating staff for ~a" name
)
206 (if
(ly
:pitch? trpPitch
)
207 (set
! musiccontent
(ly
:music-transpose musiccontent trpPitch
))
211 (voicename
(oly
:generate
_object
_name piece name
"Voice" ))
212 (voicetype
(oly
:staff
_type type
))
213 (voice
(context-spec-music musiccontent voicetype voicename
))
214 (staffcont
(list voice
))
216 ; I
f we have lyrics
, create
a lyrics context containing LyricCombineMusic
217 ; and add that
as second element to the staff
's elements list
...
218 (if
(ly
:music? lyrics
)
220 (lyricsname
(oly
:generate
_object
_name piece name
"Lyrics" ))
221 (lyricscont
(make-music
'LyricCombineMusic
'element lyrics
'associated-context voicename
))
223 (set
! staffcont
(append staffcont
224 (list
(context-spec-music lyricscont
'Lyrics lyricsname
))))
230 ; For empty music
, return empty
236 #(define
(oly
:voice
_handler parser piece name type
)
237 (let
* ((music
(oly
:get
_music
_object piece name
))
239 (oly
:voice
_handler
_internal parser piece name type music
)
244 #(define
(oly
:staff
_handler
_internal parser piece name type voices
)
245 (if
(not-null? voices
)
247 (staffname
(oly
:generate
_staff
_name piece name
))
248 (stafftype
(oly
:staff
_type type
))
249 (staff
(make-simultaneous-music voices
))
250 (propops
(oly
:staff
_handler
_properties piece name
))
253 ((SimultaneousMusic ParallelMusic
) #f)
254 (else
(set
! staff
(context-spec-music staff stafftype staffname
)))
256 (if
(not-null? propops
)
257 (set
! (ly
:music-property staff
'property-operations
) propops
)
261 ; For empty music
, return empty
266 #(define
(oly
:staff
_handler parser piece name type children
)
267 (let
* ((c (if
(not-null? children
) children
(list name
)))
268 (voices
(apply append
(map
(lambda
(v
) (oly
:create
_voice parser piece v
)) c)) )
270 (if
(not-null? voices
)
271 (oly
:staff
_handler
_internal parser piece name type voices
)
277 #(define
(oly
:parallel
_voices
_staff
_handler parser piece name type children
)
279 (voices
(map
(lambda
(i
) (oly
:create
_voice parser piece i
)) children
))
280 ; get the lsit of non-empty voices and flatten it
!
281 (nonemptyvoices
(apply append
(filter not-null? voices
)))
283 (if
(not-null? nonemptyvoices
)
284 (oly
:staff
_handler
_internal parser piece name
"Staff" nonemptyvoices
)
290 #(define
(oly
:part
_combined
_staff
_handler parser piece name type children
)
291 (let
* ((music
(oly
:get
_music
_objects piece children
)))
294 ((and
(pair? music
) (ly
:music?
(car music
)) (not-null?
(cdr music
)) (ly
:music?
(cadr music
)))
295 ;
(ly
:message
"Part-combine with two music expressions")
296 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(make-part-combine-music parser music
))))
298 (ly
:warning
"Part-combine without any music expressions")
300 ; exactly one is
a music expression
, simply use that by joining
302 (ly
:message
"Part-combine with only one music expressions")
303 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(apply append music
))))
305 ;
(ly
:message
"make_part_combined_staff: ~S ~S ~a" piece instr instruments
)
311 % Generate the properties for the staff for piece and instr. Typically, these
312 % are the instrument name and the short instrument name (if defined).
313 % return a (possibly empty) list of all assignments.
314 #(define
(oly
:staff
_handler
_properties piece instr
)
317 (instrumentName
. "InstrumentName")
318 (shortInstrumentName
. "ShortInstrumentName")
319 (midiInstrument
. "MidiInstrument")
323 (oly
:generate
_property
_pair
(car pr
) piece instr
(cdr pr
))
326 (props
(filter not-null? assignments
))
332 % Figured bass is a special case, as it can be voice- or staff-type. When
333 % given as a staff type, simply call the voice handler, instead
335 #(define
(oly
:figured
_bass
_staff
_handler parser piece name type children
)
336 (let
* ((c (if
(not-null? children
) children
(list name
)))
337 (voice
(oly
:voice
_handler parser piece
(car
c) type
)))
338 (if
(pair? voice
) (car voice
) ())
343 #(define
(oly
:staff
_group
_handler parser piece name type children
)
345 (staves
(map
(lambda
(i
) (oly
:create
_staff
_or
_group parser piece i
)) children
))
346 (nonemptystaves
(filter not-null? staves
))
348 (if
(not-null? nonemptystaves
)
350 (musicexpr
(if
(= 1 (length nonemptystaves
))
352 (make-simultaneous-music nonemptystaves
)))
353 (groupname
(oly
:generate
_staff
_name piece name
))
354 (grouptype
(oly
:staff
_type type
))
356 (propops
(oly
:staff
_handler
_properties piece name
))
359 ((SimultaneousMusic ParallelMusic
) #f)
360 (else
(set
! group
(context-spec-music group grouptype groupname
)))
362 (set
! (ly
:music-property group
'property-operations
) propops
)
365 ; Return empty list if no staves are generated
371 #(define
(oly
:create
_voice parser piece name
)
372 (let
* ( (voice
(namedPieceInstrObject piece name
"Voice"))
373 (type
(assoc-ref oly
:voice
_types name
)) )
374 (if
(not-null? voice
)
375 ; Explicit voice variable
, use that
379 ; No entry in structure found
=> simple voice
380 (oly
:voice
_handler parser piece name
"Voice")
381 ; Entry found in structure
=> use the handler for the given type
383 (voicetype
(car type
))
384 (handler
(assoc-ref oly
:voice
_handlers voicetype
))
387 ((primitive-eval handler
) parser piece name voicetype
)
389 (ly
:warning
"No handler found for voice type ~a, using default voice handler" voicetype
)
390 (oly
:voice
_handler parser piece name voicetype
)
399 #(define
(oly
:create
_staff
_or
_group parser piece name
)
400 (let
* ( (staff
(namedPieceInstrObject piece name
"Staff"))
401 (type
_from
_structure
(assoc-ref oly
:orchestral
_score
_structure name
)) )
402 ;
(if
(not-null? staff
)
403 ;
(ly
:message
"Found staff variable for instrument ~a in piece ~a" instr piece
)
404 ;
(ly
:message
"Staff variable for instrument ~a in piece ~a NOT FOUND" instr piece
)
406 (if
(not-null? staff
)
407 ; Explicit staff variable
, use that
410 (if
(not
(list? type
_from
_structure
))
411 ; No entry in structure found
=> simple staff
412 (oly
:staff
_handler parser piece name
"Staff" '())
414 ; Entry found in structure
=> use the handler for the given type
415 (let
* ((type
(car type
_from
_structure
))
416 (handler
(assoc-ref oly
:staff
_handlers type
))
417 (children
(cadr type
_from
_structure
))
420 ((primitive-eval handler
) parser piece name type children
)
422 (ly
:warning
"No handler found for staff type ~a, using default staff handler" type
)
423 (oly
:staff
_handler parser piece name type children
)
432 #(define oly
:staff
_handlers
435 '("GrandStaff" . oly
:staff
_group
_handler
)
436 '("PianoStaff" . oly
:staff
_group
_handler
)
437 '("ChoirStaff" . oly
:staff
_group
_handler
)
438 '("StaffGroup" . oly
:staff
_group
_handler
)
439 '("InnerChoirStaff" . oly
:staff
_group
_handler
)
440 '("InnerStaffGroup" . oly
:staff
_group
_handler
)
441 '("ParallelMusic" . oly
:staff
_group
_handler
)
442 '("SimultaneousMusic" . oly
:staff
_group
_handler
)
444 '("Staff" . oly
:staff
_handler
)
445 '("DrumStaff" . oly
:staff
_handler
)
446 '("RhythmicStaff" . oly
:staff
_handler
)
447 '("TabStaff" . oly
:staff
_handler
)
448 '("GregorianTranscriptionStaff" . oly
:staff
_handler
)
449 '("MensuralStaff" . oly
:staff
_handler
)
450 '("VaticanaStaff" . oly
:staff
_handler
)
451 ; staves with multiple voices
452 '("PartCombinedStaff" . oly
:part
_combined
_staff
_handler
)
453 '("ParallelVoicesStaff" . oly
:parallel
_voices
_staff
_handler
)
454 ; special cases
: Figured bass can be staff or voice type
!
455 '("FiguredBass" . oly
:figured
_bass
_staff
_handler
)
459 #(define oly
:voice
_handlers
462 '("Voice" . oly
:voice
_handler
)
463 '("CueVoice" . oly
:voice
_handler
)
464 '("DrumVoice" . oly
:voice
_handler
)
465 '("FiguredBass" . oly
:voice
_handler
)
466 '("GregorianTranscriptionVoice" . oly
:voice
_handler
)
467 '("NoteNames" . oly
:voice
_handler
)
468 '("TabVoice" . oly
:voice
_handler
)
469 '("VaticanaVoice" . oly
:voice
_handler
)
470 ;
'("Dynamics" . oly
:dynamics
_handler
)
475 #(define
(oly
:register
_staff
_type
_handler type func
)
476 ;
(ly
:message
"Registering staff handler ~a for type ~a" func type
)
477 (set
! oly
:staff
_handlers
(assoc-set
! oly
:staff
_handlers type func
))
480 #(define
(oly
:register
_voice
_type
_handler type func
)
481 ;
(ly
:message
"Registering voice type handler ~a for type ~a" func type
)
482 (set
! oly
:voice
_handlers
(assoc-set
! oly
:voice
_handlers type func
))
485 % handlers for deprecated API
486 #(oly
:register
_staff
_type
_handler
'StaffGroup
'oly
:staff
_group
_handler
)
487 #(oly
:register
_staff
_type
_handler
'GrandStaff
'oly
:staff
_group
_handler
)
488 #(oly
:register
_staff
_type
_handler
'PianoStaff
'oly
:staff
_group
_handler
)
489 #(oly
:register
_staff
_type
_handler
'ChoirStaff
'oly
:staff
_group
_handler
)
490 #(oly
:register
_staff
_type
_handler
'Staff
'oly
:staff
_handler
)
491 #(oly
:register
_staff
_type
_handler
'ParallelMusic
'oly
:staff
_group
_handler
)
492 #(oly
:register
_staff
_type
_handler
'SimultaneousMusic
'oly
:staff
_group
_handler
)
493 #(oly
:register
_staff
_type
_handler
#t
'oly
:part
_combined
_staff
_handler
)
494 #(oly
:register
_staff
_type
_handler
#f 'oly
:parallel
_voices
_staff
_handler
)
498 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
499 % Automatic score generation
500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502 % \setUseBook ##t/##f sets a flag to determine whether the calls to createScore
503 % are from within a book block or not
504 % #(define oly:score_handler collect-scores-for-book)
505 #(define oly
:score
_handler toplevel-score-handler
)
506 #(define oly
:music
_handler toplevel-music-handler
)
507 #(define oly
:text
_handler toplevel-text-handler
)
509 setUseBook
= #(define-music-function
(parser location usebook
) (boolean?
)
512 (set
! oly
:score
_handler book-score-handler
)
513 (set
! oly
:music
_handler book-music-handler
)
514 (set
! oly
:text
_handler book-text-handler
)
517 (set
! oly
:score
_handler toplevel-score-handler
)
518 (set
! oly
:music
_handler toplevel-music-handler
)
519 (set
! oly
:text
_handler toplevel-text-handler
)
522 (make-music
'Music
'void
#t
)
526 % Two functions to handle midi-blocks: Either don't set one, or set an empty
527 % one so that MIDI is generated
528 #(define
(oly
:set
_no
_midi
_block score
) '())
529 #(define
(oly
:set
_midi
_block score
)
530 (let
* ((midiblock
(if
(defined?
'$defaultmidi
)
531 (ly
:output-def-clone $defaultmidi
)
532 (ly
:make-output-def
))))
533 (ly
:output-def-set-variable
! midiblock
'is-midi
#t
)
534 (ly
:score-add-output-def
! score midiblock
)
538 % \setCreateMidi ##t/##f sets a flag to determine wheter MIDI output should
540 #(define oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
541 setCreateMIDI
= #(define-music-function
(parser location createmidi
) (boolean?
)
543 (set
! oly
:apply
_score
_midi oly
:set
_midi
_block
)
544 (set
! oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
546 (make-music
'Music
'void
#t
)
550 % Two functions to handle layout-blocks: Either don't set one, or set an empty
551 % one so that a PDF is generated
552 #(define
(oly
:set
_no
_layout
_block score
) '())
553 #(define
(oly
:set
_layout
_block score
)
554 (let
* ((layoutblock
(if
(defined?
'$defaultlayout
)
555 (ly
:output-def-clone $defaultlayout
)
556 (ly
:make-output-def
))))
557 (ly
:output-def-set-variable
! layoutblock
'is-layout
#t
)
558 (ly
:score-add-output-def
! score layoutblock
)
562 % \setCreatePDF ##t/##f sets a flag to determine wheter PDF output should
564 #(define oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
565 setCreatePDF
= #(define-music-function
(parser location createlayout
) (boolean?
)
567 (set
! oly
:apply
_score
_layout oly
:set
_layout
_block
)
568 (set
! oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
570 (make-music
'Music
'void
#t
)
574 % Set the piece title in a new header block.
575 #(define
(oly
:set
_piece
_header score piecename
)
576 (if
(not-null? piecename
)
577 (let
* ((header
(make-module
)))
578 (module-define
! header
'piece piecename
)
579 (ly
:score-set-header
! score header
)
585 % post-filter functions. By default, no filtering is done. However,
586 % for the *NoCues* function, the cue notes should be killed
587 identity
= #(define-music-function
(parser location music
) (ly
:music?
) music
)
588 cuefilter
= #(define-music-function
(parser location music
) (ly
:music?
)
589 ((ly
:music-function-extract removeWithTag
) parser location
'cued
((ly
:music-function-extract killCues
) parser location music
))
592 #(define-public
(oly
:add-toc-item parser markup-symbol text
)
593 (oly
:music
_handler parser
(add-toc-item
! markup-symbol text
)))
596 #(define
(oly
:add-score parser score piecename
)
597 (if
(not-null? piecename
)
598 (oly
:add-toc-item parser
'tocItemMarkup piecename
))
599 (oly
:score
_handler parser score
)
601 % The helper function to build a score.
602 #(define
(oly
:createScoreHelper parser location piece children func
)
604 (staves
(oly
:staff
_group
_handler parser piece
"" "SimultaneousMusic" children
))
605 (music
(if
(not-null? staves
)
606 ((ly
:music-function-extract func
) parser location staves
)
610 (piecename
(namedPieceInstrObject piece
(car children
) "PieceName"))
611 (piecenametacet
(namedPieceInstrObject piece
(car children
) "PieceNameTacet"))
615 ; No staves
, print tacet
617 (if
(not-null? piecenametacet
) (set
! piecename piecenametacet
))
618 (if
(not-null? piecename
)
619 (oly
:add-score parser
(list
(oly
:piece-title-markup piecename
)) piecename
)
620 (ly
:warning
(_ "No music and no score title found for part ~a and instrument ~a") piece children
)
623 ; we have staves
, apply the piecename to the score and add layout
/midi blocks if needed
625 (set
! score
(scorify-music music parser
))
626 (oly
:set
_piece
_header score piecename
)
627 (oly
:apply
_score
_midi score
)
628 (oly
:apply
_score
_layout score
)
629 ; Schedule the score for typesetting
630 (oly
:add-score parser score piecename
)
634 ; This is
a void function
, the score has been schedulled for typesetting already
635 (make-music
'Music
'void
#t
)
638 createScore
= #(define-music-function
(parser location piece children
) (string? list?
)
639 (oly
:createScoreHelper parser location piece children identity
)
641 createNoCuesScore
= #(define-music-function
(parser location piece children
) (string? list?
)
642 (oly
:createScoreHelper parser location piece children cuefilter
)
645 createHeadline
= #(define-music-function
(parser location headline
) (string?
)
646 (oly
:add-toc-item parser
'tocItemMarkup headline
)
647 (oly
:score
_handler parser
(list
(oly
:piece-title-markup headline
)))
648 (make-music
'Music
'void
#t
)
653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
659 newInstrument
= #(define-music-function
(parser location instr
) (string?
)
661 \set Voice
.instrumentCueName
= #$
(string-join
(list
"+" instr
))
664 cueText
= #(define-music-function
(parser location instr
) (string?
)
666 \set Voice
.instrumentCueName
= $instr
670 % generate a cue music section with instrument names
671 % Parameters: \namedCueDuring NameOfQuote CueDirection CueInstrument OriginalInstrument music
672 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
673 % -) CueInstrument and OriginalInstrument are the displayed instrument names
675 % \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 }
676 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
677 % the beginning of the cue notes and "Sop." at the end
678 namedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr cuemusic
) (string? number? string? string? ly
:music?
)
680 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\cueText #$instrcue $cuemusic
\tag #'cued
\cueText #$instr
}
681 % \tag #'uncued $cuemusic
684 namedTransposedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr trans cuemusic
) (string? number? string? string? ly
:music? ly
:music?
)
686 \transposedCueDuring #$cuevoice
#$direction $trans
{ \tag #'cued
\cueText #$instrcue $cuemusic
\tag #'cued
\cueText #$instr
}
687 % \tag #'uncued $cuemusic
691 % set the cue instrument name and clef
692 setClefCue
= #(define-music-function
(parser location instr clef
)
695 \once \override Staff
.Clef
#'font-size
= #-
3 $clef
696 \set Voice
.instrumentCueName
= $instr
699 % generate a cue music section with instrument names and clef changes
700 % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music
701 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
702 % -) CueInstrument and OriginalInstrument are the displayed instrument names
703 % -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containing voice
705 % \cleffedCueDuring #"vIQuote" #UP #"V.I" #"treble" #"Basso" #"bass" { R1*3 }
706 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
707 % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble at the
708 % beginning of the cue notes and reset to bass at the end
709 cleffedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue clefcue instr clefinstr cuemusic
)
710 (string? number? string? ly
:music? string? ly
:music? ly
:music?
)
712 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\setClefCue #$instrcue $clefcue $cuemusic
\tag #'cued
\setClefCue #$instr $clefinstr
}
713 % \tag #'uncued $cuemusic
720 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
721 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
723 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
727 shiftDynamics
= #(define-music-function
(parser location xshift yshift
) (number? number?
)
729 \once \override DynamicTextSpanner
#'padding
= $yshift
730 \once\override DynamicText
#'extra-offset
= #(cons $xshift $yshift
)
733 ffz
= #(make-dynamic-script
"ffz")
734 pf
= #(make-dynamic-script
"pf")
735 sempp
= #(make-dynamic-script
(markup
#:line
( #:with-dimensions
'(0 . 0)
736 '(0 . 0) #:right-align
#:normal-text
#:italic
"sempre" #:dynamic
"pp")))
737 parenf
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"f" #:normal-text
#:italic
#:fontsize
2 ")" )))
738 parenp
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"p" #:normal-text
#:italic
#:fontsize
2 ")" )))
739 pdolce
= #(make-dynamic-script
(markup
#:line
(#:dynamic
"p" #:with-dimensions
'(0 . 0) '(0 . 0) #:normal-text
#:italic
"dolce" )))
743 dim
= #(make-span-event
'DecrescendoEvent START
)
744 enddim
= #(make-span-event
'DecrescendoEvent STOP
)
745 decresc
= #(make-span-event
'DecrescendoEvent START
)
746 enddecresc
= #(make-span-event
'DecrescendoEvent STOP
)
747 cresc
= #(make-span-event
'CrescendoEvent START
)
748 endcresc
= #(make-span-event
'CrescendoEvent STOP
)
751 \set crescendoText
= \markup { \italic "cresc." }
752 \set crescendoSpanner
= #'text
753 \override DynamicTextSpanner
#'style
= #'dashed-line
756 \set decrescendoText
= \markup { \italic "decresc." }
757 \set crescendoSpanner
= #'text
758 \override DynamicTextSpanner
#'style
= #'dashed-line
761 \set decrescendoText
= \markup { \italic "dim." }
762 \set crescendoSpanner
= #'text
763 \override DynamicTextSpanner
#'style
= #'dashed-line
766 newOrOldClef
= #(define-music-function
(parser location new old
) (string? string?
)
767 (if
(ly
:get-option
'old-clefs
) #{ \clef $old
#} #{ \clef $new
#})
772 %%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
773 % to remove also the fermata from R1-\fermataMarkup: By filtering the music
774 % and removing the corresponding events.
775 % Documented as an LSR snippet: http://lsr.dsi.unimi.it/LSR/Item?id=372
776 #(define
(filterOneEventsMarkup event
)
777 ( let
( (eventname
(ly
:music-property event
'name
)) )
779 (or ;; add here event name you do NOT want
780 (eq? eventname
'MultiMeasureTextEvent
)
781 (eq? eventname
'AbsoluteDynamicEvent
)
782 (eq? eventname
'TextScriptEvent
)
783 (eq? eventname
'ArticulationEvent
)
784 (eq? eventname
'CrescendoEvent
)
785 (eq? eventname
'DecrescendoEvent
)
790 filterArticulations
= #(define-music-function
(parser location music
) (ly
:music?
)
791 Â Â
(music-filter filterOneEventsMarkup music
)
804 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
805 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
806 %%%%% REST COMBINATION
807 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
808 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
812 %% REST COMBINING, TAKEN FROM http://lsr.dsi.unimi.it/LSR/Item?id=336
815 %% \new Staff \with {
816 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
817 %% } << \somevoice \\ \othervoice >>
822 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
827 %% - only handles two voices
828 %% - does not handle multi-measure/whole-measure rests
830 #(define
(rest-score r
)
832 (yoff
(ly
:grob-property-data r
'Y-offset
))
833 (sp
(ly
:grob-property-data r
'staff-position
)))
835 (set
! score
(+ score
2))
836 (if
(eq? yoff
'calculation-in-progress
)
837 (set
! score
(- score
3))))
840 (set
! score
(+ score
2))
841 (set
! score
(- score
(abs
(-
1 sp
)))))
844 #(define
(merge-rests-on-positioning grob
)
845 (let
* ((can-merge
#f)
846 (elts
(ly
:grob-object grob
'elements
))
847 (num-elts
(and
(ly
:grob-array? elts
)
848 (ly
:grob-array-length elts
)))
849 (two-voice?
(= num-elts
2)))
851 (let
* ((v
1-grob
(ly
:grob-array-ref elts
0))
852 (v
2-grob
(ly
:grob-array-ref elts
1))
853 (v
1-rest
(ly
:grob-object v
1-grob
'rest
))
854 (v
2-rest
(ly
:grob-object v
2-grob
'rest
)))
858 (let
* ((v
1-duration-log
(ly
:grob-property v
1-rest
'duration-log
))
859 (v
2-duration-log
(ly
:grob-property v
2-rest
'duration-log
))
860 (v
1-dot
(ly
:grob-object v
1-rest
'dot
))
861 (v
2-dot
(ly
:grob-object v
2-rest
'dot
))
862 (v
1-dot-count
(and
(ly
:grob? v
1-dot
)
863 (ly
:grob-property v
1-dot
'dot-count -
1)))
864 (v
2-dot-count
(and
(ly
:grob? v
2-dot
)
865 (ly
:grob-property v
2-dot
'dot-count -
1))))
868 (number? v
1-duration-log
)
869 (number? v
2-duration-log
)
870 (= v
1-duration-log v
2-duration-log
)
871 (eq? v
1-dot-count v
2-dot-count
)))
873 ;; keep the rest that looks best
:
874 (let
* ((keep-v
1?
(>= (rest-score v
1-rest
)
875 (rest-score v
2-rest
)))
876 (rest-to-keep
(if keep-v
1? v
1-rest v
2-rest
))
877 (dot-to-kill
(if keep-v
1? v
2-dot v
1-dot
)))
878 ;; uncomment if you
're curious of which rest was chosen
:
879 ;;
(ly
:grob-set-property
! v
1-rest
'color green
)
880 ;;
(ly
:grob-set-property
! v
2-rest
'color blue
)
881 (ly
:grob-suicide
! (if keep-v
1? v
2-rest v
1-rest
))
882 (if
(ly
:grob? dot-to-kill
)
883 (ly
:grob-suicide
! dot-to-kill
))
884 (ly
:grob-set-property
! rest-to-keep
'direction
0)
885 (ly
:rest
::y-offset-callback rest-to-keep
)))))))
888 (ly
:rest-collision
::calc-positioning-done grob
))))
894 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
895 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
896 %%%%% TABLE OF CONTENTS
897 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
898 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
901 contentsTitle
= "Inhalt / Contents"
904 tocTitleMarkup
= \markup \fill-line
{
907 \override #(cons
'line-width
(* 7 cm
))
908 \line{ \fill-line
{\piece-title
{\contentsTitle} \null }}
913 tocItemMarkup
= \markup \fill-line
{
916 \override #(cons
'line-width
(* 7 cm
))
917 \line { \fill-line
{\fromproperty #'toc
:text
\fromproperty #'toc
:page
}}
924 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
925 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
926 %%%%% TITLE PAGE / HEADER
927 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
928 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
930 #(define-markup-command
(when-property layout props symbol markp
) (symbol? markup?
)
931 (if
(chain-assoc-get symbol props
)
932 (interpret-markup layout props markp
)
933 (ly
:make-stencil
'() '(1 . -
1) '(1 . -
1))))
935 #(define-markup-command
(vspace layout props amount
) (number?
)
936 "This produces a invisible object taking vertical space."
937 (let
((amount
(* amount
3.0)))
939 (ly
:make-stencil
"" (cons -
1 1) (cons
0 amount
))
940 (ly
:make-stencil
"" (cons -
1 1) (cons amount amount
)))))
944 titlePageMarkup
= \markup { \fontsize #2 \when-property
#'header
:title
\column {
946 \fill-line
{ \fontsize #8 \fromproperty #'header
:composer
}
948 \fill-line
{ \fontsize #8 \fromproperty #'header
:poet
}
950 \fill-line
{ \fontsize #10 \bold \fromproperty #'header
:titlepagetitle
}
952 \fontsize #2 \when-property
#'header
:titlepagesubtitle
{
953 \fill-line
{ \fromproperty #'header
:titlepagesubtitle
}
956 \fill-line
{ \postscript #"-20 0 moveto 40 0 rlineto stroke" }
958 \fill-line
{ \fontsize #5 \fromproperty #'header
:ensemble
}
960 \fill-line
{ \fontsize #2 \fromproperty #'header
:instruments
}
962 \fill-line
{ \fontsize #5 \fromproperty #'header
:date
}
964 \fill-line
{ \fontsize #5 \fromproperty #'header
:scoretype
}
966 \fontsize #2 \when-property
#'header
:enteredby
{
967 \fill-line
{ "Herausgegeben von: / Edited by:"}
969 \fill-line
{ \fromproperty #'header
:enteredby
}
972 \when-property
#'header
:arrangement
\column {
974 \fill-line
{ \fontsize #3 \fromproperty #'header
:arrangement
}
980 titleHeaderMarkup
= \markup {
981 \override #'(baseline-skip
. 3.5)
983 \override #'(baseline-skip
. 3.5)
987 \bigger \fromproperty #'header
:title
990 \large \smaller \bold
991 \bigger \fromproperty #'header
:subtitle
995 \fromproperty #'header
:subsubtitle
998 { \large \bold \fromproperty #'header
:instrument
}
1001 \fromproperty #'header
:poet
1002 \fromproperty #'header
:composer
1005 \fromproperty #'header
:meter
1006 \fromproperty #'header
:arranger
1012 titleScoreMarkup
= \markup \piece-title
\fromproperty #'header
:piece
1015 scoreTitleMarkup
= \titleScoreMarkup
1016 bookTitleMarkup
= \titleHeaderMarkup
1021 %%%%%%%%%%%%%% headers and footers %%%%%%%%%%%%%%%%%%%%%%%%%%
1023 #(define
(first-score-page layout props arg
)
1024 (let
* ((label
'first-score-page
)
1025 (table
(ly
:output-def-lookup layout
'label-page-table
))
1026 (label-page
(and
(list? table
) (assoc label table
)))
1027 (page-number
(and label-page
(cdr label-page
)))
1029 (if
(eq?
(chain-assoc-get
'page
:page-number props -
1) page-number
)
1030 (interpret-markup layout props arg
)
1033 #(define no-header-table
'())
1034 thisPageNoHeader
= #(define-music-function
(parser location
) ()
1035 (let
* ((label
(gensym
"header")))
1036 (set
! no-header-table
(cons label no-header-table
))
1039 'page-label label
)))
1042 % TODO: Use the no-header-table!
1043 #(define
(is-header-page layout props arg
)
1044 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1046 (if
(and
(> page-number
2) (!= page-number
7))
1047 (interpret-markup layout props arg
)
1050 #(define no-footer-table
'())
1051 thisPageNoFooter
= #(define-music-function
(parser location
) ()
1052 (let
* ((label
(gensym
"footer")))
1053 (set
! no-footer-table
(cons label no-footer-table
))
1056 'page-label label
)))
1058 % TODO: Use the no-footer-table!
1059 #(define
(is-footer-page layout props arg
)
1060 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1061 (label
'first-score-page
)
1062 (table
(ly
:output-def-lookup layout
'label-page-table
))
1063 (label-page
(and
(list? table
) (assoc label table
)))
1064 ;
(page-number
(and label-page
(cdr label-page
)))
1066 (if
(and
(> page-number
2) (!= page-number
7))
1067 (interpret-markup layout props arg
)
1071 #(define copyright-footer-table
'())
1072 thisPageCopyrightFooter
= #(define-music-function
(parser location
) ()
1073 (let
* ((label
(gensym
"copyrightfooter")))
1074 (set
! copyright-footer-table
(cons label copyright-footer-table
))
1077 'page-label label
)))
1079 #(define copyright-pg
1)
1080 #(define
(set-copyright-pg page
)
1081 (set
! copyright-pg page
)
1084 % TODO: Use the copyright-footer-table!
1085 #(define
(copyright-page layout props arg
)
1086 (if
(= (chain-assoc-get
'page
:page-number props -
1) copyright-pg
)
1087 (interpret-markup layout props arg
)
1092 oddHeaderMarkup
= \markup \fill-line
{
1093 %% force the header to take some space, otherwise the
1094 %% page layout becomes a complete mess.
1096 \on-the-fly
#is-header-page
\fromproperty #'header
:title
1097 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1099 evenHeaderMarkup
= \markup \fill-line
{
1100 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1101 \on-the-fly
#is-header-page
\fromproperty #'header
:composer
1105 oddFooterMarkup
= \markup {
1108 %% publisher header field only on title page.
1109 \on-the-fly
#first-page
\fromproperty #'header
:publisher
1112 %% copyright on the first real score page
1113 \on-the-fly
#copyright-page
\fromproperty #'header
:copyright
1114 \on-the-fly
#copyright-page
\null
1117 %% All other pages get the number of the edition centered
1118 \on-the-fly
#is-footer-page
\fromproperty #'header
:scorenumber
1135 % Interpret the given markup with the header fields added to the props.
1136 % This way, one can re-use the same functions (using fromproperty
1137 % #'header:field) in the header block and as top-level markup.
1139 % This function is originally copied from mark-up-title (file scm/titling.scm),
1140 % which is lilypond's internal function to handle the title markups. I needed
1141 % to replace the scopes and manually add the $defaultheader (which is internally
1142 % done in paper-book.cc before calling mark-up-title. Also, I don't extract the
1143 % markup from the header block, but use the given markup.
1145 % I'm not sure if I really need the page properties in props, too... But I
1146 % suppose it does not hurt, either.
1147 #(define-markup-command
(markupWithHeader layout props markup
) (markup?
)
1148 "Interpret the given markup with the header fields added to the props.
1149 This way, one can re-use the same functions (using fromproperty
1150 #'header:field) in the header block and as top-level markup."
1152 ; TODO
: I
f we are inside
a score
, add the score
's local header block
, too
!
1153 ; Currently
, I only use the global header block
, stored in $defaultheader
1154 (scopes
(list $defaultheader
))
1155 (alists
(map ly
:module-
>alist scopes
))
1158 (map
(lambda
(alist
)
1159 (map
(lambda
(entry
)
1161 (string-
>symbol
(string-append
"header:" (symbol-
>string
(car entry
))))
1165 (props
(append prefixed-alist
1167 (layout-extract-page-properties layout
)))
1169 (interpret-markup layout props markup
)
1178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1180 %%%%% Equally spacing multiple columns (e.g. for translations)
1181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1184 % Credits: Nicolas Sceaux on the lilypond-user mailinglist
1185 #(define-markup-command
(columns layout props args
) (markup-list?
)
1186 (let
((line-width
(/ (chain-assoc-get
'line-width props
1187 (ly
:output-def-lookup layout
'line-width
))
1188 (max
(length args
) 1))))
1189 (interpret-markup layout props
1190 (make-line-markup
(map
(lambda
(line
)
1191 (markup
#:pad-to-box `
(0 . ,line-width
) '(0 . 0)
1192 #:override `
(line-width
. ,line-width
)
1200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1202 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1203 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1204 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1209 % line-width = 17\cm
1210 bottom-margin
= 1\cm
1212 % after-title-space = 0.5\cm
1216 ragged-last-bottom
= ##f
1221 % If only one non-empty staff in a system exists, still print the backet
1222 \override SystemStartBracket
#'collapse-height
= #1
1223 \consists "Instrument_name_engraver"
1227 % If only one non-empty staff in a system exists, still print the backet
1228 \override SystemStartBracket
#'collapse-height
= #1
1229 \consists "Instrument_name_engraver"
1233 \override SystemStartBracket
#'collapse-height
= #1
1234 \consists "Instrument_name_engraver"
1238 \override VerticalAxisGroup
#'keep-fixed-while-stretching
= ##t
1242 \override VerticalAxisGroup
#'keep-fixed-while-stretching
= ##t
1243 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(0 . 1)
1244 \override VerticalAxisGroup
#'padding
= #0
1248 % Force multi-measure rests to be written as one span
1249 \override MultiMeasureRest
#'expand-limit
= #3
1252 % hairpinToBarline = ##f
1253 \override BarNumber
#'break-visibility
= #end-of-line-invisible
1254 \override CombineTextScript
#'avoid-slur
= #'outside
1255 barNumberVisibility
= #(every-nth-bar-number-visible
5)
1256 \override DynamicTextSpanner
#'dash-period
= #-
1.0
1257 \override InstrumentSwitch
#'font-size
= #-
1
1260 \override RestCollision
#'positioning-done
= #merge-rests-on-positioning
1261 % Auto-Accidentals: Use modern-cautionary style...
1263 autoAccidentals
= #'(Staff
(same-octave
. 0))
1264 autoCautionaries
= #'(Staff
(any-octave
. 0) (same-octave
. 1))
1265 printKeyCancellation
= ##t
1268 \RemoveEmptyStaffContext
1272 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(0.5 . 0.5)
1280 \type "Engraver_group"
1282 % So that \cresc works, for example.
1284 \consists "Output_property_engraver"
1286 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(-
1 . 1)
1287 pedalSustainStrings
= #'("Ped." "*Ped." "*")
1288 pedalUnaCordaStrings
= #'("una corda" "" "tre corde")
1290 \consists "Piano_pedal_engraver"
1291 \consists "Script_engraver"
1292 \consists "Dynamic_engraver"
1293 \consists "Text_engraver"
1295 \override TextScript
#'font-size
= #2
1296 \override TextScript
#'font-shape
= #'italic
1297 \override DynamicText
#'extra-offset
= #'(0 . 2.5)
1298 \override Hairpin
#'extra-offset
= #'(0 . 2.5)
1300 \consists "Skip_event_swallow_translator"
1302 \consists "Axis_group_engraver"
1307 % \override VerticalAlignment #'forced-distance = #7