3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % Desciption: Lilypond package to make writing large orchestral scores easier.
7 % Documentation: http://wiki.kainhofer.com/lilypond/orchestrallily
8 % Version: 0.02, 2008-03-06
9 % Author: Reinhold Kainhofer, reinhold@kainhofer.com
10 % Copyright: (C) 2008 by Reinhold Kainhofer
11 % License: GPL v3.0, http://www.gnu.org/licenses/gpl.html
14 % 0.01 (2008-03-02): Initial Version
15 % 0.02 (2008-03-06): Added basic MIDI support (*MidiInstrument and \setCreateMIDI)
16 % 0.03 (2008-07-xx): General staff/voice types, title pages, etc.
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 #(use-modules
(ice-
9 match
))
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 %%%%% SCORE STRUCTURE AND AUTOMATIC GENERATION
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 % Helper function to filter all non-null entries
36 #(define
(not-null? x
) (not
(null? x
)))
38 % Helper function to extract a given variable, built from [Piece][Instrument]Identifier
39 #(define
(namedPieceInstrObject piece instr name
)
41 (fullname
(string-
>symbol
(string-append piece instr name
)))
42 (instrname
(string-
>symbol
(string-append instr name
)))
43 (piecename
(string-
>symbol
(string-append piece name
)))
46 ((defined? fullname
) (primitive-eval fullname
))
47 ((defined? instrname
) (primitive-eval instrname
))
48 ((defined? piecename
) (primitive-eval piecename
))
54 %% Print text as a justified paragraph, taken from the lilypond Notation Reference
55 #(define-markup-list-command
(paragraph layout props args
) (markup-list?
)
56 (let
((indent
(chain-assoc-get
'par-indent props
2)))
57 (interpret-markup-list layout props
58 (make-justified-lines-markup-list
(cons
(make-hspace-markup indent
)
61 conditionalBreak
= #(define-music-function
(parser location
) ()
62 #{ \tag #'instrumental-score
\pageBreak #}
65 #(define
(oly
:piece-title-markup title
) (markup
#:column
(#:line
(#:fontsize
#'3 #:bold title
))) )
67 #(define-markup-command
(piece-title layout props title
) (markup?
)
68 (interpret-markup layout props
(oly
:piece-title-markup title
))
71 #(define
(oly
:generate
_object
_name piece instr obj
)
72 (if
(and
(string? piece
) (string? instr
) (string? obj
))
73 (string-append piece instr obj
)
77 #(define
(oly
:generate
_staff
_name piece instr
) (oly
:generate
_object
_name piece instr
"St"))
79 #(define
(set-context-property context property value
)
80 (set
! (ly
:music-property context property
) value
)
84 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
85 % Score structure and voice types
86 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 #(define oly
:orchestral
_score
_structure
'())
90 #(define
(oly
:set
_score
_structure struct
)
92 (set
! oly
:orchestral
_score
_structure struct
)
93 (ly
:warning
(_ "oly:set_score_structure needs an association list as argument!"))
97 orchestralScoreStructure
= #(define-music-function
(parser location structure
) (list?
)
98 (oly
:set
_score
_structure structure
)
99 (make-music
'Music
'void
#t
)
102 #(define oly
:voice
_types
'())
104 #(define
(oly
:set
_voice
_types types
)
106 (set
! oly
:voice
_types types
)
107 (ly
:warning
(_ "oly:set_voice_types needs an association list as argument!"))
111 orchestralVoiceTypes
= #(define-music-function
(parser location types
) (list?
)
112 (oly
:set
_voice
_types types
)
113 (make-music
'Music
'void
#t
)
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 % Automatic staff and group generation
119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 % Retrieve all music definitions for the given
122 #(define
(oly
:get
_music
_object piece instrument
)
123 (namedPieceInstrObject piece instrument
"Music")
125 #(define
(oly
:get
_music
_objects piece instruments
)
126 (filter not-null?
(map
(lambda
(i
) (oly
:get
_music
_object piece i
)) instruments
))
129 % Given a property name and the extensions, either generate the pair to set
130 % the property or an empty list, if no pre-defined variable could be found
131 #(define
(oly
:generate
_property
_pair prop piece instr type
)
132 (let
* ((val
(namedPieceInstrObject piece instr type
)))
133 (if
(not-null? val
) (list
'assign prop val
) '() )
137 #(define
(oly
:staff
_type type
)
139 ((string? type
) (string-
>symbol type
))
140 ((symbol? type
) type
)
145 #(define
(oly
:extractPitch music
)
147 (elems
(if
(ly
:music? music
) (ly
:music-property music
'elements
)))
148 (note
(if
(pair? elems
) (car elems
)))
149 (pitch
(if
(ly
:music? note
) (ly
:music-property note
'pitch
)))
151 (if
(and
(not-null? music
) (not
(ly
:pitch? pitch
)))
152 (ly
:warning
"Unable to interpret as a pitch!")
158 #(define
(oly
:extractTranspositionPitch piece name
)
160 (trpFromPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeFrom")))
161 (trpToPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeTo")))
163 (if
(ly
:pitch? trpFromPitch
)
164 (if
(ly
:pitch? trpToPitch
)
166 (ly
:pitch-diff trpFromPitch trpToPitch
)
167 (ly
:pitch-diff trpFromPitch
(ly
:make-pitch
0 0 0))
169 (if
(ly
:pitch? trpToPitch
)
170 (ly
:pitch-diff
(ly
:make-pitch
0 0 0) trpToPitch
)
177 #(define
(oly
:voice
_handler
_internal parser piece name type music
)
179 (tempo
(namedPieceInstrObject piece name
"Tempo"))
180 (lyrics
(namedPieceInstrObject piece name
"Lyrics"))
181 (trpPitch
(oly
:extractTranspositionPitch piece name
))
185 (if
(ly
:music? lyrics
)
186 (set
! musiccontent
(append musiccontent
(list dynamicUp
)))
187 (if
(not-null? lyrics
) (ly
:warning
(_ "Wrong type (no lyrics) for lyrics for instrument ~S in piece ~S") name piece
))
189 ; Append the settings
, key and clef
(if defined
)
192 (let
* ((object
(namedPieceInstrObject piece name type
)))
193 (if
(ly
:music? object
)
194 (set
! musiccontent
(append musiccontent
(list object
)))
195 (if
(not-null? object
) (ly
:warning
(_ "Wrong type (no ly:music) for ~S for instrument ~S in piece ~S") type name piece
))
199 '("Settings" "Key" "Clef" "TimeSignature")
202 (if
(ly
:music? music
)
204 (set
! musiccontent
(make-simultaneous-music
(append musiccontent
(list music
))))
205 ;
(ly
:message
"Generating staff for ~a" name
)
206 (if
(ly
:pitch? trpPitch
)
207 (set
! musiccontent
(ly
:music-transpose musiccontent trpPitch
))
211 (voicename
(oly
:generate
_object
_name piece name
"Voice" ))
212 (voicetype
(oly
:staff
_type type
))
213 (voice
(context-spec-music musiccontent voicetype voicename
))
214 (staffcont
(list voice
))
216 ; I
f we have lyrics
, create
a lyrics context containing LyricCombineMusic
217 ; and add that
as second element to the staff
's elements list
...
218 (if
(ly
:music? lyrics
)
220 (lyricsname
(oly
:generate
_object
_name piece name
"Lyrics" ))
221 (lyricscont
(make-music
'LyricCombineMusic
'element lyrics
'associated-context voicename
))
223 (set
! staffcont
(append staffcont
224 (list
(context-spec-music lyricscont
'Lyrics lyricsname
))))
230 ; For empty music
, return empty
236 #(define
(oly
:voice
_handler parser piece name type
)
237 (let
* ((music
(oly
:get
_music
_object piece name
))
239 (oly
:voice
_handler
_internal parser piece name type music
)
244 #(define
(oly
:staff
_handler
_internal parser piece name type voices
)
245 (if
(not-null? voices
)
247 (staffname
(oly
:generate
_staff
_name piece name
))
248 (stafftype
(oly
:staff
_type type
))
249 (staff
(make-simultaneous-music voices
))
250 (propops
(oly
:staff
_handler
_properties piece name
))
253 ((SimultaneousMusic ParallelMusic
) #f)
254 (else
(set
! staff
(context-spec-music staff stafftype staffname
)))
256 (if
(not-null? propops
)
257 (set
! (ly
:music-property staff
'property-operations
) propops
)
261 ; For empty music
, return empty
266 #(define
(oly
:staff
_handler parser piece name type children
)
267 (let
* ((c (if
(not-null? children
) children
(list name
)))
268 (voices
(apply append
(map
(lambda
(v
) (oly
:create
_voice parser piece v
)) c)) )
270 (if
(not-null? voices
)
271 (oly
:staff
_handler
_internal parser piece name type voices
)
277 #(define
(oly
:parallel
_voices
_staff
_handler parser piece name type children
)
279 (voices
(map
(lambda
(i
) (oly
:create
_voice parser piece i
)) children
))
280 ; get the lsit of non-empty voices and flatten it
!
281 (nonemptyvoices
(apply append
(filter not-null? voices
)))
283 (if
(not-null? nonemptyvoices
)
284 (oly
:staff
_handler
_internal parser piece name
"Staff" nonemptyvoices
)
290 #(define
(oly
:part
_combined
_staff
_handler parser piece name type children
)
291 (let
* ((music
(oly
:get
_music
_objects piece children
)))
294 ((and
(pair? music
) (ly
:music?
(car music
)) (not-null?
(cdr music
)) (ly
:music?
(cadr music
)))
295 ;
(ly
:message
"Part-combine with two music expressions")
296 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(make-part-combine-music parser music
))))
298 (ly
:warning
"Part-combine without any music expressions")
300 ; exactly one is
a music expression
, simply use that by joining
302 (ly
:message
"Part-combine with only one music expressions")
303 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(apply append music
))))
305 ;
(ly
:message
"make_part_combined_staff: ~S ~S ~a" piece instr instruments
)
311 % Generate the properties for the staff for piece and instr. Typically, these
312 % are the instrument name and the short instrument name (if defined).
313 % return a (possibly empty) list of all assignments.
314 #(define
(oly
:staff
_handler
_properties piece instr
)
317 (instrumentName
. "InstrumentName")
318 (shortInstrumentName
. "ShortInstrumentName")
319 (midiInstrument
. "MidiInstrument")
323 (oly
:generate
_property
_pair
(car pr
) piece instr
(cdr pr
))
326 (props
(filter not-null? assignments
))
332 % Figured bass is a special case, as it can be voice- or staff-type. When
333 % given as a staff type, simply call the voice handler, instead
335 #(define
(oly
:figured
_bass
_staff
_handler parser piece name type children
)
336 (let
* ((c (if
(not-null? children
) children
(list name
)))
337 (voice
(oly
:voice
_handler parser piece
(car
c) type
)))
338 (if
(pair? voice
) (car voice
) ())
343 #(define
(oly
:staff
_group
_handler parser piece name type children
)
345 (staves
(map
(lambda
(i
) (oly
:create
_staff
_or
_group parser piece i
)) children
))
346 (nonemptystaves
(filter not-null? staves
))
348 (if
(not-null? nonemptystaves
)
350 (musicexpr
(if
(= 1 (length nonemptystaves
))
352 (make-simultaneous-music nonemptystaves
)))
353 (groupname
(oly
:generate
_staff
_name piece name
))
354 (grouptype
(oly
:staff
_type type
))
356 (propops
(oly
:staff
_handler
_properties piece name
))
359 ((SimultaneousMusic ParallelMusic
) #f)
360 (else
(set
! group
(context-spec-music group grouptype groupname
)))
362 (set
! (ly
:music-property group
'property-operations
) propops
)
365 ; Return empty list if no staves are generated
371 #(define
(oly
:create
_voice parser piece name
)
372 (let
* ( (voice
(namedPieceInstrObject piece name
"Voice"))
373 (type
(assoc-ref oly
:voice
_types name
)) )
374 (if
(not-null? voice
)
375 ; Explicit voice variable
, use that
379 ; No entry in structure found
=> simple voice
380 (oly
:voice
_handler parser piece name
"Voice")
381 ; Entry found in structure
=> use the handler for the given type
383 (voicetype
(car type
))
384 (handler
(assoc-ref oly
:voice
_handlers voicetype
))
387 ((primitive-eval handler
) parser piece name voicetype
)
389 (ly
:warning
"No handler found for voice type ~a, using default voice handler" voicetype
)
390 (oly
:voice
_handler parser piece name voicetype
)
399 #(define
(oly
:create
_staff
_or
_group parser piece name
)
400 (let
* ( (staff
(namedPieceInstrObject piece name
"Staff"))
401 (type
_from
_structure
(assoc-ref oly
:orchestral
_score
_structure name
)) )
402 ;
(if
(not-null? staff
)
403 ;
(ly
:message
"Found staff variable for instrument ~a in piece ~a" instr piece
)
404 ;
(ly
:message
"Staff variable for instrument ~a in piece ~a NOT FOUND" instr piece
)
406 (if
(not-null? staff
)
407 ; Explicit staff variable
, use that
410 (if
(not
(list? type
_from
_structure
))
411 ; No entry in structure found
=> simple staff
412 (oly
:staff
_handler parser piece name
"Staff" '())
414 ; Entry found in structure
=> use the handler for the given type
415 (let
* ((type
(car type
_from
_structure
))
416 (handler
(assoc-ref oly
:staff
_handlers type
))
417 (children
(cadr type
_from
_structure
))
420 ((primitive-eval handler
) parser piece name type children
)
422 (ly
:warning
"No handler found for staff type ~a, using default staff handler" type
)
423 (oly
:staff
_handler parser piece name type children
)
432 #(define oly
:staff
_handlers
435 '("GrandStaff" . oly
:staff
_group
_handler
)
436 '("PianoStaff" . oly
:staff
_group
_handler
)
437 '("ChoirStaff" . oly
:staff
_group
_handler
)
438 '("StaffGroup" . oly
:staff
_group
_handler
)
439 '("InnerChoirStaff" . oly
:staff
_group
_handler
)
440 '("InnerStaffGroup" . oly
:staff
_group
_handler
)
441 '("ParallelMusic" . oly
:staff
_group
_handler
)
442 '("SimultaneousMusic" . oly
:staff
_group
_handler
)
444 '("Staff" . oly
:staff
_handler
)
445 '("DrumStaff" . oly
:staff
_handler
)
446 '("RhythmicStaff" . oly
:staff
_handler
)
447 '("TabStaff" . oly
:staff
_handler
)
448 '("GregorianTranscriptionStaff" . oly
:staff
_handler
)
449 '("MensuralStaff" . oly
:staff
_handler
)
450 '("VaticanaStaff" . oly
:staff
_handler
)
451 ; staves with multiple voices
452 '("PartCombinedStaff" . oly
:part
_combined
_staff
_handler
)
453 '("ParallelVoicesStaff" . oly
:parallel
_voices
_staff
_handler
)
454 ; special cases
: Figured bass can be staff or voice type
!
455 '("FiguredBass" . oly
:figured
_bass
_staff
_handler
)
459 #(define oly
:voice
_handlers
462 '("Voice" . oly
:voice
_handler
)
463 '("CueVoice" . oly
:voice
_handler
)
464 '("DrumVoice" . oly
:voice
_handler
)
465 '("FiguredBass" . oly
:voice
_handler
)
466 '("GregorianTranscriptionVoice" . oly
:voice
_handler
)
467 '("NoteNames" . oly
:voice
_handler
)
468 '("TabVoice" . oly
:voice
_handler
)
469 '("VaticanaVoice" . oly
:voice
_handler
)
470 ;
'("Dynamics" . oly
:dynamics
_handler
)
475 #(define
(oly
:register
_staff
_type
_handler type func
)
476 ;
(ly
:message
"Registering staff handler ~a for type ~a" func type
)
477 (set
! oly
:staff
_handlers
(assoc-set
! oly
:staff
_handlers type func
))
480 #(define
(oly
:register
_voice
_type
_handler type func
)
481 ;
(ly
:message
"Registering voice type handler ~a for type ~a" func type
)
482 (set
! oly
:voice
_handlers
(assoc-set
! oly
:voice
_handlers type func
))
485 % handlers for deprecated API
486 #(oly
:register
_staff
_type
_handler
'StaffGroup
'oly
:staff
_group
_handler
)
487 #(oly
:register
_staff
_type
_handler
'GrandStaff
'oly
:staff
_group
_handler
)
488 #(oly
:register
_staff
_type
_handler
'PianoStaff
'oly
:staff
_group
_handler
)
489 #(oly
:register
_staff
_type
_handler
'ChoirStaff
'oly
:staff
_group
_handler
)
490 #(oly
:register
_staff
_type
_handler
'Staff
'oly
:staff
_handler
)
491 #(oly
:register
_staff
_type
_handler
'ParallelMusic
'oly
:staff
_group
_handler
)
492 #(oly
:register
_staff
_type
_handler
'SimultaneousMusic
'oly
:staff
_group
_handler
)
493 #(oly
:register
_staff
_type
_handler
#t
'oly
:part
_combined
_staff
_handler
)
494 #(oly
:register
_staff
_type
_handler
#f 'oly
:parallel
_voices
_staff
_handler
)
498 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
499 % Automatic score generation
500 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502 % \setUseBook ##t/##f sets a flag to determine whether the calls to createScore
503 % are from within a book block or not
504 % #(define oly:score_handler collect-scores-for-book)
505 #(define oly
:score
_handler toplevel-score-handler
)
506 #(define oly
:music
_handler toplevel-music-handler
)
507 #(define oly
:text
_handler toplevel-text-handler
)
509 setUseBook
= #(define-music-function
(parser location usebook
) (boolean?
)
512 (set
! oly
:score
_handler book-score-handler
)
513 (set
! oly
:music
_handler book-music-handler
)
514 (set
! oly
:text
_handler book-text-handler
)
517 (set
! oly
:score
_handler toplevel-score-handler
)
518 (set
! oly
:music
_handler toplevel-music-handler
)
519 (set
! oly
:text
_handler toplevel-text-handler
)
522 (make-music
'Music
'void
#t
)
526 % Two functions to handle midi-blocks: Either don't set one, or set an empty
527 % one so that MIDI is generated
528 #(define
(oly
:set
_no
_midi
_block score
) '())
529 #(define
(oly
:set
_midi
_block score
)
530 (let
* ((midiblock
(if
(defined?
'$defaultmidi
)
531 (ly
:output-def-clone $defaultmidi
)
532 (ly
:make-output-def
))))
533 (ly
:output-def-set-variable
! midiblock
'is-midi
#t
)
534 (ly
:score-add-output-def
! score midiblock
)
538 % \setCreateMidi ##t/##f sets a flag to determine wheter MIDI output should
540 #(define oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
541 setCreateMIDI
= #(define-music-function
(parser location createmidi
) (boolean?
)
543 (set
! oly
:apply
_score
_midi oly
:set
_midi
_block
)
544 (set
! oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
546 (make-music
'Music
'void
#t
)
550 % Two functions to handle layout-blocks: Either don't set one, or set an empty
551 % one so that a PDF is generated
552 #(define
(oly
:set
_no
_layout
_block score
) '())
553 #(define
(oly
:set
_layout
_block score
)
554 (let
* ((layoutblock
(if
(defined?
'$defaultlayout
)
555 (ly
:output-def-clone $defaultlayout
)
556 (ly
:make-output-def
))))
557 (ly
:output-def-set-variable
! layoutblock
'is-layout
#t
)
558 (ly
:score-add-output-def
! score layoutblock
)
562 % \setCreatePDF ##t/##f sets a flag to determine wheter PDF output should
564 #(define oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
565 setCreatePDF
= #(define-music-function
(parser location createlayout
) (boolean?
)
567 (set
! oly
:apply
_score
_layout oly
:set
_layout
_block
)
568 (set
! oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
570 (make-music
'Music
'void
#t
)
574 % Set the piece title in a new header block.
575 #(define
(oly
:set
_piece
_header score piecename
)
576 (if
(not-null? piecename
)
577 (let
* ((header
(make-module
)))
578 (module-define
! header
'piece piecename
)
579 (ly
:score-set-header
! score header
)
585 % post-filter functions. By default, no filtering is done. However,
586 % for the *NoCues* function, the cue notes should be killed
587 identity
= #(define-music-function
(parser location music
) (ly
:music?
) music
)
588 cuefilter
= #(define-music-function
(parser location music
) (ly
:music?
)
589 ((ly
:music-function-extract removeWithTag
) parser location
'cued
((ly
:music-function-extract killCues
) parser location music
))
592 #(define-public
(oly
:add-toc-item parser markup-symbol text
)
593 (oly
:music
_handler parser
(add-toc-item
! markup-symbol text
)))
596 #(define
(oly
:add-score parser score piecename
)
597 (if
(not-null? piecename
)
598 (oly
:add-toc-item parser
'tocItemMarkup piecename
))
599 (oly
:score
_handler parser score
)
601 % The helper function to build a score.
602 #(define
(oly
:createScoreHelper parser location piece children func
)
604 (staves
(oly
:staff
_group
_handler parser piece
"" "SimultaneousMusic" children
))
605 (music
(if
(not-null? staves
)
606 ((ly
:music-function-extract func
) parser location staves
)
610 (piecename
(namedPieceInstrObject piece
(car children
) "PieceName"))
611 (piecenametacet
(namedPieceInstrObject piece
(car children
) "PieceNameTacet"))
615 ; No staves
, print tacet
617 (if
(not-null? piecenametacet
) (set
! piecename piecenametacet
))
618 (if
(not-null? piecename
)
619 (oly
:add-score parser
(list
(oly
:piece-title-markup piecename
)) piecename
)
620 (ly
:warning
(_ "No music and no score title found for part ~a and instrument ~a") piece children
)
623 ; we have staves
, apply the piecename to the score and add layout
/midi blocks if needed
625 (set
! score
(scorify-music music parser
))
626 (oly
:set
_piece
_header score piecename
)
627 (oly
:apply
_score
_midi score
)
628 (oly
:apply
_score
_layout score
)
629 ; Schedule the score for typesetting
630 (oly
:add-score parser score piecename
)
634 ; This is
a void function
, the score has been schedulled for typesetting already
635 (make-music
'Music
'void
#t
)
638 createScore
= #(define-music-function
(parser location piece children
) (string? list?
)
639 (oly
:createScoreHelper parser location piece children identity
)
641 createNoCuesScore
= #(define-music-function
(parser location piece children
) (string? list?
)
642 (oly
:createScoreHelper parser location piece children cuefilter
)
645 createHeadline
= #(define-music-function
(parser location headline
) (string?
)
646 (oly
:add-toc-item parser
'tocItemMarkup headline
)
647 (oly
:score
_handler parser
(list
(oly
:piece-title-markup headline
)))
648 (make-music
'Music
'void
#t
)
653 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
654 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
656 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
657 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
659 % set the cue instrument name
660 setCue
= #(define-music-function
(parser location instr
) (string?
)
661 #{ \set Voice
.instrumentCueName
= $instr
#} )
663 % generate a cue music section with instrument names
664 % Parameters: \namedCueDuring NameOfQuote CueDirection CueInstrument OriginalInstrument music
665 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
666 % -) CueInstrument and OriginalInstrument are the displayed instrument names
668 % \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 }
669 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
670 % the beginning of the cue notes and "Sop." at the end
671 namedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr cuemusic
) (string? number? string? string? ly
:music?
)
673 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\setCue #$instrcue $cuemusic
\tag #'cued
\setCue #$instr
}
674 % \tag #'uncued $cuemusic
677 namedTransposedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr trans cuemusic
) (string? number? string? string? ly
:music? ly
:music?
)
679 \transposedCueDuring #$cuevoice
#$direction $trans
{ \tag #'cued
\setCue #$instrcue $cuemusic
\tag #'cued
\setCue #$instr
}
680 % \tag #'uncued $cuemusic
684 % set the cue instrument name and clef
685 setClefCue
= #(define-music-function
(parser location instr clef
)
688 \once \override Staff
.Clef
#'font-size
= #-
3 $clef
689 \set Voice
.instrumentCueName
= $instr
692 % generate a cue music section with instrument names and clef changes
693 % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music
694 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
695 % -) CueInstrument and OriginalInstrument are the displayed instrument names
696 % -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containing voice
698 % \cleffedCueDuring #"vIQuote" #UP #"V.I" #"treble" #"Basso" #"bass" { R1*3 }
699 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
700 % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble at the
701 % beginning of the cue notes and reset to bass at the end
702 cleffedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue clefcue instr clefinstr cuemusic
)
703 (string? number? string? ly
:music? string? ly
:music? ly
:music?
)
705 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\setClefCue #$instrcue $clefcue $cuemusic
\tag #'cued
\setClefCue #$instr $clefinstr
}
706 % \tag #'uncued $cuemusic
713 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
714 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
720 shiftDynamics
= #(define-music-function
(parser location xshift yshift
) (number? number?
)
722 \once \override DynamicTextSpanner
#'padding
= $yshift
723 \once\override DynamicText
#'extra-offset
= #(cons $xshift $yshift
)
726 ffz
= #(make-dynamic-script
"ffz")
727 pf
= #(make-dynamic-script
"pf")
728 sempp
= #(make-dynamic-script
(markup
#:line
( #:with-dimensions
'(0 . 0)
729 '(0 . 0) #:right-align
#:normal-text
#:italic
"sempre" #:dynamic
"pp")))
730 parenf
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"f" #:normal-text
#:italic
#:fontsize
2 ")" )))
731 parenp
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"p" #:normal-text
#:italic
#:fontsize
2 ")" )))
732 pdolce
= #(make-dynamic-script
(markup
#:line
(#:dynamic
"p" #:with-dimensions
'(0 . 0) '(0 . 0) #:normal-text
#:italic
"dolce" )))
736 dim
= #(make-span-event
'DecrescendoEvent START
)
737 enddim
= #(make-span-event
'DecrescendoEvent STOP
)
738 decresc
= #(make-span-event
'DecrescendoEvent START
)
739 enddecresc
= #(make-span-event
'DecrescendoEvent STOP
)
740 cresc
= #(make-span-event
'CrescendoEvent START
)
741 endcresc
= #(make-span-event
'CrescendoEvent STOP
)
744 \set crescendoText
= \markup { \italic "cresc." }
745 \set crescendoSpanner
= #'text
746 \override DynamicTextSpanner
#'style
= #'dashed-line
749 \set decrescendoText
= \markup { \italic "decresc." }
750 \set crescendoSpanner
= #'text
751 \override DynamicTextSpanner
#'style
= #'dashed-line
754 \set decrescendoText
= \markup { \italic "dim." }
755 \set crescendoSpanner
= #'text
756 \override DynamicTextSpanner
#'style
= #'dashed-line
759 newOrOldClef
= #(define-music-function
(parser location new old
) (string? string?
)
760 (if
(ly
:get-option
'old-clefs
) #{ \clef $old
#} #{ \clef $new
#})
765 %%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
766 % to remove also the fermata from R1-\fermataMarkup: By filtering the music
767 % and removing the corresponding events.
768 % Documented as an LSR snippet: http://lsr.dsi.unimi.it/LSR/Item?id=372
769 #(define
(filterOneEventsMarkup event
)
770 ( let
( (eventname
(ly
:music-property event
'name
)) )
772 (or ;; add here event name you do NOT want
773 (eq? eventname
'MultiMeasureTextEvent
)
774 (eq? eventname
'AbsoluteDynamicEvent
)
775 (eq? eventname
'TextScriptEvent
)
776 (eq? eventname
'ArticulationEvent
)
777 (eq? eventname
'CrescendoEvent
)
778 (eq? eventname
'DecrescendoEvent
)
783 filterArticulations
= #(define-music-function
(parser location music
) (ly
:music?
)
784 Â Â
(music-filter filterOneEventsMarkup music
)
797 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
798 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
799 %%%%% REST COMBINATION
800 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
801 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
805 %% REST COMBINING, TAKEN FROM http://lsr.dsi.unimi.it/LSR/Item?id=336
808 %% \new Staff \with {
809 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
810 %% } << \somevoice \\ \othervoice >>
815 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
820 %% - only handles two voices
821 %% - does not handle multi-measure/whole-measure rests
823 #(define
(rest-score r
)
825 (yoff
(ly
:grob-property-data r
'Y-offset
))
826 (sp
(ly
:grob-property-data r
'staff-position
)))
828 (set
! score
(+ score
2))
829 (if
(eq? yoff
'calculation-in-progress
)
830 (set
! score
(- score
3))))
833 (set
! score
(+ score
2))
834 (set
! score
(- score
(abs
(-
1 sp
)))))
837 #(define
(merge-rests-on-positioning grob
)
838 (let
* ((can-merge
#f)
839 (elts
(ly
:grob-object grob
'elements
))
840 (num-elts
(and
(ly
:grob-array? elts
)
841 (ly
:grob-array-length elts
)))
842 (two-voice?
(= num-elts
2)))
844 (let
* ((v
1-grob
(ly
:grob-array-ref elts
0))
845 (v
2-grob
(ly
:grob-array-ref elts
1))
846 (v
1-rest
(ly
:grob-object v
1-grob
'rest
))
847 (v
2-rest
(ly
:grob-object v
2-grob
'rest
)))
851 (let
* ((v
1-duration-log
(ly
:grob-property v
1-rest
'duration-log
))
852 (v
2-duration-log
(ly
:grob-property v
2-rest
'duration-log
))
853 (v
1-dot
(ly
:grob-object v
1-rest
'dot
))
854 (v
2-dot
(ly
:grob-object v
2-rest
'dot
))
855 (v
1-dot-count
(and
(ly
:grob? v
1-dot
)
856 (ly
:grob-property v
1-dot
'dot-count -
1)))
857 (v
2-dot-count
(and
(ly
:grob? v
2-dot
)
858 (ly
:grob-property v
2-dot
'dot-count -
1))))
861 (number? v
1-duration-log
)
862 (number? v
2-duration-log
)
863 (= v
1-duration-log v
2-duration-log
)
864 (eq? v
1-dot-count v
2-dot-count
)))
866 ;; keep the rest that looks best
:
867 (let
* ((keep-v
1?
(>= (rest-score v
1-rest
)
868 (rest-score v
2-rest
)))
869 (rest-to-keep
(if keep-v
1? v
1-rest v
2-rest
))
870 (dot-to-kill
(if keep-v
1? v
2-dot v
1-dot
)))
871 ;; uncomment if you
're curious of which rest was chosen
:
872 ;;
(ly
:grob-set-property
! v
1-rest
'color green
)
873 ;;
(ly
:grob-set-property
! v
2-rest
'color blue
)
874 (ly
:grob-suicide
! (if keep-v
1? v
2-rest v
1-rest
))
875 (if
(ly
:grob? dot-to-kill
)
876 (ly
:grob-suicide
! dot-to-kill
))
877 (ly
:grob-set-property
! rest-to-keep
'direction
0)
878 (ly
:rest
::y-offset-callback rest-to-keep
)))))))
881 (ly
:rest-collision
::calc-positioning-done grob
))))
887 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
888 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
889 %%%%% TABLE OF CONTENTS
890 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
891 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
894 contentsTitle
= "Inhalt / Contents"
897 tocTitleMarkup
= \markup \fill-line
{
900 \override #(cons
'line-width
(* 7 cm
))
901 \line{ \fill-line
{\piece-title
{\contentsTitle} \null }}
906 tocItemMarkup
= \markup \fill-line
{
909 \override #(cons
'line-width
(* 7 cm
))
910 \line { \fill-line
{\fromproperty #'toc
:text
\fromproperty #'toc
:page
}}
917 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
918 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
919 %%%%% TITLE PAGE / HEADER
920 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
921 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
923 #(define-markup-command
(when-property layout props symbol markp
) (symbol? markup?
)
924 (if
(chain-assoc-get symbol props
)
925 (interpret-markup layout props markp
)
926 (ly
:make-stencil
'() '(1 . -
1) '(1 . -
1))))
928 #(define-markup-command
(vspace layout props amount
) (number?
)
929 "This produces a invisible object taking vertical space."
930 (let
((amount
(* amount
3.0)))
932 (ly
:make-stencil
"" (cons -
1 1) (cons
0 amount
))
933 (ly
:make-stencil
"" (cons -
1 1) (cons amount amount
)))))
937 titlePageMarkup
= \markup { \fontsize #2 \when-property
#'header
:title
\column {
939 \fill-line
{ \fontsize #8 \fromproperty #'header
:composer
}
941 \fill-line
{ \fontsize #8 \fromproperty #'header
:poet
}
943 \fill-line
{ \fontsize #10 \bold \fromproperty #'header
:titlepagetitle
}
945 \fontsize #2 \when-property
#'header
:titlepagesubtitle
{
946 \fill-line
{ \fromproperty #'header
:titlepagesubtitle
}
949 \fill-line
{ \postscript #"-20 0 moveto 40 0 rlineto stroke" }
951 \fill-line
{ \fontsize #5 \fromproperty #'header
:ensemble
}
953 \fill-line
{ \fontsize #2 \fromproperty #'header
:instruments
}
955 \fill-line
{ \fontsize #5 \fromproperty #'header
:date
}
957 \fill-line
{ \fontsize #5 \fromproperty #'header
:scoretype
}
959 \fontsize #2 \when-property
#'header
:enteredby
{
960 \fill-line
{ "Herausgegeben von: / Edited by:"}
962 \fill-line
{ \fromproperty #'header
:enteredby
}
965 \when-property
#'header
:arrangement
\column {
967 \fill-line
{ \fontsize #3 \fromproperty #'header
:arrangement
}
973 titleHeaderMarkup
= \markup {
974 \override #'(baseline-skip
. 3.5)
976 \override #'(baseline-skip
. 3.5)
980 \bigger \fromproperty #'header
:title
983 \large \smaller \bold
984 \bigger \fromproperty #'header
:subtitle
988 \fromproperty #'header
:subsubtitle
991 { \large \bold \fromproperty #'header
:instrument
}
994 \fromproperty #'header
:poet
995 \fromproperty #'header
:composer
998 \fromproperty #'header
:meter
999 \fromproperty #'header
:arranger
1005 titleScoreMarkup
= \markup \piece-title
\fromproperty #'header
:piece
1008 scoreTitleMarkup
= \titleScoreMarkup
1009 bookTitleMarkup
= \titleHeaderMarkup
1014 %%%%%%%%%%%%%% headers and footers %%%%%%%%%%%%%%%%%%%%%%%%%%
1016 #(define
(first-score-page layout props arg
)
1017 (let
* ((label
'first-score-page
)
1018 (table
(ly
:output-def-lookup layout
'label-page-table
))
1019 (label-page
(and
(list? table
) (assoc label table
)))
1020 (page-number
(and label-page
(cdr label-page
)))
1022 (if
(eq?
(chain-assoc-get
'page
:page-number props -
1) page-number
)
1023 (interpret-markup layout props arg
)
1026 #(define no-header-table
'())
1027 thisPageNoHeader
= #(define-music-function
(parser location
) ()
1028 (let
* ((label
(gensym
"header")))
1029 (set
! no-header-table
(cons label no-header-table
))
1032 'page-label label
)))
1035 % TODO: Use the no-header-table!
1036 #(define
(is-header-page layout props arg
)
1037 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1039 (if
(and
(> page-number
2) (!= page-number
7))
1040 (interpret-markup layout props arg
)
1043 #(define no-footer-table
'())
1044 thisPageNoFooter
= #(define-music-function
(parser location
) ()
1045 (let
* ((label
(gensym
"footer")))
1046 (set
! no-footer-table
(cons label no-footer-table
))
1049 'page-label label
)))
1051 % TODO: Use the no-footer-table!
1052 #(define
(is-footer-page layout props arg
)
1053 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1054 (label
'first-score-page
)
1055 (table
(ly
:output-def-lookup layout
'label-page-table
))
1056 (label-page
(and
(list? table
) (assoc label table
)))
1057 ;
(page-number
(and label-page
(cdr label-page
)))
1059 (if
(and
(> page-number
2) (!= page-number
7))
1060 (interpret-markup layout props arg
)
1064 #(define copyright-footer-table
'())
1065 thisPageCopyrightFooter
= #(define-music-function
(parser location
) ()
1066 (let
* ((label
(gensym
"copyrightfooter")))
1067 (set
! copyright-footer-table
(cons label copyright-footer-table
))
1070 'page-label label
)))
1072 % TODO: Use the copyright-footer-table!
1073 #(define
(copyright-page layout props arg
)
1074 (if
(= (chain-assoc-get
'page
:page-number props -
1) 7)
1075 (interpret-markup layout props arg
)
1080 oddHeaderMarkup
= \markup \fill-line
{
1081 %% force the header to take some space, otherwise the
1082 %% page layout becomes a complete mess.
1084 \on-the-fly
#is-header-page
\fromproperty #'header
:title
1085 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1087 evenHeaderMarkup
= \markup \fill-line
{
1088 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1089 \on-the-fly
#is-header-page
\fromproperty #'header
:composer
1093 oddFooterMarkup
= \markup {
1096 %% publisher header field only on title page.
1097 \on-the-fly
#first-page
\fromproperty #'header
:publisher
1100 %% copyright on the first real score page
1101 \on-the-fly
#copyright-page
\fromproperty #'header
:copyright
1102 \on-the-fly
#copyright-page
\null
1105 %% All other pages get the number of the edition centered
1106 \on-the-fly
#is-footer-page
\fromproperty #'header
:scorenumber
1123 % Interpret the given markup with the header fields added to the props.
1124 % This way, one can re-use the same functions (using fromproperty
1125 % #'header:field) in the header block and as top-level markup.
1127 % This function is originally copied from mark-up-title (file scm/titling.scm),
1128 % which is lilypond's internal function to handle the title markups. I needed
1129 % to replace the scopes and manually add the $defaultheader (which is internally
1130 % done in paper-book.cc before calling mark-up-title. Also, I don't extract the
1131 % markup from the header block, but use the given markup.
1133 % I'm not sure if I really need the page properties in props, too... But I
1134 % suppose it does not hurt, either.
1135 #(define-markup-command
(markupWithHeader layout props markup
) (markup?
)
1136 "Interpret the given markup with the header fields added to the props.
1137 This way, one can re-use the same functions (using fromproperty
1138 #'header:field) in the header block and as top-level markup."
1140 ; TODO
: I
f we are inside
a score
, add the score
's local header block
, too
!
1141 ; Currently
, I only use the global header block
, stored in $defaultheader
1142 (scopes
(list $defaultheader
))
1143 (alists
(map ly
:module-
>alist scopes
))
1146 (map
(lambda
(alist
)
1147 (map
(lambda
(entry
)
1149 (string-
>symbol
(string-append
"header:" (symbol-
>string
(car entry
))))
1153 (props
(append prefixed-alist
1155 (layout-extract-page-properties layout
)))
1157 (interpret-markup layout props markup
)
1166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1167 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1168 %%%%% Equally spacing multiple columns (e.g. for translations)
1169 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1170 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1172 % Credits: Nicolas Sceaux on the lilypond-user mailinglist
1173 #(define-markup-command
(columns layout props args
) (markup-list?
)
1174 (let
((line-width
(/ (chain-assoc-get
'line-width props
1175 (ly
:output-def-lookup layout
'line-width
))
1176 (max
(length args
) 1))))
1177 (interpret-markup layout props
1178 (make-line-markup
(map
(lambda
(line
)
1179 (markup
#:pad-to-box `
(0 . ,line-width
) '(0 . 0)
1180 #:override `
(line-width
. ,line-width
)
1185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1187 %%%%% Defaults for instrument names, short names, cue names, etc.
1188 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1189 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1191 %%% Clef definitions, either old-style (using the Breitkopf style) or new style
1192 FlClef
= \clef "treble"
1195 O
bClef
= \clef "treble"
1198 ClIClef
= \clef "treble"
1200 FagClef
= \clef "bass"
1202 FagIIClef
= \FagClef
1203 CFagClef
= \clef "bass"
1204 CorClef
= \clef "treble"
1206 CorIIClef
= \CorClef
1207 TrClef
= \clef "tenor"
1210 TrIIIClef
= \clef "bass"
1211 TbeIClef
= \clef "treble"
1212 TbeIIClef
= \clef "treble"
1213 TimClef
= \clef "bass"
1214 VClef
= \clef "treble"
1217 V
aClef
= \clef "alto"
1220 V
cBClef
= \clef "bass"
1223 SClef
= \clef "treble"
1224 AClef
= \clef "treble"
1225 TClef
= \clef "treble_8"
1226 BClef
= \clef "bass"
1231 OIClef
= \clef "treble"
1232 OIIClef
= \clef "bass"
1236 FlInstrumentName
= "Flauti"
1237 FlIInstrumentName
= "Flauto I"
1238 FlIIInstrumentName
= "Flauto II"
1239 O
bInstrumentName
= "Oboi"
1240 O
bIInstrumentName
= "Oboe I"
1241 O
bIIInstrumentName
= "Oboe II"
1242 ClInstrumentName
= "Clarinetti"
1243 ClIInstrumentName
= "Clarinetto I"
1244 ClIIInstrumentName
= "Clarinetto II"
1245 FagInstrumentName
= "Fagotti"
1246 FagIInstrumentName
= "Fagotto I"
1247 FagIIInstrumentName
= "Fagotto II"
1248 CFagInstrumentName
= "Contrafagotto"
1249 CorInstrumentName
= "Corni"
1250 CorIInstrumentName
= "Corno I"
1251 CorIIInstrumentName
= "Corno II"
1252 TrInstrumentName
= "Tromboni"
1253 TrIInstrumentName
= "Trombone I"
1254 TrIIInstrumentName
= "Trombone II"
1255 TrIIIInstrumentName
= "Trombone III"
1256 TbeInstrumentName
= "Trombe"
1257 TbeIInstrumentName
= "Tromba I"
1258 TbeIIInstrumentName
= "Tromba II"
1259 TimInstrumentName
= "Timpani"
1260 VIInstrumentName
= "Violino I"
1261 VIIInstrumentName
= "Violino II"
1262 V
aInstrumentName
= "Viola"
1263 V
aIInstrumentName
= "Viola I"
1264 V
aIIInstrumentName
= "Viola II"
1265 V
cBInstrumentName
= \markup {\column { "Cello e" "Contrabbasso"}}
1266 V
cInstrumentName
="Violoncello"
1267 C
bInstrumentName
="Basso"
1268 SInstrumentName
= "Soprano"
1269 AInstrumentName
= "Alto"
1270 TInstrumentName
= "Tenore"
1271 BInstrumentName
= "Basso"
1272 SSoloInstrumentName
= "Soprano Solo"
1273 TSoloInstrumentName
= "Tenore Solo"
1274 BSoloInstrumentName
= "Basso Solo"
1275 ASoloInstrumentName
= "Alto Solo"
1276 OInstrumentName
= "Organo"
1278 C
hInstrumentTitle
= "Coro"
1281 FlShortInstrumentName
= "Fl."
1282 FlIShortInstrumentName
= "Fl. I"
1283 FlIIShortInstrumentName
= "Fl. II"
1284 O
bShortInstrumentName
= "Ob."
1285 O
bIShortInstrumentName
= "Ob. I"
1286 O
bIIShortInstrumentName
= "Ob. II"
1287 ClShortInstrumentName
= "Cl."
1288 ClIShortInstrumentName
= "Cl.I"
1289 ClIIShortInstrumentName
= "Cl.II"
1290 FagShortInstrumentName
= "Fag."
1291 FagIShortInstrumentName
= "Fag. I"
1292 FagIIShortInstrumentName
= "Fag. II"
1293 CFagShortInstrumentName
= "Cfag."
1294 CorShortInstrumentName
= "Cor."
1295 CorIShortInstrumentName
= "Cor.I"
1296 CorIIShortInstrumentName
= "Cor.II"
1297 TrShortInstrumentName
= "Tr."
1298 TrIShortInstrumentName
= "Tr. I"
1299 TrIIShortInstrumentName
= "Tr. II"
1300 TrIIIShortInstrumentName
= "Tr. III"
1301 TbeShortInstrumentName
= "Tbe."
1302 TbeIShortInstrumentName
= "Tbe.I"
1303 TbeIIShortInstrumentName
= "Tbe.II"
1304 TimShortInstrumentName
= "Tim."
1305 VIShortInstrumentName
= "V.I"
1306 VIIShortInstrumentName
= "V.II"
1307 V
aShortInstrumentName
= "Va."
1308 V
aIShortInstrumentName
= "Va.I"
1309 V
aIIShortInstrumentName
= "Va.II"
1310 V
cBShortInstrumentName
= \markup{\column{"Vc." "e B."}}
1311 V
cShortInstrumentName
= "Vc."
1312 C
bShortInstrumentName
= "B."
1313 SShortInstrumentName
= "S."
1314 AShortInstrumentName
= "A."
1315 TShortInstrumentName
= "T."
1316 BShortInstrumentName
= "B."
1317 SSoloShortInstrumentName
= "S.Solo"
1318 ASoloShortInstrumentName
= "A.Solo"
1319 TSoloShortInstrumentName
= "T.Solo"
1320 BSoloShortInstrumentName
= "B.Solo"
1321 OShortInstrumentName
= "Org."
1325 newInstrument
= #(define-music-function
(parser location instr
) (string?
)
1327 \set Voice
.instrumentCueName
= #$
(string-join
(list
"+" instr
))
1330 cueText
= #(define-music-function
(parser location instr
) (string?
)
1332 \set Voice
.instrumentCueName
= $instr
1363 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1364 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1365 %%%%% SCORE NUMBERS FOR PUBLISHING
1366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1370 #(define-markup-command
(scoreNumber layout props nr
) (markup?
)
1371 (interpret-markup layout props
(markup
(format
"~a-~a" EKnumber nr
)))
1374 FullScoreNumber
= "1"
1375 PianoScoreNumber
= "2"
1376 VocalScoreNumber
= "3"
1378 ChoirScoreNumber
= "10"
1383 SoloScoreNumber
= "15"
1391 InstrumentsNumber
= "25"
1421 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1423 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1425 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1430 % line-width = 17\cm
1431 bottom-margin
= 1\cm
1433 % after-title-space = 0.5\cm
1435 ragged-last-bottom
= ##f
1440 % If only one non-empty staff in a system exists, still print the backet
1441 \override SystemStartBracket
#'collapse-height
= #1
1442 \consists "Instrument_name_engraver"
1446 % If only one non-empty staff in a system exists, still print the backet
1447 \override SystemStartBracket
#'collapse-height
= #1
1448 \consists "Instrument_name_engraver"
1452 \override SystemStartBracket
#'collapse-height
= #1
1453 \consists "Instrument_name_engraver"
1457 % Force multi-measure rests to be written as one span
1458 \override MultiMeasureRest
#'expand-limit
= #3
1461 % hairpinToBarline = ##f
1462 \override BarNumber
#'break-visibility
= #end-of-line-invisible
1463 \override CombineTextScript
#'avoid-slur
= #'outside
1464 barNumberVisibility
= #(every-nth-bar-number-visible
5)
1465 \override DynamicTextSpanner
#'dash-period
= #-
1.0
1466 \override InstrumentSwitch
#'font-size
= #-
1
1469 \override RestCollision
#'positioning-done
= #merge-rests-on-positioning
1470 % Auto-Accidentals: Use modern-cautionary style...
1472 autoAccidentals
= #'(Staff
(same-octave
. 0))
1473 autoCautionaries
= #'(Staff
(any-octave
. 0) (same-octave
. 1))
1474 printKeyCancellation
= ##t
1477 \RemoveEmptyStaffContext
1481 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(0.5 . 0.5)
1489 \type "Engraver_group"
1491 % So that \cresc works, for example.
1493 \consists "Output_property_engraver"
1495 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(-
1 . 1)
1496 pedalSustainStrings
= #'("Ped." "*Ped." "*")
1497 pedalUnaCordaStrings
= #'("una corda" "" "tre corde")
1499 \consists "Piano_pedal_engraver"
1500 \consists "Script_engraver"
1501 \consists "Dynamic_engraver"
1502 \consists "Text_engraver"
1504 \override TextScript
#'font-size
= #2
1505 \override TextScript
#'font-shape
= #'italic
1506 \override DynamicText
#'extra-offset
= #'(0 . 2.5)
1507 \override Hairpin
#'extra-offset
= #'(0 . 2.5)
1509 \consists "Skip_event_swallow_translator"
1511 \consists "Axis_group_engraver"
1516 % \override VerticalAlignment #'forced-distance = #7