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: Dual-licensed under either:
12 % -) GPL v3.0, http://www.gnu.org/licenses/gpl.html
13 % -) Creative Commons BY-NC 3.0, http://creativecommons.org/licenses/by-nc/3.0/at/
16 % 0.01 (2008-03-02): Initial Version
17 % 0.02 (2008-03-06): Added basic MIDI support (*MidiInstrument and \setCreateMIDI)
18 % 0.03 (2008-07-xx): General staff/voice types, title pages, etc.
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21 #(use-modules (ice-9 match))
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 % Use relative include pathes!
29 #(ly:set-option 'relative-includes #t)
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 %%%%% SCORE STRUCTURE AND AUTOMATIC GENERATION
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 % Helper function to filter all non-null entries
46 #(define (not-null? x) (not (null? x)))
48 % Helper function to extract a given variable, built from [Piece][Instrument]Identifier
49 #(define (namedPieceInstrObject piece instr name)
51 (fullname (string->symbol (string-append piece instr name)))
52 (instrname (string->symbol (string-append instr name)))
53 (piecename (string->symbol (string-append piece name)))
54 (fallback (string->symbol name))
57 ((defined? fullname) (primitive-eval fullname))
58 ((defined? instrname) (primitive-eval instrname))
59 ((defined? piecename) (primitive-eval piecename))
60 ((defined? fallback) (primitive-eval fallback))
66 %% Print text as a justified paragraph, taken from the lilypond Notation Reference
67 #(define-markup-list-command (paragraph layout props args) (markup-list?)
68 (let ((indent (chain-assoc-get 'par-indent props 2)))
69 (interpret-markup-list layout props
70 (make-justified-lines-markup-list (cons (make-hspace-markup indent)
73 conditionalBreak = #(define-music-function (parser location) ()
74 #{ \tag #'instrumental-score \pageBreak #}
77 #(define (oly:piece-title-markup title) (markup #:column (#:line (#:fontsize #'3 #:bold title))) )
79 #(define-markup-command (piece-title layout props title) (markup?)
80 (interpret-markup layout props (oly:piece-title-markup title))
83 #(define (oly:generate_object_name piece instr obj )
84 (if (and (string? piece) (string? instr) (string? obj))
85 (string-append piece instr obj)
89 #(define (oly:generate_staff_name piece instr) (oly:generate_object_name piece instr "St"))
91 #(define (set-context-property context property value)
92 (set! (ly:music-property context property) value)
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
97 % Score structure and voice types
98 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100 #(define oly:LiedScoreStructure '(
101 ("SoloScore" "SimultaneousMusic" ("Singstimme"))
102 ("Pfe" "PianoStaff" ("PfeI" "PfeII"))
103 ;("PfeI" "ParallelVoicesStaff" ("OIa" "OIb"))
104 ;("PfeII" "ParallelVoicesStaff" ("OIIa" "OIIb"))
105 ("FullScore" "SimultaneousMusic" ("Singstimme" "Pfe"))
106 ("VocalScore" "SimultaneousMusic" ("Singstimme" "Pfe"))
109 #(define oly:fullOrchestraScoreStructure '(
110 ; Part-combined staves for full score
111 ("Fl" "PartCombinedStaff" ("FlI" "FlII"))
112 ("Ob" "PartCombinedStaff" ("ObI" "ObII"))
113 ("Cl" "PartCombinedStaff" ("ClI" "ClII"))
114 ("Fag" "PartCombinedStaff" ("FagI" "FagII"))
115 ("Wd" "StaffGroup" ("Fl" "Ob" "Cl" "Fag" "CFag"))
117 ("Cor" "PartCombinedStaff" ("CorI" "CorII"))
118 ("Tbe" "PartCombinedStaff" ("TbeI" "TbeII"))
119 ("Clni" "PartCombinedStaff" ("ClnoI" "ClnoII"))
120 ("Trb" "PartCombinedStaff" ("TrbI" "TrbII"))
121 ("Br" "StaffGroup" ("Cor" "Tbe" "Clni" "Trb" "Tba"))
123 ; long score; no part-combined staves, but GrandStaves instead
124 ("FlLong" "GrandStaff" ("FlI" "FlII"))
125 ("ObLong" "GrandStaff" ("ObI" "ObII"))
126 ("ClLong" "GrandStaff" ("ClI" "ClII"))
127 ("FagLong" "GrandStaff" ("FagI" "FagII"))
128 ("WdLong" "StaffGroup" ("FlLong" "ObLong" "ClLong" "FagLong" "CFag"))
130 ("CorLong" "GrandStaff" ("CorI" "CorII"))
131 ("TbeLong" "GrandStaff" ("TbeI" "TbeII"))
132 ("ClniLong" "GrandStaff" ("ClnoI" "ClnoII" "ClnoIII"))
133 ("TrbLong" "GrandStaff" ("TrbI" "TrbII" "TrbIII"))
134 ("BrLong" "StaffGroup" ("CorLong" "TbeLong" "ClniLong" "TrbLong" "Tba"))
137 ("Perc" "StaffGroup" ("Tim"))
139 ; Strings, they are the same in long and short full score
140 ("VV" "GrandStaff" ("VI" "VII"))
141 ("Str" "StaffGroup" ("VV" "Va"))
142 ("VceB" "StaffGroup" ("Vc" "Cb" "VcB"))
143 ("FullStr" "StaffGroup" ("VV" "Va" "Vc" "Cb" "VcB"))
146 ("Solo" "SimultaneousMusic" ("SSolo" "ASolo" "TSolo" "BSolo"))
147 ("Ch" "ChoirStaff" ("S" "A" "T" "B"))
148 ("ChoralScore" "SimultaneousMusic" ("Ch"))
149 ("SoloScore" "SimultaneousMusic" ("Solo"))
150 ("SoloChoirScore" "SimultaneousMusic" ("Solo" "Ch"))
152 ; Organ score (inkl. Figured bass)
153 ("BCFb" "FiguredBass" ())
154 ("FiguredBass" "FiguredBass" ())
155 ;("Organ" "SimultaneousMusic" ("BCFb" "O"))
156 ("Continuo" "ParallelVoicesStaff" ("BCFb" "BC" "FiguredBass"))
157 ("RealizedContinuo" "PianoStaff" ("BCRealization" "Continuo"))
159 ("P" "PianoStaff" ("PI" "PII"))
160 ("O" "PianoStaff" ("OI" "OII"))
161 ("OI" "ParallelVoicesStaff" ("OIa" "OIb"))
162 ("OII" "ParallelVoicesStaff" ("OIIa" "OIIb"))
164 ;("Organ" "SimultaneousMusic" ("OGroup" "RealizedContinuo"))
165 ;("BassGroup" "ParallelVoicesStaff" ("Organ" "O" "BC" "VceB"))
166 ("BassGroup" "StaffGroup" ("O" "RealizedContinuo" "Vc" "Cb" "VcB"))
169 ("FullScore" "SimultaneousMusic" ("Wd" "Br" "Perc" "Str" "SoloChoirScore" "BassGroup"))
170 ("LongScore" "SimultaneousMusic" ("WdLong" "BrLong" "Perc" "Str" "SoloChoirScore" "BassGroup"))
171 ("OriginalScore" "SimultaneousMusic" ("BrLong" "WdLong" "Perc" "Str" "SoloChoirScore" "BassGroup"))
174 ;("Piano" "SimultaneousMusic" ("Organ"))
175 ("OrganScore" "SimultaneousMusic" ("ChoralScore" "O"))
176 ("VocalScore" "SimultaneousMusic" ("ChoralScore" "P"))
177 ("Particell" "SimultaneousMusic" ("ChoralScore" "BassGroup"))
179 ; Full scores: Orchestral score and long score including organ
180 ("ChStrQ" "SimultaneousMusic" ("Str" "Ch" "VceB"))
182 #(define oly:orchestral_score_structure oly:fullOrchestraScoreStructure)
184 #(define (oly:set_score_structure struct)
186 (set! oly:orchestral_score_structure struct)
187 (ly:warning (_ "oly:set_score_structure needs an association list as argument!"))
191 #(define (oly:modify_score_structure entry)
193 (set! oly:orchestral_score_structure (assoc-set! oly:orchestral_score_structure (car entry) (cdr entry)))
194 (ly:warning (_ "oly:modify_score_structure expects a list (\"key\" \"type\" '(children)) as argument!"))))
196 #(define (oly:remove_from_score_structure entry)
198 (map oly:remove_from_score_structure entry)
199 (set! oly:orchestral_score_structure (assoc-remove! oly:orchestral_score_structure entry))))
201 orchestralScoreStructure = #(define-music-function (parser location structure) (list?)
202 (oly:set_score_structure structure)
203 (make-music 'Music 'void #t)
206 #(define oly:voice_types '())
208 #(define (oly:set_voice_types types)
210 (set! oly:voice_types types)
211 (ly:warning (_ "oly:set_voice_types needs an association list as argument!"))
215 orchestralVoiceTypes = #(define-music-function (parser location types) (list?)
216 (oly:set_voice_types types)
217 (make-music 'Music 'void #t)
221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
222 % Automatic staff and group generation
223 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
225 % Retrieve all music definitions for the given
226 #(define (oly:get_music_object piece instrument)
227 (namedPieceInstrObject piece instrument "Music")
229 #(define (oly:get_music_objects piece instruments)
230 (filter not-null? (map (lambda (i) (oly:get_music_object piece i)) instruments))
233 % Given a property name and the extensions, either generate the pair to set
234 % the property or an empty list, if no pre-defined variable could be found
235 #(define (oly:generate_property_pair prop piece instr type)
236 (let* ((val (namedPieceInstrObject piece instr type)))
237 (if (not-null? val) (list 'assign prop val) '() )
241 #(define (oly:staff_type type)
243 ((string? type) (string->symbol type))
244 ((symbol? type) type)
249 #(define (oly:extractPitch music)
251 (elems (if (ly:music? music) (ly:music-property music 'elements)))
252 (note (if (pair? elems) (car elems)))
253 (pitch (if (ly:music? note) (ly:music-property note 'pitch)))
255 (if (and (not-null? music) (not (ly:pitch? pitch)))
256 (ly:warning "Unable to interpret as a pitch!")
262 #(define (oly:extractTranspositionPitch piece name)
264 (trpFromPitch (oly:extractPitch (namedPieceInstrObject piece name "TransposeFrom")))
265 (trpToPitch (oly:extractPitch (namedPieceInstrObject piece name "TransposeTo")))
267 (if (ly:pitch? trpFromPitch)
268 (if (ly:pitch? trpToPitch)
270 (ly:pitch-diff trpFromPitch trpToPitch)
271 (ly:pitch-diff trpFromPitch (ly:make-pitch 0 0 0))
273 (if (ly:pitch? trpToPitch)
274 (ly:pitch-diff (ly:make-pitch 0 0 0) trpToPitch)
282 %%=====================================================================
283 %% Extract context modifications for given objects
284 %%---------------------------------------------------------------------
287 % TODO: join these property extractors to avoid code duplication
289 % Generate the properties for the lyrics for piece and instr.
290 % Also check whether we have a modifications object to fech mods from.
291 % return a (possibly empty) list of all assignments.
292 #(define (oly:lyrics_handler_properties piece name lyricsid)
294 (mods (namedPieceInstrObject piece name (string-append lyricsid "Modifications")))
295 (mod-list (if (not-null? mods) (ly:get-context-mods mods) '()))
297 ;(instrumentName . "InstrumentName")
298 ;(shortInstrumentName . "ShortInstrumentName")
299 ;(midiInstrument . "MidiInstrument")
303 (oly:generate_property_pair (car pr) piece name (cdr pr))
306 (olyprops (filter not-null? assignments))
307 (props (append mod-list olyprops))
313 % Generate the properties for the voice for piece and instr.
314 % Also check whether we have a modifications object to fech mods from.
315 % return a (possibly empty) list of all assignments.
316 #(define (oly:voice_handler_properties piece name)
318 (mods (namedPieceInstrObject piece name "VoiceModifications"))
319 (mod-list (if (not-null? mods) (ly:get-context-mods mods) '()))
321 ;(instrumentName . "InstrumentName")
322 ;(shortInstrumentName . "ShortInstrumentName")
323 ;(midiInstrument . "MidiInstrument")
327 (oly:generate_property_pair (car pr) piece name (cdr pr))
330 (olyprops (filter not-null? assignments))
331 (props (append mod-list olyprops))
337 % Generate the properties for the staff for piece and instr. Typically, these
338 % are the instrument name and the short instrument name (if defined).
339 % Also check whether we have a modifications object to fech mods from.
340 % return a (possibly empty) list of all assignments.
341 #(define (oly:staff_handler_properties piece instr)
343 (mods (namedPieceInstrObject piece instr "StaffModifications"))
344 (mod-list (if (not-null? mods) (ly:get-context-mods mods) '()))
346 (instrumentName . "InstrumentName")
347 (shortInstrumentName . "ShortInstrumentName")
348 (midiInstrument . "MidiInstrument")
352 (oly:generate_property_pair (car pr) piece instr (cdr pr))
355 (olyprops (filter not-null? assignments))
356 (props (append mod-list olyprops))
365 %%=====================================================================
366 %% Extract contents for voices
367 %%---------------------------------------------------------------------
369 #(define (oly:musiccontent_for_voice parser piece name music additional)
370 (let* ((musiccontent additional))
372 ; Append the settings, key and clef (if defined)
375 (let* ((object (namedPieceInstrObject piece name type)))
376 (if (ly:music? object)
377 (set! musiccontent (append musiccontent (list (ly:music-deep-copy object))))
378 (if (not-null? object) (ly:warning (_ "Wrong type (no ly:music) for ~S for instrument ~S in piece ~S") type name piece))
382 ; TODO: Does the "Tempo" work here???
383 '("Settings" "Key" "Clef" "TimeSignature" "ExtraSettings";"Tempo"
387 (if (ly:music? music)
389 (set! musiccontent (make-simultaneous-music (append musiccontent (list music))))
390 ;(ly:message "Generating staff for ~a" name)
391 (let* ((trpPitch (oly:extractTranspositionPitch piece name)))
392 (if (ly:pitch? trpPitch)
393 (set! musiccontent (ly:music-transpose musiccontent trpPitch))
398 ; For empty music, return empty
406 %%=====================================================================
408 %%---------------------------------------------------------------------
411 #(define (oly:lyrics_create_single_context parser piece name voicename lyricsid)
412 ; If we have lyrics, create a lyrics context containing LyricCombineMusic
413 ; and add that as second element to the staff's elements list...
414 ; Also add possibly configured LyricsModifications
415 (let* ((id (string-append "Lyrics" lyricsid))
416 (lyricsmods (oly:lyrics_handler_properties piece name id))
417 (lyrics (namedPieceInstrObject piece name id))
418 (ctx (if (ly:music? lyrics)
419 (context-spec-music (make-music 'LyricCombineMusic
421 'associated-context voicename)
423 (oly:generate_object_name piece name id))
425 (if (and (not-null? lyricsmods) (not-null? ctx))
426 (set! (ly:music-property ctx 'property-operations) lyricsmods)
432 #(define (oly:lyrics_create_contexts parser piece name voicename)
435 (oly:lyrics_create_single_context parser piece name voicename str))
436 (list "" "I" "II" "III" "IV" "V" "VI"))))
439 %%=====================================================================
441 %%---------------------------------------------------------------------
444 #(define (oly:voice_handler_internal parser piece name type music)
445 (if (ly:music? music)
447 (voicename (oly:generate_object_name piece name "Voice" ))
448 (lyrics (oly:lyrics_create_contexts parser piece name voicename))
449 (additional (if (not-null? lyrics) (list dynamicUp) '()))
450 (musiccontent (oly:musiccontent_for_voice parser piece name music additional))
451 (voicetype (oly:staff_type type))
452 (voice (context-spec-music musiccontent voicetype voicename))
453 (voiceprops (oly:voice_handler_properties piece name))
455 (if (not-null? voiceprops)
456 (set! (ly:music-property voice 'property-operations) voiceprops)
460 ; For empty music, return empty
465 #(define (oly:voice_handler parser piece name type)
466 (oly:voice_handler_internal parser piece name type (oly:get_music_object piece name)))
469 %%=====================================================================
470 %% Staff/Group handling
471 %%---------------------------------------------------------------------
474 #(define (oly:staff_handler_internal parser piece name type voices)
475 (if (not-null? voices)
477 (staffname (oly:generate_staff_name piece name))
478 (stafftype (oly:staff_type type))
479 (staff (make-simultaneous-music voices))
480 (propops (oly:staff_handler_properties piece name))
483 ((SimultaneousMusic ParallelMusic) #f)
484 (else (set! staff (context-spec-music staff stafftype staffname)))
486 (if (not-null? propops)
487 (set! (ly:music-property staff 'property-operations) propops)
491 ; For empty music, return empty
496 #(define (oly:staff_handler parser piece name type children)
497 (let* ((c (if (not-null? children) children (list name)))
498 (voices (apply append (map (lambda (v) (oly:create_voice parser piece v)) c)) )
500 (if (not-null? voices)
501 (oly:staff_handler_internal parser piece name type voices)
507 #(define (oly:devnull_handler parser piece name type children)
508 (oly:voice_handler parser piece name type)
511 #(define (oly:parallel_voices_staff_handler parser piece name type children)
513 (voices (map (lambda (i) (oly:create_voice parser piece i)) children))
514 ; get the list of non-empty voices and flatten it!
515 (nonemptyvoices (apply append (filter not-null? voices)))
517 (if (not-null? nonemptyvoices)
518 (oly:staff_handler_internal parser piece name "Staff" nonemptyvoices)
524 #(define (oly:remove-with-tag tag music)
525 (if (ly:music? music)
528 (let* ((tags (ly:music-property m 'tags))
529 (res (memq tag tags)))
534 % Remove all music tagged a not-part-combine
535 #(define (oly:remove-non-part-combine-events music)
536 (oly:remove-with-tag 'non-partcombine music))
538 #(define (oly:part_combined_staff_handler parser piece name type children)
539 (let* ((rawmusic (map (lambda (c) (oly:musiccontent_for_voice parser piece name (oly:get_music_object piece c) '())) children))
540 (filteredmusic (map (lambda (m) (oly:remove-non-part-combine-events m)) rawmusic))
541 (music (filter not-null? filteredmusic)))
543 ((and (pair? music) (ly:music? (car music)) (not-null? (cdr music)) (ly:music? (cadr music)))
544 ;(ly:message "Part-combine with two music expressions")
545 (oly:staff_handler_internal parser piece name "Staff" (list (make-part-combine-music parser music))))
547 ;;(ly:warning "Part-combine without any music expressions")
549 ; exactly one is a music expression, simply use that by joining
551 ;;(ly:message "Part-combine with only one music expressions")
552 (oly:staff_handler_internal parser piece name "Staff" (list (apply append music))))
554 ;(ly:message "make_part_combined_staff: ~S ~S ~a" piece instr instruments)
560 % Figured bass is a special case, as it can be voice- or staff-type. When
561 % given as a staff type, simply call the voice handler, instead
563 #(define (oly:figured_bass_staff_handler parser piece name type children)
564 (let* ((c (if (not-null? children) children (list name)))
565 (voice (oly:voice_handler parser piece (car c) type)))
566 (if (pair? voice) (car voice) ())
570 #(define (flatten lst)
571 (define (f remaining result)
573 ((null? remaining) result)
574 ((pair? (car remaining)) (f (cdr remaining) (f (car remaining) result)))
575 (else (f (cdr remaining) (cons (car remaining) result)))))
576 (reverse! (f lst '())))
578 #(define (oly:staff_group_handler parser piece name type children)
580 (staves (flatten (map (lambda (i) (oly:create_staff_or_group parser piece i)) children)))
581 (nonemptystaves (filter not-null? staves))
583 (if (not-null? nonemptystaves)
585 (musicexpr (if (= 1 (length nonemptystaves))
587 (make-simultaneous-music nonemptystaves)))
588 (groupname (oly:generate_staff_name piece name))
589 (grouptype (oly:staff_type type))
591 (propops (oly:staff_handler_properties piece name))
594 ((SimultaneousMusic ParallelMusic) #f)
595 (else (set! group (context-spec-music group grouptype groupname)))
598 (set! (ly:music-property group 'property-operations) propops))
601 ; Return empty list if no staves are generated
607 #(define (oly:create_voice parser piece name)
608 (let* ( (voice (namedPieceInstrObject piece name "Voice"))
609 (type (assoc-ref oly:voice_types name)) )
610 (if (not-null? voice)
611 ; Explicit voice variable, use that
615 ; No entry in structure found => simple voice
616 (oly:voice_handler parser piece name "Voice")
617 ; Entry found in structure => use the handler for the given type
619 (voicetype (car type))
620 (handler (assoc-ref oly:voice_handlers voicetype))
623 ((primitive-eval handler) parser piece name voicetype)
625 (ly:warning "No handler found for voice type ~a, using default voice handler" voicetype)
626 (oly:voice_handler parser piece name voicetype)
635 #(define (oly:create_staff_or_group parser piece name)
636 (let* ( (staff (namedPieceInstrObject piece name "Staff"))
637 (type_from_structure (assoc-ref oly:orchestral_score_structure name)) )
638 ;(if (not-null? staff)
639 ; (ly:message "Found staff variable for instrument ~a in piece ~a" instr piece)
640 ; (ly:message "Staff variable for instrument ~a in piece ~a NOT FOUND" instr piece)
642 (if (not-null? staff)
643 ; Explicit staff variable, use that
646 (if (not (list? type_from_structure))
647 ; No entry in structure found => simple staff
648 (oly:staff_handler parser piece name "Staff" '())
650 ; Entry found in structure => use the handler for the given type
651 (let* ((type (car type_from_structure))
652 (handler (assoc-ref oly:staff_handlers type))
653 (children (cadr type_from_structure))
656 ((primitive-eval handler) parser piece name type children)
658 (ly:warning "No handler found for staff type ~a, using default staff handler" type)
659 (oly:staff_handler parser piece name type children)
668 #(define (oly:dynamics_handler parser piece name type children)
669 (oly:voice_handler parser piece name type)
673 %%=====================================================================
674 %% Handler definitions
675 %%---------------------------------------------------------------------
677 #(define oly:staff_handlers
680 '("GrandStaff" . oly:staff_group_handler )
681 '("PianoStaff" . oly:staff_group_handler )
682 '("ChoirStaff" . oly:staff_group_handler )
683 '("StaffGroup" . oly:staff_group_handler )
684 '("ParallelMusic" . oly:staff_group_handler )
685 '("SimultaneousMusic" . oly:staff_group_handler )
687 '("Staff" . oly:staff_handler )
688 '("DrumStaff" . oly:staff_handler )
689 '("RhythmicStaff" . oly:staff_handler )
690 '("TabStaff" . oly:staff_handler )
691 '("GregorianTranscriptionStaff" . oly:staff_handler )
692 '("MensuralStaff" . oly:staff_handler )
693 '("VaticanaStaff" . oly:staff_handler )
694 ; staves with multiple voices
695 '("PartCombinedStaff" . oly:part_combined_staff_handler )
696 '("ParallelVoicesStaff" . oly:parallel_voices_staff_handler )
697 ; special cases: Figured bass can be staff or voice type!
698 '("FiguredBass" . oly:figured_bass_staff_handler )
699 ; Devnull is like a staff, only that it doesn't craete output
700 '("Devnull" . oly:devnull_handler )
701 '("Dynamics" . oly:dynamics_handler )
705 #(define oly:voice_handlers
708 '("Voice" . oly:voice_handler )
709 '("CueVoice" . oly:voice_handler )
710 '("DrumVoice" . oly:voice_handler )
711 '("FiguredBass" . oly:voice_handler )
712 '("GregorianTranscriptionVoice" . oly:voice_handler )
713 '("NoteNames" . oly:voice_handler )
714 '("TabVoice" . oly:voice_handler )
715 '("VaticanaVoice" . oly:voice_handler )
720 #(define (oly:register_staff_type_handler type func)
721 ; (ly:message "Registering staff handler ~a for type ~a" func type)
722 (set! oly:staff_handlers (assoc-set! oly:staff_handlers type func))
725 #(define (oly:register_voice_type_handler type func)
726 ; (ly:message "Registering voice type handler ~a for type ~a" func type)
727 (set! oly:voice_handlers (assoc-set! oly:voice_handlers type func))
730 % handlers for deprecated API
731 #(oly:register_staff_type_handler 'StaffGroup 'oly:staff_group_handler)
732 #(oly:register_staff_type_handler 'GrandStaff 'oly:staff_group_handler)
733 #(oly:register_staff_type_handler 'PianoStaff 'oly:staff_group_handler)
734 #(oly:register_staff_type_handler 'ChoirStaff 'oly:staff_group_handler)
735 #(oly:register_staff_type_handler 'Staff 'oly:staff_handler )
736 #(oly:register_staff_type_handler 'ParallelMusic 'oly:staff_group_handler)
737 #(oly:register_staff_type_handler 'SimultaneousMusic 'oly:staff_group_handler)
738 #(oly:register_staff_type_handler #t 'oly:part_combined_staff_handler )
739 #(oly:register_staff_type_handler #f 'oly:parallel_voices_staff_handler )
743 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
744 % Automatic score generation
745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
747 #(define oly:score_handler add-score)
748 #(define oly:music_handler add-music)
749 #(define oly:text_handler add-text)
753 setUseBook = #(define-music-function (parser location usebook) (boolean?)
754 (ly:warning "\\setUseBook has been deprecated! Books are now automatically handled without any hacks")
755 (make-music 'Music 'void #t)
759 % Two functions to handle midi-blocks: Either don't set one, or set an empty
760 % one so that MIDI is generated
761 #(define (oly:set_no_midi_block score) '())
762 #(define (oly:set_midi_block score)
763 (let* ((midiblock (if (defined? '$defaultmidi)
764 (ly:output-def-clone $defaultmidi)
765 (ly:make-output-def))))
766 (ly:output-def-set-variable! midiblock 'is-midi #t)
767 (ly:score-add-output-def! score midiblock)
771 % \setCreateMidi ##t/##f sets a flag to determine wheter MIDI output should
773 #(define oly:apply_score_midi oly:set_no_midi_block)
774 setCreateMIDI = #(define-music-function (parser location createmidi) (boolean?)
776 (set! oly:apply_score_midi oly:set_midi_block)
777 (set! oly:apply_score_midi oly:set_no_midi_block)
779 (make-music 'Music 'void #t)
783 % Two functions to handle layout-blocks: Either don't set one, or set an empty
784 % one so that a PDF is generated
785 #(define (oly:set_no_layout_block score) '())
786 #(define (oly:set_layout_block score)
787 (let* ((layoutblock (if (defined? '$defaultlayout)
788 (ly:output-def-clone $defaultlayout)
789 (ly:make-output-def))))
790 (ly:output-def-set-variable! layoutblock 'is-layout #t)
791 (ly:score-add-output-def! score layoutblock)
795 % \setCreatePDF ##t/##f sets a flag to determine wheter PDF output should
797 #(define oly:apply_score_layout oly:set_no_layout_block)
798 setCreatePDF = #(define-music-function (parser location createlayout) (boolean?)
800 (set! oly:apply_score_layout oly:set_layout_block)
801 (set! oly:apply_score_layout oly:set_no_layout_block)
803 (make-music 'Music 'void #t)
807 % Set the piece title in a new header block.
808 #(define (oly:set_piece_header score piecename)
809 (if (not-null? piecename)
810 (let* ((header (make-module)))
811 (module-define! header 'piece piecename)
812 (ly:score-set-header! score header)
818 % post-filter functions. By default, no filtering is done. However,
819 % for the *NoCues* function, the cue notes should be killed
820 keepcuefilter = #(define-music-function (parser location music) (ly:music?)
821 ((ly:music-function-extract removeWithTag) parser location 'non-cued music))
822 removecuefilter = #(define-music-function (parser location music) (ly:music?)
823 ((ly:music-function-extract removeWithTag) parser location 'cued ((ly:music-function-extract killCues) parser location music)))
826 #(define (oly:create-toc-file layout pages)
827 (let* ((label-table (ly:output-def-lookup layout 'label-page-table)))
828 (if (not (null? label-table))
829 (let* ((format-line (lambda (toc-item)
830 (let* ((label (car toc-item))
831 (text (caddr toc-item))
832 (label-page (and (list? label-table)
833 (assoc label label-table)))
834 (page (and label-page (cdr label-page))))
835 (format #f "~a, section, 1, {~a}, ~a" page text label))))
836 (formatted-toc-items (map format-line (toc-items)))
837 (whole-string (string-join formatted-toc-items ",\n"))
838 (output-name (ly:parser-output-name parser))
839 (outfilename (format "~a.toc" output-name))
840 (outfile (open-output-file outfilename)))
841 (if (output-port? outfile)
842 (display whole-string outfile)
843 (ly:warning (_ "Unable to open output file ~a for the TOC information") outfilename))
844 (close-output-port outfile)))))
847 #(define-public (oly:add-toc-item parser markup-symbol text)
848 (oly:music_handler parser (add-toc-item! markup-symbol text)))
851 #(define (oly:add-score parser score piecename)
852 (if (not-null? piecename)
853 (oly:add-toc-item parser 'tocItemMarkup piecename))
854 (oly:score_handler parser score)
856 % The helper function to build a score.
857 #(define (oly:createScoreHelper parser location piece children func)
859 (staves (oly:staff_group_handler parser piece "" "SimultaneousMusic" children))
860 (music (if (not-null? staves)
861 ((ly:music-function-extract func) parser location staves)
865 (piecename (namedPieceInstrObject piece (car children) "PieceName"))
866 (piecenametacet (namedPieceInstrObject piece (car children) "PieceNameTacet"))
870 ; No staves, print tacet
872 (if (not-null? piecenametacet) (set! piecename piecenametacet))
873 (if (not-null? piecename)
874 (oly:add-score parser (list (oly:piece-title-markup piecename)) piecename)
875 (ly:warning (_ "No music and no score title found for part ~a and instrument ~a") piece children)
878 ; we have staves, apply the piecename to the score and add layout/midi blocks if needed
880 (set! score (scorify-music music parser))
881 (oly:set_piece_header score piecename)
882 (oly:apply_score_midi score)
883 (oly:apply_score_layout score)
884 ; Schedule the score for typesetting
885 (oly:add-score parser score piecename)
889 ; This is a void function, the score has been schedulled for typesetting already
890 (make-music 'Music 'void #t)
893 createScore = #(define-music-function (parser location piece children) (string? list?)
894 (oly:createScoreHelper parser location piece children keepcuefilter)
896 createNoCuesScore = #(define-music-function (parser location piece children) (string? list?)
897 (oly:createScoreHelper parser location piece children removecuefilter)
900 createHeadline = #(define-music-function (parser location headline) (string?)
901 (oly:add-toc-item parser 'tocItemMarkup headline)
902 (oly:score_handler parser (list (oly:piece-title-markup headline)))
903 (make-music 'Music 'void #t)
908 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
909 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
912 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
914 newInstrument = #(define-music-function (parser location instr) (string?)
916 \set Voice.instrumentCueName = #$(string-join (list "+" instr))
919 cueText = #(define-music-function (parser location instr) (string?)
921 \set Voice.instrumentCueName = $instr
925 clearCueText = #(define-music-function (parser location) ()
927 \unset Voice.instrumentCueName
931 insertCueText = #(define-music-function (parser location instr) (string?)
932 (if (string-null? instr)
933 #{ \tag #'cued \clearCueText #}
934 #{ \tag #'cued \cueText #$instr #}
937 % generate a cue music section with instrument names
938 % Parameters: \namedCueDuring NameOfQuote CueDirection CueInstrument OriginalInstrument music
939 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
940 % -) CueInstrument and OriginalInstrument are the displayed instrument names
942 % \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 }
943 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
944 % the beginning of the cue notes and "Sop." at the end
945 namedCueDuring = #(define-music-function (parser location cuevoice direction instrcue instr cuemusic) (string? number? string? string? ly:music?)
947 \cueDuring #$cuevoice #$direction {
948 \insertCueText #$instrcue
950 \insertCueText #$instr
954 namedTransposedCueDuring = #(define-music-function (parser location cuevoice direction instrcue instr trans cuemusic) (string? number? string? string? ly:music? ly:music?)
956 \transposedCueDuring #$cuevoice #$direction $trans {
957 \insertCueText #$instrcue
959 \insertCueText #$instr
964 % set the cue instrument name and clef
965 setClefCue = #(define-music-function (parser location instr clef)
968 \once \override Staff.Clef #'font-size = #-3 $clef
969 \insertCueText $instr
972 % generate a cue music section with instrument names and clef changes
973 % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music
974 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
975 % -) CueInstrument and OriginalInstrument are the displayed instrument names
976 % -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containing voice
978 % \cleffedCueDuring #"vIQuote" #UP #"V.I" #"treble" #"Basso" #"bass" { R1*3 }
979 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
980 % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble at the
981 % beginning of the cue notes and reset to bass at the end
982 cleffedCueDuring = #(define-music-function (parser location cuevoice direction instrcue clefcue instr clefinstr cuemusic)
983 (string? number? string? ly:music? string? ly:music? ly:music?)
985 \cueDuring #$cuevoice #$direction {
986 \tag #'cued \setClefCue #$instrcue $clefcue
988 \tag #'cued \setClefCue #$instr $clefinstr
996 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
997 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
999 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1000 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1003 dynamicsX = #(define-music-function (parser location offset) (number?)
1005 \once \override DynamicText #'X-offset = $offset
1006 \once \override DynamicLineSpanner #'Y-offset = #0
1009 % Move the dynamic sign inside the staff to a fixed staff-relative position
1010 % posY (where 0 means vertically starts at the middle staff line)
1011 dynamicsAllInside = #(define-music-function (parser location offsetX posY)
1014 % Invalid y-extent -> hidden from skyline calculation and collisions
1015 % \once \override DynamicLineSpanner #'Y-extent = #(cons +0 -0.01)
1016 \once \override DynamicLineSpanner #'Y-extent = $(lambda (grob)
1017 (let* ((ext (ly:axis-group-interface::height grob))
1018 (dir (ly:grob-property grob 'direction)))
1020 (cons (- (cdr ext) 0.1) (cdr ext))
1021 (cons (car ext) (+ (car ext) 0.1)))))
1022 % move by X offset and to fixed Y-position (use Y-offset of parent!)
1023 \once \override DynamicText #'X-offset = $offsetX
1024 \once \override DynamicText #'Y-offset =
1026 (let* ((head (ly:grob-parent grob Y))
1027 (offset (ly:grob-property head 'Y-offset)))
1028 (- posY offset (- 0.6))))
1029 \once \override DynamicLineSpanner #'Y-offset = $posY
1032 dynamicsUpInside = #(define-music-function (parser location offsetX) (number?)
1033 ((ly:music-function-extract dynamicsAllInside) parser location offsetX 1.5)
1036 dynamicsDownInside = #(define-music-function (parser location offsetX) (number?)
1037 ((ly:music-function-extract dynamicsAllInside) parser location offsetX -3.5)
1040 hairpinOffset = #(define-music-function (parser location posY) (number?)
1042 \once \override DynamicLineSpanner #'Y-offset = $posY
1043 \once \override DynamicLineSpanner #'Y-extent = #(cons +0 -0.01)
1046 #(define ((line-break-offset before after) grob)
1047 (let* ((orig (ly:grob-original grob))
1048 ; All siblings if line-broken:
1049 (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )))
1050 (if (>= (length siblings) 2)
1051 ; We have been line-broken
1052 (if (eq? (car (last-pair siblings)) grob)
1054 (ly:grob-set-property! grob 'Y-offset after)
1055 ; Others get the before value:
1056 (ly:grob-set-property! grob 'Y-offset before)
1062 ffz = #(make-dynamic-script "ffz")
1063 pf = #(make-dynamic-script "pf")
1064 sempp = #(make-dynamic-script (markup #:line( #:with-dimensions '(0 . 0)
1065 '(0 . 0) #:right-align #:normal-text #:italic "sempre" #:dynamic "pp")))
1066 parenf = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "f" #:normal-text #:italic #:fontsize 2 ")")))
1067 parenp = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "p" #:normal-text #:italic #:fontsize 2 ")")))
1068 pdolce = #(make-dynamic-script (markup #:line(#:dynamic "p" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "dolce")))
1069 dolce = #(make-dynamic-script (markup #:line(#:normal-text #:italic "dolce")))
1070 sfpdolce = #(make-dynamic-script (markup #:line(#:dynamic "sfp" #:with-dimensions '(0 . 0) '(0 . 0) #:normal-text #:italic "dolce" )))
1071 bracketf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "f" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
1072 bracketmf = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 3 "[" #:dynamic "mf" #:hspace 0.1 #:normal-text #:fontsize 3 "]"))))
1073 bracketmp = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 2 "[" #:hspace 0.2 #:dynamic "mp" #:normal-text #:fontsize 2 "]"))))
1074 bracketp = #(make-dynamic-script (markup #:line(#:concat(#:normal-text #:fontsize 2 "[" #:hspace 0.2 #:dynamic "p" #:normal-text #:fontsize 2 "]"))))
1076 whiteoutp = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "p"))
1077 whiteoutf = #(make-dynamic-script (markup #:whiteout #:pad-markup 0.5 #:dynamic "f"))
1080 % cresc = #(make-music 'CrescendoEvent 'span-direction START 'crescendoSpanner 'text 'crescendoText "cresc.")
1081 % endcresc = #(make-span-event 'CrescendoEvent STOP)
1082 % dim = #(make-music 'DecrescendoEvent 'span-direction START 'decrescendoSpanner 'text 'decrescendoText "dim.")
1083 % enddim = #(make-span-event 'DecrescendoEvent STOP)
1084 % decresc = #(make-music 'DecrescendoEvent 'span-direction START 'decrescendoSpanner 'text 'decrescendoText "decresc.")
1085 % enddecresc = #(make-span-event 'DecrescendoEvent STOP)
1090 cresc = #(make-music 'CrescendoEvent 'span-direction START
1091 'span-type 'text 'span-text "cresc.")
1092 dim = #(make-music 'DecrescendoEvent 'span-direction START
1093 'span-type 'text 'span-text "dim.")
1094 decresc = #(make-music 'DecrescendoEvent 'span-direction START
1095 'span-type 'text 'span-text "decresc.")
1097 % newOrOldClef = #(define-music-function (parser location new old ) (string? string?)
1098 % (if (ly:get-option 'old-clefs) #{ \clef $old #} #{ \clef $new #})
1103 %%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
1104 % to remove also the fermata from R1-\fermataMarkup: By filtering the music
1105 % and removing the corresponding events.
1106 % Documented as an LSR snippet: http://lsr.dsi.unimi.it/LSR/Item?id=372
1107 #(define (filterOneEventsMarkup event)
1108 ( let ( (eventname (ly:music-property event 'name)) )
1110 (or ;; add here event name you do NOT want
1111 (eq? eventname 'MultiMeasureTextEvent)
1112 (eq? eventname 'AbsoluteDynamicEvent)
1113 (eq? eventname 'TextScriptEvent)
1114 (eq? eventname 'ArticulationEvent)
1115 (eq? eventname 'CrescendoEvent)
1116 (eq? eventname 'DecrescendoEvent)
1121 filterArticulations = #(define-music-function (parser location music) (ly:music?)
1122 (music-filter filterOneEventsMarkup music)
1129 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1131 %%%%% Tempo markings
1132 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1133 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1137 rit = \markup {\italic "rit."}
1138 pocorit = \markup {\italic "poco rit."}
1139 ppmosso = \markup {\italic "poco più mosso"}
1140 pizz = \markup {\italic "pizz."}
1141 arco = \markup {\italic "arco"}
1142 perd = \markup {\italic "perdend."}
1147 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1149 %%%%% REST COMBINATION
1150 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1151 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1155 %% REST COMBINING, TAKEN FROM http://lsr.dsi.unimi.it/LSR/Item?id=336
1158 %% \new Staff \with {
1159 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
1160 %% } << \somevoice \\ \othervoice >>
1165 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
1170 %% - only handles two voices
1171 %% - does not handle multi-measure/whole-measure rests
1173 #(define (rest-score r)
1175 (yoff (ly:grob-property-data r 'Y-offset))
1176 (sp (ly:grob-property-data r 'staff-position)))
1178 (set! score (+ score 2))
1179 (if (eq? yoff 'calculation-in-progress)
1180 (set! score (- score 3))))
1183 (set! score (+ score 2))
1184 (set! score (- score (abs (- 1 sp)))))
1187 #(define (merge-rests-on-positioning grob)
1188 (let* ((can-merge #f)
1189 (elts (ly:grob-object grob 'elements))
1190 (num-elts (and (ly:grob-array? elts)
1191 (ly:grob-array-length elts)))
1192 (two-voice? (= num-elts 2)))
1194 (let* ((v1-grob (ly:grob-array-ref elts 0))
1195 (v2-grob (ly:grob-array-ref elts 1))
1196 (v1-rest (ly:grob-object v1-grob 'rest))
1197 (v2-rest (ly:grob-object v2-grob 'rest)))
1201 (let* ((v1-duration-log (ly:grob-property v1-rest 'duration-log))
1202 (v2-duration-log (ly:grob-property v2-rest 'duration-log))
1203 (v1-dot (ly:grob-object v1-rest 'dot))
1204 (v2-dot (ly:grob-object v2-rest 'dot))
1205 (v1-dot-count (and (ly:grob? v1-dot)
1206 (ly:grob-property v1-dot 'dot-count -1)))
1207 (v2-dot-count (and (ly:grob? v2-dot)
1208 (ly:grob-property v2-dot 'dot-count -1))))
1211 (number? v1-duration-log)
1212 (number? v2-duration-log)
1213 (= v1-duration-log v2-duration-log)
1214 (eq? v1-dot-count v2-dot-count)))
1216 ;; keep the rest that looks best:
1217 (let* ((keep-v1? (>= (rest-score v1-rest)
1218 (rest-score v2-rest)))
1219 (rest-to-keep (if keep-v1? v1-rest v2-rest))
1220 (dot-to-kill (if keep-v1? v2-dot v1-dot)))
1221 ;; uncomment if you're curious of which rest was chosen:
1222 ;;(ly:grob-set-property! v1-rest 'color green)
1223 ;;(ly:grob-set-property! v2-rest 'color blue)
1224 (ly:grob-suicide! (if keep-v1? v2-rest v1-rest))
1225 (if (ly:grob? dot-to-kill)
1226 (ly:grob-suicide! dot-to-kill))
1227 (ly:grob-set-property! rest-to-keep 'direction 0)
1228 (ly:rest::y-offset-callback rest-to-keep)))))))
1231 (ly:rest-collision::calc-positioning-done grob))))
1237 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1238 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1239 %%%%% TABLE OF CONTENTS
1240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1241 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1244 contentsTitle = "Inhalt / Contents"
1247 tocTitleMarkup = \markup \fill-line{
1250 \override #(cons 'line-width (* 7 cm))
1251 \line{ \fill-line {\piece-title {\contentsTitle} \null }}
1256 tocItemMarkup = \markup \fill-line {
1259 \override #(cons 'line-width (* 7 cm ))
1260 \line { \fill-line{\fromproperty #'toc:text \fromproperty #'toc:page }}
1267 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1268 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1269 %%%%% TITLE PAGE / HEADER
1270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1271 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1273 #(define-markup-command (when-property layout props symbol markp) (symbol? markup?)
1274 (if (chain-assoc-get symbol props)
1275 (interpret-markup layout props markp)
1276 (ly:make-stencil '() '(1 . -1) '(1 . -1))))
1278 #(define-markup-command (vspace layout props amount) (number?)
1279 "This produces a invisible object taking vertical space."
1280 (let ((amount (* amount 3.0)))
1282 (ly:make-stencil "" (cons -1 1) (cons 0 amount))
1283 (ly:make-stencil "" (cons -1 1) (cons amount amount)))))
1287 titlePageMarkup = \markup \abs-fontsize #10 \when-property #'header:title \column {
1289 \fill-line { \fontsize #8 \fromproperty #'header:composer }
1291 \fill-line { \fontsize #8 \fromproperty #'header:poet }
1293 \fill-line { \fontsize #10 \bold \fromproperty #'header:titlepagetitle }
1295 \fontsize #2 \when-property #'header:titlepagesubtitle {
1296 \fill-line { \fromproperty #'header:titlepagesubtitle }
1299 \fill-line { \postscript #"-20 0 moveto 40 0 rlineto stroke" }
1301 \fill-line { \fontsize #5 \fromproperty #'header:ensemble }
1303 \fill-line { \fontsize #2 \fromproperty #'header:instruments }
1305 \fill-line { \fontsize #5 \fromproperty #'header:date }
1307 \fill-line { \fontsize #5 \fromproperty #'header:scoretype }
1308 \when-property #'header:instrument {
1309 \fill-line { \bold \fontsize #6 \rounded-box \fromproperty #'header:instrument }
1312 \fontsize #2 \when-property #'header:enteredby {
1313 \fill-line { "Herausgegeben von: / Edited by:"}
1315 \fill-line { \fromproperty #'header:enteredby }
1318 \when-property #'header:arrangement \column {
1320 \fill-line { \fontsize #3 \fromproperty #'header:arrangement }
1324 \fill-line { \fromproperty #'header:copyright }
1327 titleHeaderMarkup = \markup {
1328 \override #'(baseline-skip . 3.5)
1331 \fromproperty #'header:logo
1333 \huge \larger \bold \larger \fromproperty #'header:title
1334 \large \smaller \bold \larger \fromproperty #'header:subtitle
1335 \smaller \bold \fromproperty #'header:subsubtitle
1337 \bold \when-property #'header:instrument \rounded-box \fromproperty #'header:instrument
1340 \with-dimensions #'( 0 . 0) #'( 0 . 1 ) \null
1344 % { \large \bold \fromproperty #'header:instrument }
1347 \fromproperty #'header:poet
1348 \fromproperty #'header:composer
1351 \fromproperty #'header:meter
1352 \fromproperty #'header:arranger
1357 titleScoreMarkup = \markup \piece-title \fromproperty #'header:piece
1360 scoreTitleMarkup = \titleScoreMarkup
1361 bookTitleMarkup = \titleHeaderMarkup
1366 %%%%%%%%%%%%%% headers and footers %%%%%%%%%%%%%%%%%%%%%%%%%%
1368 #(define (first-score-page layout props arg)
1369 (let* ((label 'first-score-page)
1370 (table (ly:output-def-lookup layout 'label-page-table))
1371 (label-page (and (list? table) (assoc label table)))
1372 (page-number (and label-page (cdr label-page)))
1374 (if (eq? (chain-assoc-get 'page:page-number props -1) page-number)
1375 (interpret-markup layout props arg)
1378 #(define no-header-table '())
1379 thisPageNoHeader = #(define-music-function (parser location) ()
1380 (let* ((label (gensym "header")))
1381 (set! no-header-table (cons label no-header-table))
1384 'page-label label)))
1387 % TODO: Use the no-header-table!
1388 #(define (is-header-page layout props arg)
1389 (let* ((page-number (chain-assoc-get 'page:page-number props -1))
1391 ;(if (and (> page-number 2) (!= page-number 7))
1392 (if (> page-number 1)
1393 (interpret-markup layout props arg)
1396 #(define no-footer-table '())
1397 thisPageNoFooter = #(define-music-function (parser location) ()
1398 (let* ((label (gensym "footer")))
1399 (set! no-footer-table (cons label no-footer-table))
1402 'page-label label)))
1404 % TODO: Use the no-footer-table!
1405 #(define (is-footer-page layout props arg)
1406 (let* ((page-number (chain-assoc-get 'page:page-number props -1))
1407 (label 'first-score-page)
1408 (table (ly:output-def-lookup layout 'label-page-table))
1409 (label-page (and (list? table) (assoc label table)))
1410 ;(page-number (and label-page (cdr label-page)))
1412 (if (and (> page-number 1))
1413 (interpret-markup layout props arg)
1417 #(define copyright-footer-table '())
1418 thisPageCopyrightFooter = #(define-music-function (parser location) ()
1419 (let* ((label (gensym "copyrightfooter")))
1420 (set! copyright-footer-table (cons label copyright-footer-table))
1423 'page-label label)))
1425 #(define copyright-pg 1)
1426 #(define (set-copyright-page page)
1427 (set! copyright-pg page)
1430 % TODO: Use the copyright-footer-table!
1431 #(define (copyright-page layout props arg)
1432 (if (= (chain-assoc-get 'page:page-number props -1) copyright-pg)
1433 (interpret-markup layout props arg)
1438 oddHeaderMarkup = \markup \fill-line {
1439 %% force the header to take some space, otherwise the
1440 %% page layout becomes a complete mess.
1442 \on-the-fly #is-header-page \fromproperty #'header:title
1443 \on-the-fly #is-header-page \fromproperty #'page:page-number-string
1445 evenHeaderMarkup = \markup \fill-line {
1446 \on-the-fly #is-header-page \fromproperty #'page:page-number-string
1447 \on-the-fly #is-header-page \fromproperty #'header:composer
1451 oddFooterMarkup = \markup {
1454 %% publisher header field only on title page.
1455 \on-the-fly #first-page \fromproperty #'header:publisher
1458 %% copyright on the first real score page
1459 \on-the-fly #copyright-page \fromproperty #'header:copyright
1460 \on-the-fly #copyright-page \null
1463 %% All other pages get the number of the edition centered
1464 \on-the-fly #is-footer-page \fromproperty #'header:scorenumber
1481 % Interpret the given markup with the header fields added to the props.
1482 % This way, one can re-use the same functions (using fromproperty
1483 % #'header:field) in the header block and as top-level markup.
1485 % This function is originally copied from mark-up-title (file scm/titling.scm),
1486 % which is lilypond's internal function to handle the title markups. I needed
1487 % to replace the scopes and manually add the $defaultheader (which is internally
1488 % done in paper-book.cc before calling mark-up-title. Also, I don't extract the
1489 % markup from the header block, but use the given markup.
1491 % I'm not sure if I really need the page properties in props, too... But I
1492 % suppose it does not hurt, either.
1493 #(define-markup-command (markupWithHeader layout props markup) (markup?)
1494 "Interpret the given markup with the header fields added to the props.
1495 This way, one can re-use the same functions (using fromproperty
1496 #'header:field) in the header block and as top-level markup."
1498 ; TODO: If we are inside a score, add the score's local header block, too!
1499 ; Currently, I only use the global header block, stored in $defaultheader
1500 (scopes (list $defaultheader))
1501 (alists (map ly:module->alist scopes))
1504 (map (lambda (alist)
1505 (map (lambda (entry)
1507 (string->symbol (string-append "header:" (symbol->string (car entry))))
1511 (props (append prefixed-alist
1513 (layout-extract-page-properties layout)))
1515 (interpret-markup layout props markup)
1524 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1525 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1526 %%%%% Equally spacing multiple columns (e.g. for translations)
1527 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1528 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1530 % Credits: Nicolas Sceaux on the lilypond-user mailinglist
1531 #(define-markup-command (columns layout props args) (markup-list?)
1532 (let ((line-width (/ (chain-assoc-get 'line-width props
1533 (ly:output-def-lookup layout 'line-width))
1534 (max (length args) 1))))
1535 (interpret-markup layout props
1536 (make-line-markup (map (lambda (line)
1537 (markup #:pad-to-box `(0 . ,line-width) '(0 . 0)
1538 #:override `(line-width . ,line-width)
1544 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1545 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1546 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1547 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1548 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1551 startSlashedGraceMusic = {
1552 \override Stem #'stroke-style = #"grace"
1555 stopSlashedGraceMusic = {
1556 \revert Stem #'stroke-style
1560 #(def-grace-function startSlashedGraceMusic stopSlashedGraceMusic
1561 (_i "Create slashed graces (slashes through stems, but no slur)from the following music expression"))
1564 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1565 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1566 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1567 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1568 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1572 right-margin = 1.5\cm
1573 line-width = 17.5\cm
1574 % bottom-margin = 1.5\cm
1576 % after-title-space = 0.5\cm
1580 ragged-last-bottom = ##f
1585 % If only one non-empty staff in a system exists, still print the backet
1586 \override SystemStartBracket #'collapse-height = #1
1587 \consists "Instrument_name_engraver"
1591 % If only one non-empty staff in a system exists, still print the backet
1592 \override SystemStartBracket #'collapse-height = #1
1593 \consists "Instrument_name_engraver"
1597 \override SystemStartBracket #'collapse-height = #1
1598 \consists "Instrument_name_engraver"
1602 % \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t
1603 % \override VerticalAxisGroup #'minimum-Y-extent = #'(0 . 1) % TODO: Removed
1604 \override VerticalAxisGroup #'padding = #0
1608 % Force multi-measure rests to be written as one span
1609 \override MultiMeasureRest #'expand-limit = #3
1612 % \override Hairpin #'to-barline = ##f
1613 % \override BarNumber #'break-visibility = #end-of-line-invisible
1614 % \override BarNumber #'self-alignment-X = #0
1615 % barNumberVisibility = #(every-nth-bar-number-visible 5)
1616 \override CombineTextScript #'avoid-slur = #'outside
1617 \override DynamicTextSpanner #'dash-period = #-1.0
1618 \override InstrumentSwitch #'font-size = #-1
1621 \override RestCollision #'positioning-done = #merge-rests-on-positioning
1622 % Auto-Accidentals: Use modern-cautionary style...
1624 % Accidental rules (the rule giving the most accidentals wins!)
1625 % -) Reset accidentals at each barline -> accs not in key sig will always be printed
1626 % -) Same octave accidentals are remembered for two measures -> cancellation
1627 % -) other octave accidentals are remembered for next measure -> cancellation
1628 autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0)
1629 ,(make-accidental-rule 'any-octave 0)
1630 ,(make-accidental-rule 'any-octave 1)
1631 ,(make-accidental-rule 'same-octave 2))
1632 % No auto-cautionaries, we always use autoAccidentals!
1633 % autoCautionaries = #`(Staff ,(make-accidental-rule 'any-octave 0)
1634 % ,(make-accidental-rule 'same-octave 1))
1635 printKeyCancellation = ##t
1636 quotedEventTypes = #'(StreamEvent)
1637 quotedCueEventTypes = #'(
1651 implicitBassFigures = #'(0 100)
1660 ts = ^\markup{"t.s."}
1661 tt = ^\markup{"Tutti"}
1662 solo = ^\markup{"Solo"}
1663 tutti = ^\markup{"Tutti"}
1664 bracketts = ^\markup{"[Solo]"}
1665 brackettt = ^\markup{"[Tutti]"}
1666 bracketsolo = ^\markup{"[Solo]"}
1668 sottovoce = \markup "sotto voce"
1670 dashedSlur = -\tweak #'dash-definition #'((0 1 0.4 0.75))(
1671 dashedTie = -\tweak #'dash-definition #'((0 1 0.4 0.75))~
1673 divisi = #(define-music-function (parser location vc1 vc2) (ly:music? ly:music?)
1675 << { \voiceOne $vc1 \oneVoice} \context Voice = "divisi2" { \voiceTwo $vc2 } >>
1679 #(define twoVoice divisi)
1681 #(define-public (bracket-stencils grob)
1682 (let ((lp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "[")))
1683 (rp (grob-interpret-markup grob (markup #:fontsize 3.5 #:translate (cons -0.3 -0.5) "]"))))
1686 bracketify = #(define-music-function (parser loc arg) (ly:music?)
1687 (_i "Tag @var{arg} to be parenthesized.")
1689 \once \override ParenthesesItem #'stencils = #bracket-stencils
1695 #(define-markup-command (hat layout props arg) (markup?)
1696 "Draw a hat above the given string @var{arg}."
1697 (interpret-markup layout props (markup #:combine #:raise 1.5 "^" arg)))
1702 #(let ((m (make-music 'ArticulationEvent
1703 'articulation-type "flageolet")))
1704 (ly:music-set-property! m 'tweaks
1705 (acons 'font-size -2
1706 (ly:music-property m 'tweaks)))
1710 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1711 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1716 LicenseCCBYPlain = \markup {Creative Commons BY \with-url #"http://creativecommons.org/licenses/by/3.0/at/" {\translate #'(0 . -0.7) \epsfile #Y #3 #"orchestrallily/cc-by.eps" }}
1717 LicenseCCBY = \markup {Lizensiert unter / Licensed under: Creative Commons BY \with-url #"http://creativecommons.org/licenses/by/3.0/at/" {\translate #'(0 . -0.7) \epsfile #Y #3 #"orchestrallily/cc-by.eps" }}
1718 LicenseCCBYNC = \markup {Lizensiert unter / Licensed under: Creative Commons BY-NC \with-url #"http://creativecommons.org/licenses/by-nc/3.0/at/" {\translate #'(0 . -0.7) \epsfile #Y #3 #"orchestrallily/cc-by-nc.eps" }}
1719 LicenseNoRestrictions = \markup{\line {Die Ausgabe darf kopiert und ohne Einschränkungen aufgeführt werden. / May be copied and performed without restriction.}}
1721 \include "sceaux_clef-key.ily"
1724 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1725 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1727 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1728 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1730 startUnremovableSection = \set Staff.keepAliveInterfaces =
1731 #'(rhythmic-grob-interface
1734 percent-repeat-item-interface
1735 percent-repeat-interface
1736 stanza-number-interface)
1738 endUnremovableSection = \unset Staff.keepAliveInterfaces
1741 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1742 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1743 %%%%% EDITORIAL ANNOTATIONS
1744 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1745 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1747 #(define-public (editorial-bracket-stencil stil padding widen)
1748 "Add brackets for editorial annoations around STIL, producing a new stencil."
1750 (other-axis (lambda (a) (remainder (+ a 1) 2)))
1751 (ext (interval-widen (ly:stencil-extent stil axis) widen))
1754 (lb (ly:bracket axis ext thick protrusion))
1755 (rb (ly:bracket axis ext thick (- protrusion))))
1756 (set! stil (ly:stencil-combine-at-edge stil (other-axis axis) 1 rb padding))
1758 (ly:stencil-combine-at-edge lb (other-axis axis) 1 stil padding))
1761 editorialHairpin = \once \override Hairpin #'stencil = #(lambda (grob) (editorial-bracket-stencil (ly:hairpin::print grob) 0.2 0.55))
1762 editorialDynamic = \once \override DynamicText #'stencil = #(lambda (grob) (editorial-bracket-stencil (ly:text-interface::print grob) 0.2 0.55))
1763 editorialMarkup = \once \override TextScript #'stencil = #(lambda (grob) (editorial-bracket-stencil (ly:text-interface::print grob) 0.2 0.55))
1765 % videStart = \mark \markup { \hspace #1 \musicglyph #"scripts.coda" \with-dimensions #'(0 . 0) #'(0 . 0) \left-align { vi-} }
1766 videStart = \mark \markup \halign #-2.3 \concat { \hspace #4.5 \musicglyph #"scripts.coda" \left-align { vi- } }
1767 % videEnd = \notemode {
1768 % \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
1769 % \mark \markup \concat{ \with-dimensions #'(0 . 0) #'(0 . 0) \right-align { -de } \hspace #1 \musicglyph #"scripts.coda" }
1771 videEnd = \notemode {
1772 \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
1773 \mark \markup \concat{ \right-align { -de } \hspace #1.5 \musicglyph #"scripts.coda" \hspace #4.2 }
1787 % after-title-spacing = #'((space . 2) (padding . 2) (stretchability . 5))
1788 % between-system-spacing = #'((space . 0) (padding . 2) (stretchability . 35))
1789 % bottom-system-spacing = #'((space . 10) (padding . 2) (stretchability . 5))
1790 markup-system-spacing = #'((space . 4) (padding . 2) (stretchability . 20))
1791 % system-system-spacing = #'((space . 0) (padding . 20) (stretchability . 50))
1792 system-system-spacing = #'((space . 0) (padding . 2) (stretchability . 50))
1793 top-system-spacing = #'((space . 5) (padding . 2) (stretchability . 20))
1794 last-bottom-spacing = #'((space . 5) (padding . 2) (stretchability . 20))
1795 % system-markup-spacing = #'((space . 5) (padding . 2) (stretchability . 35))
1798 \context { \StaffGroup
1799 \override StaffGrouper #'between-staff-spacing #'space = 5
1800 \override StaffGrouper #'between-staff-spacing #'stretchability = #4.5
1802 \context { \GrandStaff
1803 \override StaffGrouper #'between-staff-spacing #'space = 5
1804 \override StaffGrouper #'between-staff-spacing #'stretchability = #4.5
1806 \context { \ChoirStaff
1807 \override StaffGrouper #'between-staff-spacing #'space = 5
1808 \override StaffGrouper #'between-staff-spacing #'stretchability = #3
1811 \override StaffGrouper #'between-staff-spacing #'space = 1
1812 \override StaffGrouper #'between-staff-spacing #'stretchability = #4.9
1815 \override StaffGrouper #'between-staff-spacing #'space = 5
1816 \override StaffGrouper #'between-staff-spacing #'stretchability = #5