Typo
[orchestrallily.git] / orchestrallily.ly
blob11f67da7e3caf344fd8b6880a2f1928af703c616
1 \version "2.11.41"
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 % OrchestralLily
5 % ==============
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
13 % Version History:
14 % 0.01 (2008-03-02): Initial Version
15 % 0.02 (2008-03-06): Added basic MIDI support (*MidiInstrument and \setCreateMIDI)
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 #(use-modules (ice-9 match))
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 %%%%% SCORE STRUCTURE AND AUTOMATIC GENERATION
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 % Helper functions
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 % Helper function to filter all non-null entries
35 #(define (not-null? x) (not (null? x)))
37 % Helper function to extract a given variable, built from [Piece][Instrument]Identifier
38 #(define (namedPieceInstrObject piece instr name)
39 (let* (
40 (fullname (string->symbol (string-append piece instr name)))
41 (instrname (string->symbol (string-append instr name)))
42 (piecename (string->symbol (string-append piece name)))
44 (cond
45 ((defined? fullname) (primitive-eval fullname))
46 ((defined? instrname) (primitive-eval instrname))
47 ((defined? piecename) (primitive-eval piecename))
48 (else '())
53 %% Print text as a justified paragraph, taken from the lilypond Notation Reference
54 #(define-markup-list-command (paragraph layout props args) (markup-list?)
55 (let ((indent (chain-assoc-get 'par-indent props 2)))
56 (interpret-markup-list layout props
57 (make-justified-lines-markup-list (cons (make-hspace-markup indent)
58 args)))))
60 conditionalBreak = #(define-music-function (parser location) ()
61 #{ \tag #'instrumental-score \pageBreak #}
64 #(define (oly:piece-title-markup title) (markup #:column (#:line (#:fontsize #'3 #:bold title))) )
66 #(define-markup-command (piece-title layout props title) (markup?)
67 (interpret-markup layout props (oly:piece-title-markup title))
70 #(define (oly:generate_object_name piece instr obj )
71 (if (and (string? piece) (string? instr) (string? obj))
72 (string-append piece instr obj)
76 #(define (oly:generate_staff_name piece instr) (oly:generate_object_name piece instr "St"))
78 #(define (set-context-property context property value)
79 (set! (ly:music-property context property) value)
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
84 % Score structure and voice types
85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
87 #(define oly:orchestral_score_structure '())
89 #(define (oly:set_score_structure struct)
90 (if (list? struct)
91 (set! oly:orchestral_score_structure struct)
92 (ly:warning (_ "oly:set_score_structure needs an association list as argument!"))
96 orchestralScoreStructure = #(define-music-function (parser location structure) (list?)
97 (oly:set_score_structure structure)
98 (make-music 'Music 'void #t)
101 #(define oly:voice_types '())
103 #(define (oly:set_voice_types types)
104 (if (list? types)
105 (set! oly:voice_types types)
106 (ly:warning (_ "oly:set_voice_types needs an association list as argument!"))
110 orchestralVoiceTypes = #(define-music-function (parser location types) (list?)
111 (oly:set_voice_types types)
112 (make-music 'Music 'void #t)
116 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
117 % Automatic staff and group generation
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
120 % Retrieve all music definitions for the given
121 #(define (oly:get_music_object piece instrument)
122 (namedPieceInstrObject piece instrument "Music")
124 #(define (oly:get_music_objects piece instruments)
125 (filter not-null? (map (lambda (i) (oly:get_music_object piece i)) instruments))
128 % Given a property name and the extensions, either generate the pair to set
129 % the property or an empty list, if no pre-defined variable could be found
130 #(define (oly:generate_property_pair prop piece instr type)
131 (let* ((val (namedPieceInstrObject piece instr type)))
132 (if (not-null? val) (list 'assign prop val) '() )
136 #(define (oly:staff_type type)
137 (cond
138 ((string? type) (string->symbol type))
139 ((symbol? type) type)
140 (else 'Staff)
145 #(define (oly:voice_handler_internal parser piece name type music)
146 (let* (
147 (tempo (namedPieceInstrObject piece name "Tempo"))
148 (lyrics (namedPieceInstrObject piece name "Lyrics"))
149 (musiccontent '())
152 (if (ly:music? lyrics)
153 (set! musiccontent (append musiccontent (list dynamicUp)))
154 (if (not-null? lyrics) (ly:warning (_ "Wrong type (no lyrics) for lyrics for instrument ~S in piece ~S") name piece))
156 ; Append the settings, key and clef (if defined)
157 (map
158 (lambda (type)
159 (let* ((object (namedPieceInstrObject piece name type)))
160 (if (ly:music? object)
161 (set! musiccontent (append musiccontent (list object)))
162 (if (not-null? object) (ly:warning (_ "Wrong type (no ly:music) for ~S for instrument ~S in piece ~S") type name piece))
166 '("Settings" "Key" "Clef" "TimeSignature")
169 (if (ly:music? music)
170 (begin
171 (set! musiccontent (append musiccontent (list music)))
172 ;(ly:message "Generating staff for ~a" name)
174 (let* (
175 (voicename (oly:generate_object_name piece name "Voice" ))
176 (voicetype (oly:staff_type type))
177 (voice (context-spec-music (make-simultaneous-music musiccontent) voicetype voicename))
178 (staffcont (list voice))
180 ; If we have lyrics, create a lyrics context containing LyricCombineMusic
181 ; and add that as second element to the staff's elements list...
182 (if (ly:music? lyrics)
183 (let* (
184 (lyricsname (oly:generate_object_name piece name "Lyrics" ))
185 (lyricscont (make-music 'LyricCombineMusic 'element lyrics 'associated-context voicename))
187 (set! staffcont (append staffcont
188 (list (context-spec-music lyricscont 'Lyrics lyricsname))))
191 staffcont
194 ; For empty music, return empty
200 #(define (oly:voice_handler parser piece name type)
201 (let* ((music (oly:get_music_object piece name))
203 (oly:voice_handler_internal parser piece name type music)
208 #(define (oly:staff_handler_internal parser piece name type voices)
209 (if (not-null? voices)
210 (let* (
211 (staffname (oly:generate_staff_name piece name))
212 (stafftype (oly:staff_type type))
213 (staff (make-simultaneous-music voices))
214 (propops (oly:staff_handler_properties piece name))
216 (case stafftype
217 ((SimultaneousMusic ParallelMusic) #f)
218 (else (set! staff (context-spec-music staff stafftype staffname)))
220 (if (not-null? propops)
221 (set! (ly:music-property staff 'property-operations) propops)
223 staff
225 ; For empty music, return empty
230 #(define (oly:staff_handler parser piece name type children)
231 (let* ((c (if (not-null? children) children (list name)))
232 (voices (apply append (map (lambda (v) (oly:create_voice parser piece v)) c)) )
234 (if (not-null? voices)
235 (oly:staff_handler_internal parser piece name type voices)
241 #(define (oly:parallel_voices_staff_handler parser piece name type children)
242 (let* (
243 (voices (map (lambda (i) (oly:create_voice parser piece i)) children))
244 ; get the lsit of non-empty voices and flatten it!
245 (nonemptyvoices (apply append (filter not-null? voices)))
247 (if (not-null? nonemptyvoices)
248 (oly:staff_handler_internal parser piece name "Staff" nonemptyvoices)
254 #(define (oly:part_combined_staff_handler parser piece name type children)
255 (let* ((music (oly:get_music_objects piece children)))
256 (cond
257 ((and (pair? music) (ly:music? (car music)) (not-null? (cdr music)) (ly:music? (cadr music)))
258 ;(ly:message "Part-combine with two music expressions")
259 (oly:staff_handler_internal parser piece name "Staff" (list (make-part-combine-music parser music))))
260 ((null? music)
261 (ly:warning "Part-combine without any music expressions")
262 '())
263 ; exactly one is a music expression, simply use that by joining
264 ((list? music)
265 (ly:message "Part-combine with only one music expressions")
266 (oly:staff_handler_internal parser piece name "Staff" (list (apply append music))))
267 (else
268 ;(ly:message "make_part_combined_staff: ~S ~S ~a" piece instr instruments)
269 '() )
274 % Generate the properties for the staff for piece and instr. Typically, these
275 % are the instrument name and the short instrument name (if defined).
276 % return a (possibly empty) list of all assignments.
277 #(define (oly:staff_handler_properties piece instr)
278 (let* (
279 (mapping '(
280 (instrumentName . "InstrumentName")
281 (shortInstrumentName . "ShortInstrumentName")
282 (midiInstrument . "MidiInstrument")
284 (assignments (map
285 (lambda (pr)
286 (oly:generate_property_pair (car pr) piece instr (cdr pr))
288 mapping))
289 (props (filter not-null? assignments))
291 props
295 #(define (oly:staff_group_handler parser piece name type children)
296 (let* (
297 (staves (map (lambda (i) (oly:create_staff_or_group parser piece i)) children))
298 (nonemptystaves (filter not-null? staves))
300 (if (not-null? nonemptystaves)
301 (let* (
302 (musicexpr (if (= 1 (length nonemptystaves))
303 (car nonemptystaves)
304 (make-simultaneous-music nonemptystaves)))
305 (groupname (oly:generate_staff_name piece name))
306 (grouptype (oly:staff_type type))
307 (group musicexpr)
308 (propops (oly:staff_handler_properties piece name))
310 (case grouptype
311 ((SimultaneousMusic ParallelMusic) #f)
312 (else (set! group (context-spec-music group grouptype groupname)))
314 (set! (ly:music-property group 'property-operations) propops)
315 group
317 ; Return empty list if no staves are generated
323 #(define oly:staff_handlers
324 (list
325 ; staff group types
326 '("GrandStaff" . oly:staff_group_handler )
327 '("PianoStaff" . oly:staff_group_handler )
328 '("ChoirStaff" . oly:staff_group_handler )
329 '("StaffGroup" . oly:staff_group_handler )
330 '("ParallelMusic" . oly:staff_group_handler )
331 '("SimultaneousMusic" . oly:staff_group_handler )
332 ; staff types
333 '("Staff" . oly:staff_handler )
334 '("DrumStaff" . oly:staff_handler )
335 '("PartCombinedStaff" . oly:part_combined_staff_handler )
336 '("ParallelVoicesStaff" . oly:parallel_voices_staff_handler )
340 #(define oly:voice_handlers
341 (list
342 ; voice types
343 '("Voice" . oly:voice_handler )
344 '("FiguredBass" . oly:voice_handler )
345 '("Lyrics" . oly:lyrics_handler )
346 '("DrumVoice" . oly:voice_handler )
347 '("Dynamics" . oly:dynamics_handler )
351 #(define (oly:create_voice parser piece name)
352 (let* ( (voice (namedPieceInstrObject piece name "Voice"))
353 (type (assoc-ref oly:voice_types name)) )
354 (if (not-null? voice)
355 ; Explicit voice variable, use that
356 voice
358 (if (not type)
359 ; No entry in structure found => simple voice
360 (oly:voice_handler parser piece name "Voice")
361 ; Entry found in structure => use the handler for the given type
362 (let* (
363 (voicetype (car type))
364 (handler (assoc-ref oly:voice_handlers voicetype))
366 (if handler
367 ((primitive-eval handler) parser piece name voicetype)
368 (begin
369 (ly:warning "No handler found for voice type ~a, using default voice handler" voicetype)
370 (oly:voice_handler parser piece name voicetype)
379 #(define (oly:create_staff_or_group parser piece name)
380 (let* ( (staff (namedPieceInstrObject piece name "Staff"))
381 (type_from_structure (assoc-ref oly:orchestral_score_structure name)) )
382 ;(if (not-null? staff)
383 ; (ly:message "Found staff variable for instrument ~a in piece ~a" instr piece)
384 ; (ly:message "Staff variable for instrument ~a in piece ~a NOT FOUND" instr piece)
386 (if (not-null? staff)
387 ; Explicit staff variable, use that
388 staff
390 (if (not (list? type_from_structure))
391 ; No entry in structure found => simple staff
392 (oly:staff_handler parser piece name "Staff" '())
394 ; Entry found in structure => use the handler for the given type
395 (let* ((type (car type_from_structure))
396 (handler (assoc-ref oly:staff_handlers type))
397 (children (cadr type_from_structure))
399 (if handler
400 ((primitive-eval handler) parser piece name type children)
401 (begin
402 (ly:warning "No handler found for staff type ~a, using default staff handler" type)
403 (oly:staff_handler parser piece name type children)
412 #(define (oly:register_staff_type_handler type func)
413 ; (ly:message "Registering staff handler ~a for type ~a" func type)
414 (set! oly:staff_handlers (assoc-set! oly:staff_handlers type func))
417 #(define (oly:register_voice_type_handler type func)
418 ; (ly:message "Registering voice type handler ~a for type ~a" func type)
419 (set! oly:voice_handlers (assoc-set! oly:voice_handlers type func))
422 % handlers for deprecated API
423 #(oly:register_staff_type_handler 'StaffGroup 'oly:staff_group_handler)
424 #(oly:register_staff_type_handler 'ParallelMusic 'oly:staff_group_handler)
427 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
428 % Automatic score generation
429 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
431 % \setUseBook ##t/##f sets a flag to determine whether the calls to createScore
432 % are from within a book block or not
433 % #(define oly:score_handler collect-scores-for-book)
434 #(define oly:score_handler toplevel-score-handler)
435 #(define oly:music_handler toplevel-music-handler)
436 #(define oly:text_handler toplevel-text-handler)
438 setUseBook = #(define-music-function (parser location usebook) (boolean?)
439 (if usebook
440 (begin
441 (set! oly:score_handler book-score-handler)
442 (set! oly:music_handler book-music-handler)
443 (set! oly:text_handler book-text-handler)
445 (begin
446 (set! oly:score_handler toplevel-score-handler)
447 (set! oly:music_handler toplevel-music-handler)
448 (set! oly:text_handler toplevel-text-handler)
451 (make-music 'Music 'void #t)
455 % Two functions to handle midi-blocks: Either don't set one, or set an empty
456 % one so that MIDI is generated
457 #(define (oly:set_no_midi_block score) '())
458 #(define (oly:set_midi_block score)
459 (let* ((midiblock (if (defined? '$defaultmidi)
460 (ly:output-def-clone $defaultmidi)
461 (ly:make-output-def))))
462 (ly:output-def-set-variable! midiblock 'is-midi #t)
463 (ly:score-add-output-def! score midiblock)
467 % \setCreateMidi ##t/##f sets a flag to determine wheter MIDI output should
468 % be generated
469 #(define oly:apply_score_midi oly:set_no_midi_block)
470 setCreateMIDI = #(define-music-function (parser location createmidi) (boolean?)
471 (if createmidi
472 (set! oly:apply_score_midi oly:set_midi_block)
473 (set! oly:apply_score_midi oly:set_no_midi_block)
475 (make-music 'Music 'void #t)
479 % Two functions to handle layout-blocks: Either don't set one, or set an empty
480 % one so that a PDF is generated
481 #(define (oly:set_no_layout_block score) '())
482 #(define (oly:set_layout_block score)
483 (let* ((layoutblock (if (defined? '$defaultlayout)
484 (ly:output-def-clone $defaultlayout)
485 (ly:make-output-def))))
486 (ly:output-def-set-variable! layoutblock 'is-layout #t)
487 (ly:score-add-output-def! score layoutblock)
491 % \setCreatePDF ##t/##f sets a flag to determine wheter PDF output should
492 % be generated
493 #(define oly:apply_score_layout oly:set_no_layout_block)
494 setCreatePDF = #(define-music-function (parser location createlayout) (boolean?)
495 (if createlayout
496 (set! oly:apply_score_layout oly:set_layout_block)
497 (set! oly:apply_score_layout oly:set_no_layout_block)
499 (make-music 'Music 'void #t)
503 % Set the piece title in a new header block.
504 #(define (oly:set_piece_header score piecename)
505 (if (not-null? piecename)
506 (let* ((header (make-module)))
507 (module-define! header 'piece piecename)
508 (ly:score-set-header! score header)
514 % post-filter functions. By default, no filtering is done. However,
515 % for the *NoCues* function, the cue notes should be killed
516 identity = #(define-music-function (parser location music) (ly:music?) music)
517 cuefilter = #(define-music-function (parser location music) (ly:music?)
518 ((ly:music-function-extract removeWithTag) parser location 'cued ((ly:music-function-extract killCues) parser location music))
521 #(define-public (oly:add-toc-item parser markup-symbol text)
522 (oly:music_handler parser (add-toc-item! markup-symbol text)))
525 #(define (oly:add-score parser score piecename)
526 (if (not-null? piecename)
527 (oly:add-toc-item parser 'tocItemMarkup piecename))
528 (oly:score_handler parser score)
530 % The helper function to build a score.
531 #(define (oly:createScoreHelper parser location piece children func)
532 (let* (
533 (staves (oly:staff_group_handler parser piece "" "SimultaneousMusic" children))
534 (music (if (not-null? staves)
535 ((ly:music-function-extract func) parser location staves)
538 (score '())
539 (piecename (namedPieceInstrObject piece (car children) "PieceName"))
540 (piecenametacet (namedPieceInstrObject piece (car children) "PieceNameTacet"))
541 (header '())
543 (if (null? music)
544 ; No staves, print tacet
545 (begin
546 (if (not-null? piecenametacet) (set! piecename piecenametacet))
547 (if (not-null? piecename)
548 (oly:add-score parser (list (oly:piece-title-markup piecename)) piecename)
549 (ly:warning (_ "No music and no score title found for part ~a and instrument ~a") piece children)
552 ; we have staves, apply the piecename to the score and add layout/midi blocks if needed
553 (begin
554 (set! score (scorify-music music parser))
555 (oly:set_piece_header score piecename)
556 (oly:apply_score_midi score)
557 (oly:apply_score_layout score)
558 ; Schedule the score for typesetting
559 (oly:add-score parser score piecename)
563 ; This is a void function, the score has been schedulled for typesetting already
564 (make-music 'Music 'void #t)
567 createScore = #(define-music-function (parser location piece children) (string? list?)
568 (oly:createScoreHelper parser location piece children identity)
570 createNoCuesScore = #(define-music-function (parser location piece children) (string? list?)
571 (oly:createScoreHelper parser location piece children cuefilter)
574 createHeadline = #(define-music-function (parser location headline) (string?)
575 (oly:add-toc-item parser 'tocItemMarkup headline)
576 (oly:score_handler parser (list (oly:piece-title-markup headline)))
577 (make-music 'Music 'void #t)
582 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
584 %%%%% CUE NOTES
585 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
588 % set the cue instrument name
589 setCue = #(define-music-function (parser location instr) (string?)
590 #{ \set Voice.instrumentCueName = $instr #} )
592 % generate a cue music section with instrument names
593 % Parameters: \namedCueDuring NameOfQuote CueDirection CueInstrument OriginalInstrument music
594 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
595 % -) CueInstrument and OriginalInstrument are the displayed instrument names
596 % typical call:
597 % \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 }
598 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
599 % the beginning of the cue notes and "Sop." at the end
600 namedCueDuring = #(define-music-function (parser location cuevoice direction instrcue instr cuemusic) (string? number? string? string? ly:music?)
602 \cueDuring #$cuevoice #$direction { \tag #'cued \setCue #$instrcue $cuemusic \tag #'cued \setCue #$instr }
603 % \tag #'uncued $cuemusic
606 namedTransposedCueDuring = #(define-music-function (parser location cuevoice direction instrcue instr trans cuemusic) (string? number? string? string? ly:music? ly:music?)
608 \transposedCueDuring #$cuevoice #$direction $trans { \tag #'cued \setCue #$instrcue $cuemusic \tag #'cued \setCue #$instr }
609 % \tag #'uncued $cuemusic
613 % set the cue instrument name and clef
614 setClefCue = #(define-music-function (parser location instr clef)
615 (string? ly:music?)
617 \once \override Staff.Clef #'font-size = #-3 $clef
618 \set Voice.instrumentCueName = $instr
619 #} )
621 % generate a cue music section with instrument names and clef changes
622 % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music
623 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
624 % -) CueInstrument and OriginalInstrument are the displayed instrument names
625 % -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containing voice
626 % typical call:
627 % \cleffedCueDuring #"vIQuote" #UP #"V.I" #"treble" #"Basso" #"bass" { R1*3 }
628 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
629 % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble at the
630 % beginning of the cue notes and reset to bass at the end
631 cleffedCueDuring = #(define-music-function (parser location cuevoice direction instrcue clefcue instr clefinstr cuemusic)
632 (string? number? string? ly:music? string? ly:music? ly:music?)
634 \cueDuring #$cuevoice #$direction { \tag #'cued \setClefCue #$instrcue $clefcue $cuemusic \tag #'cued \setClefCue #$instr $clefinstr }
635 % \tag #'uncued $cuemusic
642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
644 %%%%% DYNAMICS
645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
648 tempoMark = #(define-music-function (parser location padding marktext) (number? string?)
650 \once \override Score . RehearsalMark #'padding = $padding
651 \mark \markup { \bold \smaller $marktext }
654 shiftDynamics = #(define-music-function (parser location xshift yshift) (number? number?)
656 \once \override DynamicTextSpanner #'padding = $yshift
657 \once\override DynamicText #'extra-offset = #(cons $xshift $yshift)
660 ffz = #(make-dynamic-script "ffz")
661 pf = #(make-dynamic-script "pf")
662 sempp = #(make-dynamic-script (markup #:line( #:with-dimensions '(0 . 0)
663 '(0 . 0) #:right-align #:normal-text #:italic "sempre" #:dynamic "pp")))
664 parenf = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "f" #:normal-text #:italic #:fontsize 2 ")" )))
665 parenp = #(make-dynamic-script (markup #:line(#:normal-text #:italic #:fontsize 2 "(" #:dynamic "p" #:normal-text #:italic #:fontsize 2 ")" )))
669 dim = #(make-span-event 'DecrescendoEvent START)
670 enddim = #(make-span-event 'DecrescendoEvent STOP)
671 decresc = #(make-span-event 'DecrescendoEvent START)
672 enddecresc = #(make-span-event 'DecrescendoEvent STOP)
673 cresc = #(make-span-event 'CrescendoEvent START)
674 endcresc = #(make-span-event 'CrescendoEvent STOP)
676 setCresc = {
677 \set crescendoText = \markup { \italic "cresc." }
678 \set crescendoSpanner = #'text
679 \override DynamicTextSpanner #'style = #'dashed-line
681 setDecresc = {
682 \set decrescendoText = \markup { \italic "decresc." }
683 \set crescendoSpanner = #'text
684 \override DynamicTextSpanner #'style = #'dashed-line
686 setDim = {
687 \set decrescendoText = \markup { \italic "dim." }
688 \set crescendoSpanner = #'text
689 \override DynamicTextSpanner #'style = #'dashed-line
692 newOrOldClef = #(define-music-function (parser location new old ) (string? string?)
693 (if (ly:get-option 'old-clefs) #{ \clef $old #} #{ \clef $new #})
698 %%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
699 % to remove also the fermata from R1-\fermataMarkup: By filtering the music
700 % and removing the corresponding events.
701 % Documented as an LSR snippet: http://lsr.dsi.unimi.it/LSR/Item?id=372
702 #(define (filterOneEventsMarkup event)
703 ( let ( (eventname (ly:music-property event 'name)) )
704 (not
705 (or ;; add here event name you do NOT want
706 (eq? eventname 'MultiMeasureTextEvent)
707 (eq? eventname 'AbsoluteDynamicEvent)
708 (eq? eventname 'TextScriptEvent)
709 (eq? eventname 'ArticulationEvent)
710 (eq? eventname 'CrescendoEvent)
711 (eq? eventname 'DecrescendoEvent)
716 filterArticulations = #(define-music-function (parser location music) (ly:music?)
717    (music-filter filterOneEventsMarkup music)
730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
731 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
732 %%%%% REST COMBINATION
733 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
734 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
738 %% REST COMBINING, TAKEN FROM http://lsr.dsi.unimi.it/LSR/Item?id=336
740 %% Usage:
741 %% \new Staff \with {
742 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
743 %% } << \somevoice \\ \othervoice >>
744 %% or (globally):
745 %% \layout {
746 %% \context {
747 %% \Staff
748 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
749 %% }
750 %% }
752 %% Limitations:
753 %% - only handles two voices
754 %% - does not handle multi-measure/whole-measure rests
756 #(define (rest-score r)
757 (let ((score 0)
758 (yoff (ly:grob-property-data r 'Y-offset))
759 (sp (ly:grob-property-data r 'staff-position)))
760 (if (number? yoff)
761 (set! score (+ score 2))
762 (if (eq? yoff 'calculation-in-progress)
763 (set! score (- score 3))))
764 (and (number? sp)
765 (<= 0 2 sp)
766 (set! score (+ score 2))
767 (set! score (- score (abs (- 1 sp)))))
768 score))
770 #(define (merge-rests-on-positioning grob)
771 (let* ((can-merge #f)
772 (elts (ly:grob-object grob 'elements))
773 (num-elts (and (ly:grob-array? elts)
774 (ly:grob-array-length elts)))
775 (two-voice? (= num-elts 2)))
776 (if two-voice?
777 (let* ((v1-grob (ly:grob-array-ref elts 0))
778 (v2-grob (ly:grob-array-ref elts 1))
779 (v1-rest (ly:grob-object v1-grob 'rest))
780 (v2-rest (ly:grob-object v2-grob 'rest)))
781 (and
782 (ly:grob? v1-rest)
783 (ly:grob? v2-rest)
784 (let* ((v1-duration-log (ly:grob-property v1-rest 'duration-log))
785 (v2-duration-log (ly:grob-property v2-rest 'duration-log))
786 (v1-dot (ly:grob-object v1-rest 'dot))
787 (v2-dot (ly:grob-object v2-rest 'dot))
788 (v1-dot-count (and (ly:grob? v1-dot)
789 (ly:grob-property v1-dot 'dot-count -1)))
790 (v2-dot-count (and (ly:grob? v2-dot)
791 (ly:grob-property v2-dot 'dot-count -1))))
792 (set! can-merge
793 (and
794 (number? v1-duration-log)
795 (number? v2-duration-log)
796 (= v1-duration-log v2-duration-log)
797 (eq? v1-dot-count v2-dot-count)))
798 (if can-merge
799 ;; keep the rest that looks best:
800 (let* ((keep-v1? (>= (rest-score v1-rest)
801 (rest-score v2-rest)))
802 (rest-to-keep (if keep-v1? v1-rest v2-rest))
803 (dot-to-kill (if keep-v1? v2-dot v1-dot)))
804 ;; uncomment if you're curious of which rest was chosen:
805 ;;(ly:grob-set-property! v1-rest 'color green)
806 ;;(ly:grob-set-property! v2-rest 'color blue)
807 (ly:grob-suicide! (if keep-v1? v2-rest v1-rest))
808 (if (ly:grob? dot-to-kill)
809 (ly:grob-suicide! dot-to-kill))
810 (ly:grob-set-property! rest-to-keep 'direction 0)
811 (ly:rest::y-offset-callback rest-to-keep)))))))
812 (if can-merge
814 (ly:rest-collision::calc-positioning-done grob))))
820 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
821 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
822 %%%%% TABLE OF CONTENTS
823 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
824 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
827 contentsTitle = "Inhalt / Contents"
829 \paper {
830 tocTitleMarkup = \markup \fill-line{
831 \null
832 \column {
833 \override #(cons 'line-width (* 7 cm))
834 \line{ \fill-line {\piece-title {\contentsTitle} \null }}
835 \hspace #1
837 \null
839 tocItemMarkup = \markup \fill-line {
840 \null
841 \column {
842 \override #(cons 'line-width (* 7 cm ))
843 \line { \fill-line{\fromproperty #'toc:text \fromproperty #'toc:page }}
845 \null
850 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
851 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
852 %%%%% TITLE PAGE / HEADER
853 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
854 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
856 #(define-markup-command (when-property layout props symbol markp) (symbol? markup?)
857 (if (chain-assoc-get symbol props)
858 (interpret-markup layout props markp)
859 (ly:make-stencil '() '(1 . -1) '(1 . -1))))
861 #(define-markup-command (vspace layout props amount) (number?)
862 "This produces a invisible object taking vertical space."
863 (let ((amount (* amount 3.0)))
864 (if (> amount 0)
865 (ly:make-stencil "" (cons -1 1) (cons 0 amount))
866 (ly:make-stencil "" (cons -1 1) (cons amount amount)))))
870 titlePageMarkup = \markup { \fontsize #2 \when-property #'header:title \column {
871 \vspace #4
872 \fill-line { \fontsize #8 \fromproperty #'header:composer }
873 \vspace #1
874 \fill-line { \fontsize #8 \fromproperty #'header:poet }
875 \vspace #4
876 \fill-line { \fontsize #10 \bold \fromproperty #'header:titlepagetitle }
877 \vspace #1
878 \fontsize #2 \when-property #'header:enteredby {
879 \fill-line { \fromproperty #'header:subtitle }
880 \vspace #1
882 \fill-line { \postscript #"-20 0 moveto 40 0 rlineto stroke" }
883 \vspace #8
884 \fill-line { \fontsize #5 \fromproperty #'header:ensemble }
885 \vspace #0.02
886 \fill-line { \fontsize #2 \fromproperty #'header:instruments }
887 \vspace #9
888 \fill-line { \fontsize #5 \fromproperty #'header:date }
889 \vspace #1
890 \fill-line { \fontsize #5 \fromproperty #'header:scoretype }
891 \vspace #8
892 \fontsize #2 \when-property #'header:enteredby {
893 \fill-line { "Herausgegeben von: / Edited by:"}
894 \vspace #0.
895 \fill-line { \fromproperty #'header:enteredby }
897 \fill-line {
898 \when-property #'header:arrangement \column {
899 \vspace #8
900 \fill-line { \fontsize #3 \fromproperty #'header:arrangement }
906 titleHeaderMarkup = \markup {
907 \override #'(baseline-skip . 3.5)
908 \column {
909 \override #'(baseline-skip . 3.5)
910 \column {
911 \huge \bigger \bold
912 \fill-line {
913 \bigger \fromproperty #'header:title
915 \fill-line {
916 \large \smaller \bold
917 \bigger \fromproperty #'header:subtitle
919 \fill-line {
920 \smaller \bold
921 \fromproperty #'header:subsubtitle
923 \fill-line {
924 { \large \bold \fromproperty #'header:instrument }
926 \fill-line {
927 \fromproperty #'header:poet
928 \fromproperty #'header:composer
930 \fill-line {
931 \fromproperty #'header:meter
932 \fromproperty #'header:arranger
938 titleScoreMarkup = \markup \piece-title \fromproperty #'header:piece
940 \paper {
941 scoreTitleMarkup = \titleScoreMarkup
942 bookTitleMarkup = \titleHeaderMarkup
947 %%%%%%%%%%%%%% headers and footers %%%%%%%%%%%%%%%%%%%%%%%%%%
949 #(define (first-score-page layout props arg)
950 (let* ((label 'first-score-page)
951 (table (ly:output-def-lookup layout 'label-page-table))
952 (label-page (and (list? table) (assoc label table)))
953 (page-number (and label-page (cdr label-page)))
955 (if (eq? (chain-assoc-get 'page:page-number props -1) page-number)
956 (interpret-markup layout props arg)
957 empty-stencil)))
959 #(define no-header-table '())
960 thisPageNoHeader = #(define-music-function (parser location) ()
961 (let* ((label (gensym "header")))
962 (set! no-header-table (cons label no-header-table))
963 (make-music 'Music
964 'page-marker #t
965 'page-label label)))
968 % TODO: Use the no-header-table!
969 #(define (is-header-page layout props arg)
970 (let* ((page-number (chain-assoc-get 'page:page-number props -1))
972 (if (and (> page-number 2) (!= page-number 7))
973 (interpret-markup layout props arg)
974 empty-stencil)))
976 #(define no-footer-table '())
977 thisPageNoFooter = #(define-music-function (parser location) ()
978 (let* ((label (gensym "footer")))
979 (set! no-footer-table (cons label no-footer-table))
980 (make-music 'Music
981 'page-marker #t
982 'page-label label)))
984 % TODO: Use the no-footer-table!
985 #(define (is-footer-page layout props arg)
986 (let* ((page-number (chain-assoc-get 'page:page-number props -1))
987 (label 'first-score-page)
988 (table (ly:output-def-lookup layout 'label-page-table))
989 (label-page (and (list? table) (assoc label table)))
990 ;(page-number (and label-page (cdr label-page)))
992 (if (and (> page-number 2) (!= page-number 7))
993 (interpret-markup layout props arg)
994 empty-stencil)))
997 #(define copyright-footer-table '())
998 thisPageCopyrightFooter = #(define-music-function (parser location) ()
999 (let* ((label (gensym "copyrightfooter")))
1000 (set! copyright-footer-table (cons label copyright-footer-table))
1001 (make-music 'Music
1002 'page-marker #t
1003 'page-label label)))
1005 % TODO: Use the copyright-footer-table!
1006 #(define (copyright-page layout props arg)
1007 (if (= (chain-assoc-get 'page:page-number props -1) 7)
1008 (interpret-markup layout props arg)
1009 empty-stencil))
1012 \paper {
1013 oddHeaderMarkup = \markup \fill-line {
1014 %% force the header to take some space, otherwise the
1015 %% page layout becomes a complete mess.
1017 \on-the-fly #is-header-page \fromproperty #'header:title
1018 \on-the-fly #is-header-page \fromproperty #'page:page-number-string
1020 evenHeaderMarkup = \markup \fill-line {
1021 \on-the-fly #is-header-page \fromproperty #'page:page-number-string
1022 \on-the-fly #is-header-page \fromproperty #'header:composer
1026 oddFooterMarkup = \markup {
1027 \column {
1028 \fill-line {
1029 %% publisher header field only on title page.
1030 \on-the-fly #first-page \fromproperty #'header:publisher
1032 \fill-line {
1033 %% copyright on the first real score page
1034 \on-the-fly #copyright-page \fromproperty #'header:copyright
1035 \on-the-fly #copyright-page \null
1037 \fill-line {
1038 %% All other pages get the number of the edition centered
1039 \on-the-fly #is-footer-page \fromproperty #'header:scorenumber
1056 % Interpret the given markup with the header fields added to the props.
1057 % This way, one can re-use the same functions (using fromproperty
1058 % #'header:field) in the header block and as top-level markup.
1060 % This function is originally copied from mark-up-title (file scm/titling.scm),
1061 % which is lilypond's internal function to handle the title markups. I needed
1062 % to replace the scopes and manually add the $defaultheader (which is internally
1063 % done in paper-book.cc before calling mark-up-title. Also, I don't extract the
1064 % markup from the header block, but use the given markup.
1066 % I'm not sure if I really need the page properties in props, too... But I
1067 % suppose it does not hurt, either.
1068 #(define-markup-command (markupWithHeader layout props markup) (markup?)
1069 "Interpret the given markup with the header fields added to the props.
1070 This way, one can re-use the same functions (using fromproperty
1071 #'header:field) in the header block and as top-level markup."
1072 (let* (
1073 ; TODO: If we are inside a score, add the score's local header block, too!
1074 ; Currently, I only use the global header block, stored in $defaultheader
1075 (scopes (list $defaultheader))
1076 (alists (map ly:module->alist scopes))
1078 (prefixed-alist
1079 (map (lambda (alist)
1080 (map (lambda (entry)
1081 (cons
1082 (string->symbol (string-append "header:" (symbol->string (car entry))))
1083 (cdr entry)))
1084 alist))
1085 alists))
1086 (props (append prefixed-alist
1087 props
1088 (layout-extract-page-properties layout)))
1090 (interpret-markup layout props markup)
1099 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1101 %%%%% Equally spacing multiple columns (e.g. for translations)
1102 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1105 % Credits: Nicolas Sceaux on the lilypond-user mailinglist
1106 #(define-markup-command (columns layout props args) (markup-list?)
1107 (let ((line-width (/ (chain-assoc-get 'line-width props
1108 (ly:output-def-lookup layout 'line-width))
1109 (max (length args) 1))))
1110 (interpret-markup layout props
1111 (make-line-markup (map (lambda (line)
1112 (markup #:pad-to-box `(0 . ,line-width) '(0 . 0)
1113 #:override `(line-width . ,line-width)
1114 line))
1115 args)))))
1118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1120 %%%%% Defaults for instrument names, short names, cue names, etc.
1121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1122 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1124 %%% Clef definitions, either old-style (using the Breitkopf style) or new style
1125 FlClef = \clef "treble"
1126 FlIClef = \FlClef
1127 FlIIClef = \FlClef
1128 ObClef = \clef "treble"
1129 ObIClef = \ObClef
1130 ObIIClef = \ObClef
1131 ClIClef = \clef "treble"
1132 ClIIClef = \ClIClef
1133 FagClef = \clef "bass"
1134 FagIClef = \FagClef
1135 FagIIClef = \FagClef
1136 CFagClef = \clef "bass"
1137 CorClef = \clef "treble"
1138 CorIClef = \CorClef
1139 CorIIClef = \CorClef
1140 TrClef = "tenor"
1141 TrIClef = \TrClef
1142 TrIIClef = \TrClef
1143 TrIIIClef = \clef "bass"
1144 TbeIClef = \clef "treble"
1145 TbeIIClef = \clef "treble"
1146 TimClef = \clef "bass"
1147 VClef = \clef "treble"
1148 VIClef = \VClef
1149 VIIClef = \VClef
1150 VaClef = \clef "alto"
1151 VaIClef = \VaClef
1152 VaIIClef = \VaClef
1153 VcBClef = \clef "bass"
1154 VcClef = \VcBClef
1155 CbClef = \VcBClef
1156 SClef = \clef "treble"
1157 AClef = \clef "treble"
1158 TClef = \clef "treble_8"
1159 BClef = \clef "bass"
1160 SSoloClef = \SClef
1161 ASoloClef = \AClef
1162 TSoloClef = \TClef
1163 BSoloClef = \BClef
1164 OIClef = \clef "treble"
1165 OIIClef = \clef "bass"
1169 FlInstrumentName = "Flauti"
1170 FlIInstrumentName = "Flauto I"
1171 FlIIInstrumentName = "Flauto II"
1172 ObInstrumentName = "Oboi"
1173 ObIInstrumentName = "Oboe I"
1174 ObIIInstrumentName = "Oboe II"
1175 ClInstrumentName = "Clarinetti"
1176 ClIInstrumentName = "Clarinetto I"
1177 ClIIInstrumentName = "Clarinetto II"
1178 FagInstrumentName = "Fagotti"
1179 FagIInstrumentName = "Fagotto I"
1180 FagIIInstrumentName = "Fagotto II"
1181 CFagInstrumentName = "Contrafagotto"
1182 CorInstrumentName = "Corni"
1183 CorIInstrumentName = "Corno I"
1184 CorIIInstrumentName = "Corno II"
1185 TrInstrumentName = "Tromboni"
1186 TrIInstrumentName = "Trombone I"
1187 TrIIInstrumentName = "Trombone II"
1188 TrIIIInstrumentName = "Trombone III"
1189 TbeInstrumentName = "Trombe"
1190 TbeIInstrumentName = "Tromba I"
1191 TbeIIInstrumentName = "Tromba II"
1192 TimInstrumentName = "Timpani"
1193 VIInstrumentName = "Violino I"
1194 VIIInstrumentName = "Violino II"
1195 VaInstrumentName = "Viola"
1196 VaIInstrumentName = "Viola I"
1197 VaIIInstrumentName = "Viola II"
1198 VcBInstrumentName = \markup {\column { "Cello e" "Contrabbasso"}}
1199 VcInstrumentName ="Violoncello"
1200 CbInstrumentName ="Basso"
1201 SInstrumentName = "Soprano"
1202 AInstrumentName = "Alto"
1203 TInstrumentName = "Tenore"
1204 BInstrumentName = "Basso"
1205 SSoloInstrumentName = "Soprano Solo"
1206 TSoloInstrumentName = "Tenore Solo"
1207 BSoloInstrumentName = "Basso Solo"
1208 ASoloInstrumentName = "Alto Solo"
1209 OInstrumentName = "Organo"
1211 ChInstrumentTitle = "Coro"
1214 FlShortInstrumentName = "Fl."
1215 FlIShortInstrumentName = "Fl. I"
1216 FlIIShortInstrumentName = "Fl. II"
1217 ObShortInstrumentName = "Ob."
1218 ObIShortInstrumentName = "Ob. I"
1219 ObIIShortInstrumentName = "Ob. II"
1220 ClShortInstrumentName = "Cl."
1221 ClIShortInstrumentName = "Cl.I"
1222 ClIIShortInstrumentName = "Cl.II"
1223 FagShortInstrumentName = "Fag."
1224 FagIShortInstrumentName = "Fag. I"
1225 FagIIShortInstrumentName = "Fag. II"
1226 CFagShortInstrumentName = "Cfag."
1227 CorShortInstrumentName = "Cor."
1228 CorIShortInstrumentName = "Cor.I"
1229 CorIIShortInstrumentName = "Cor.II"
1230 TrShortInstrumentName = "Tr."
1231 TrIShortInstrumentName = "Tr. I"
1232 TrIIShortInstrumentName = "Tr. II"
1233 TrIIIShortInstrumentName = "Tr. III"
1234 TbeShortInstrumentName = "Tbe."
1235 TbeIShortInstrumentName = "Tbe.I"
1236 TbeIIShortInstrumentName = "Tbe.II"
1237 TimShortInstrumentName = "Tim."
1238 VIShortInstrumentName = "V.I"
1239 VIIShortInstrumentName = "V.II"
1240 VaShortInstrumentName = "Va."
1241 VaIShortInstrumentName = "Va.I"
1242 VaIIShortInstrumentName = "Va.II"
1243 VcBShortInstrumentName = \markup{\column{"Vc." "e B."}}
1244 VcShortInstrumentName = "Vc."
1245 CbShortInstrumentName = "B."
1246 SShortInstrumentName = "S."
1247 AShortInstrumentName = "A."
1248 TShortInstrumentName = "T."
1249 BShortInstrumentName = "B."
1250 SSoloShortInstrumentName = "S.Solo"
1251 ASoloShortInstrumentName = "A.Solo"
1252 TSoloShortInstrumentName = "T.Solo"
1253 BSoloShortInstrumentName = "B.Solo"
1254 OShortInstrumentName = "Org."
1258 newInstrument = #(define-music-function (parser location instr) (string?)
1260 \set Voice.instrumentCueName = #$(string-join (list "+" instr))
1263 cueText = #(define-music-function (parser location instr) (string?)
1265 \set Voice.instrumentCueName = $instr
1269 cueFl = "Fl"
1270 cueCl = "Clt"
1271 cueClI = "Clt I"
1272 cueClII = "Clt II"
1273 cueCor = "Cor"
1274 cueCorI = "Cor I"
1275 cueCorII = "Cor II"
1276 cueTbe = "Tbe"
1277 cueTbeI = "Tbe I"
1278 cueTbeII = "Tbe II"
1279 cueTim = "Tim"
1280 cueVI = "V I"
1281 cueVII = "V II"
1282 cueVa = "Va"
1283 cueVaI = "Va I"
1284 cueVaII = "Va II"
1285 cueVcB = "Vc/B"
1286 cueArchi = "Archi"
1287 cueS = "S"
1288 cueA = "A"
1289 cueT = "T"
1290 cueB = "B"
1291 cueO = "Org"
1296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1297 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1298 %%%%% SCORE NUMBERS FOR PUBLISHING
1299 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1300 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1302 scoreNumber =
1303 #(define-markup-command (scoreNumber layout props nr) (markup?)
1304 (interpret-markup layout props (markup (format "~a-~a" EKnumber nr)))
1307 FullScoreNumber = "1"
1308 PianoScoreNumber = "2"
1309 VocalScoreNumber = "3"
1311 ChoirScoreNumber = "10"
1312 SNumber = "11"
1313 ANumber = "12"
1314 TNumber = "13"
1315 BNumber = "14"
1316 SoloScoreNumber = "15"
1317 SSoloNumber = "16"
1318 ASoloNumber = "17"
1319 TSoloNumber = "18"
1320 BSoloNumber = "19"
1322 ONumber = "20"
1324 InstrumentsNumber = "25"
1325 VINumber = "30"
1326 VIINumber = "31"
1327 VaNumber = "32"
1328 VcBNumber = "33"
1330 FlINumber = "40"
1331 FlIINumber = "41"
1332 ObINumber = "42"
1333 ObIINumber = "43"
1334 ClINumber = "44"
1335 ClIINumber = "45"
1336 FagINumber = "46"
1337 FagIINumber = "47"
1338 CFagNumber = "48"
1340 CorINumber = "50"
1341 CorIINumber = "51"
1342 TreINumber = "52"
1343 TreIINumber = "53"
1344 TrbINumber = "54"
1345 TrbIINumber = "55"
1346 TrbIIINumber = "56"
1347 TbaNumber = "57"
1349 TimNumber = "60"
1350 ArpaNumber = "65"
1354 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1355 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1356 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1358 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1360 \paper {
1361 left-margin = 2\cm
1362 right-margin = 2\cm
1363 line-width = 17\cm
1364 bottom-margin = 1\cm
1365 top-margin = 1\cm
1366 % after-title-space = 0.5\cm
1367 ragged-bottom = ##f
1368 ragged-last-bottom = ##f
1370 \layout {
1371 \context {
1372 \ChoirStaff
1373 % If only one non-empty staff in a system exists, still print the backet
1374 \override SystemStartBracket #'collapse-height = #1
1375 \consists "Instrument_name_engraver"
1377 \context {
1378 \StaffGroup
1379 % If only one non-empty staff in a system exists, still print the backet
1380 \override SystemStartBracket #'collapse-height = #1
1381 \consists "Instrument_name_engraver"
1383 \context {
1384 \GrandStaff
1385 \override SystemStartBracket #'collapse-height = #1
1386 \consists "Instrument_name_engraver"
1388 \context {
1389 \Score
1390 % Force multi-measure rests to be written as one span
1391 \override MultiMeasureRest #'expand-limit = #3
1392 skipBars = ##t
1393 autoBeaming = ##f
1394 % hairpinToBarline = ##f
1395 \override BarNumber #'break-visibility = #end-of-line-invisible
1396 \override CombineTextScript #'avoid-slur = #'outside
1397 barNumberVisibility = #(every-nth-bar-number-visible 5)
1398 \override DynamicTextSpanner #'dash-period = #-1.0
1399 \override InstrumentSwitch #'font-size = #-1
1401 % Rest collision
1402 \override RestCollision #'positioning-done = #merge-rests-on-positioning
1403 % Auto-Accidentals: Use modern-cautionary style...
1404 extraNatural = ##f
1405 autoAccidentals = #'(Staff (same-octave . 0))
1406 autoCautionaries = #'(Staff (any-octave . 0) (same-octave . 1))
1407 printKeyCancellation = ##t
1409 \context {
1410 \RemoveEmptyStaffContext
1412 \context {
1413 \Lyrics
1414 \override VerticalAxisGroup #'minimum-Y-extent = #'(0.5 . 0.5)
1420 \layout {
1421 \context {
1422 \type "Engraver_group"
1423 \name Dynamics
1424 % So that \cresc works, for example.
1425 \alias Voice
1426 \consists "Output_property_engraver"
1428 \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
1429 pedalSustainStrings = #'("Ped." "*Ped." "*")
1430 pedalUnaCordaStrings = #'("una corda" "" "tre corde")
1432 \consists "Piano_pedal_engraver"
1433 \consists "Script_engraver"
1434 \consists "Dynamic_engraver"
1435 \consists "Text_engraver"
1437 \override TextScript #'font-size = #2
1438 \override TextScript #'font-shape = #'italic
1439 \override DynamicText #'extra-offset = #'(0 . 2.5)
1440 \override Hairpin #'extra-offset = #'(0 . 2.5)
1442 \consists "Skip_event_swallow_translator"
1444 \consists "Axis_group_engraver"
1446 \context {
1447 \PianoStaff
1448 \accepts Dynamics
1449 % \override VerticalAlignment #'forced-distance = #7