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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
18 #(use-modules
(ice-
9 match
))
21 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
23 %%%%% SCORE STRUCTURE AND AUTOMATIC GENERATION
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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
)
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
)))
45 ((defined? fullname
) (primitive-eval fullname
))
46 ((defined? instrname
) (primitive-eval instrname
))
47 ((defined? piecename
) (primitive-eval piecename
))
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
)
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
)
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
)
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
)
138 ((string? type
) (string-
>symbol type
))
139 ((symbol? type
) type
)
144 #(define
(oly
:extractPitch music
)
146 (elems
(if
(ly
:music? music
) (ly
:music-property music
'elements
)))
147 (note
(if
(pair? elems
) (car elems
)))
148 (pitch
(if
(ly
:music? note
) (ly
:music-property note
'pitch
)))
150 (if
(and
(not-null? music
) (not
(ly
:pitch? pitch
)))
151 (ly
:warning
"Unable to interpret as a pitch!")
157 #(define
(oly
:extractTranspositionPitch piece name
)
159 (trpFromPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeFrom")))
160 (trpToPitch
(oly
:extractPitch
(namedPieceInstrObject piece name
"TransposeTo")))
162 (if
(ly
:pitch? trpFromPitch
)
163 (if
(ly
:pitch? trpToPitch
)
165 (ly
:pitch-diff trpFromPitch trpToPitch
)
166 (ly
:pitch-diff trpFromPitch
(ly
:make-pitch
0 0 0))
168 (if
(ly
:pitch? trpToPitch
)
169 (ly
:pitch-diff
(ly
:make-pitch
0 0 0) trpToPitch
)
176 #(define
(oly
:voice
_handler
_internal parser piece name type music
)
178 (tempo
(namedPieceInstrObject piece name
"Tempo"))
179 (lyrics
(namedPieceInstrObject piece name
"Lyrics"))
180 (trpPitch
(oly
:extractTranspositionPitch piece name
))
184 (if
(ly
:music? lyrics
)
185 (set
! musiccontent
(append musiccontent
(list dynamicUp
)))
186 (if
(not-null? lyrics
) (ly
:warning
(_ "Wrong type (no lyrics) for lyrics for instrument ~S in piece ~S") name piece
))
188 ; Append the settings
, key and clef
(if defined
)
191 (let
* ((object
(namedPieceInstrObject piece name type
)))
192 (if
(ly
:music? object
)
193 (set
! musiccontent
(append musiccontent
(list object
)))
194 (if
(not-null? object
) (ly
:warning
(_ "Wrong type (no ly:music) for ~S for instrument ~S in piece ~S") type name piece
))
198 '("Settings" "Key" "Clef" "TimeSignature")
201 (if
(ly
:music? music
)
203 (set
! musiccontent
(make-simultaneous-music
(append musiccontent
(list music
))))
204 ;
(ly
:message
"Generating staff for ~a" name
)
205 (if
(ly
:pitch? trpPitch
)
206 (set
! musiccontent
(ly
:music-transpose musiccontent trpPitch
))
210 (voicename
(oly
:generate
_object
_name piece name
"Voice" ))
211 (voicetype
(oly
:staff
_type type
))
212 (voice
(context-spec-music musiccontent voicetype voicename
))
213 (staffcont
(list voice
))
215 ; I
f we have lyrics
, create
a lyrics context containing LyricCombineMusic
216 ; and add that
as second element to the staff
's elements list
...
217 (if
(ly
:music? lyrics
)
219 (lyricsname
(oly
:generate
_object
_name piece name
"Lyrics" ))
220 (lyricscont
(make-music
'LyricCombineMusic
'element lyrics
'associated-context voicename
))
222 (set
! staffcont
(append staffcont
223 (list
(context-spec-music lyricscont
'Lyrics lyricsname
))))
229 ; For empty music
, return empty
235 #(define
(oly
:voice
_handler parser piece name type
)
236 (let
* ((music
(oly
:get
_music
_object piece name
))
238 (oly
:voice
_handler
_internal parser piece name type music
)
243 #(define
(oly
:staff
_handler
_internal parser piece name type voices
)
244 (if
(not-null? voices
)
246 (staffname
(oly
:generate
_staff
_name piece name
))
247 (stafftype
(oly
:staff
_type type
))
248 (staff
(make-simultaneous-music voices
))
249 (propops
(oly
:staff
_handler
_properties piece name
))
252 ((SimultaneousMusic ParallelMusic
) #f)
253 (else
(set
! staff
(context-spec-music staff stafftype staffname
)))
255 (if
(not-null? propops
)
256 (set
! (ly
:music-property staff
'property-operations
) propops
)
260 ; For empty music
, return empty
265 #(define
(oly
:staff
_handler parser piece name type children
)
266 (let
* ((c (if
(not-null? children
) children
(list name
)))
267 (voices
(apply append
(map
(lambda
(v
) (oly
:create
_voice parser piece v
)) c)) )
269 (if
(not-null? voices
)
270 (oly
:staff
_handler
_internal parser piece name type voices
)
276 #(define
(oly
:parallel
_voices
_staff
_handler parser piece name type children
)
278 (voices
(map
(lambda
(i
) (oly
:create
_voice parser piece i
)) children
))
279 ; get the lsit of non-empty voices and flatten it
!
280 (nonemptyvoices
(apply append
(filter not-null? voices
)))
282 (if
(not-null? nonemptyvoices
)
283 (oly
:staff
_handler
_internal parser piece name
"Staff" nonemptyvoices
)
289 #(define
(oly
:part
_combined
_staff
_handler parser piece name type children
)
290 (let
* ((music
(oly
:get
_music
_objects piece children
)))
292 ((and
(pair? music
) (ly
:music?
(car music
)) (not-null?
(cdr music
)) (ly
:music?
(cadr music
)))
293 ;
(ly
:message
"Part-combine with two music expressions")
294 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(make-part-combine-music parser music
))))
296 (ly
:warning
"Part-combine without any music expressions")
298 ; exactly one is
a music expression
, simply use that by joining
300 (ly
:message
"Part-combine with only one music expressions")
301 (oly
:staff
_handler
_internal parser piece name
"Staff" (list
(apply append music
))))
303 ;
(ly
:message
"make_part_combined_staff: ~S ~S ~a" piece instr instruments
)
309 % Generate the properties for the staff for piece and instr. Typically, these
310 % are the instrument name and the short instrument name (if defined).
311 % return a (possibly empty) list of all assignments.
312 #(define
(oly
:staff
_handler
_properties piece instr
)
315 (instrumentName
. "InstrumentName")
316 (shortInstrumentName
. "ShortInstrumentName")
317 (midiInstrument
. "MidiInstrument")
321 (oly
:generate
_property
_pair
(car pr
) piece instr
(cdr pr
))
324 (props
(filter not-null? assignments
))
330 % Figured bass is a special case, as it can be voice- or staff-type. When
331 % given as a staff type, simply call the voice handler, instead
333 #(define
(oly
:figured
_bass
_staff
_handler parser piece name type children
)
334 (let
* ((c (if
(not-null? children
) children
(list name
)))
335 (voice
(oly
:voice
_handler parser piece
(car
c) type
)))
336 (if
(pair? voice
) (car voice
) ())
341 #(define
(oly
:staff
_group
_handler parser piece name type children
)
343 (staves
(map
(lambda
(i
) (oly
:create
_staff
_or
_group parser piece i
)) children
))
344 (nonemptystaves
(filter not-null? staves
))
346 (if
(not-null? nonemptystaves
)
348 (musicexpr
(if
(= 1 (length nonemptystaves
))
350 (make-simultaneous-music nonemptystaves
)))
351 (groupname
(oly
:generate
_staff
_name piece name
))
352 (grouptype
(oly
:staff
_type type
))
354 (propops
(oly
:staff
_handler
_properties piece name
))
357 ((SimultaneousMusic ParallelMusic
) #f)
358 (else
(set
! group
(context-spec-music group grouptype groupname
)))
360 (set
! (ly
:music-property group
'property-operations
) propops
)
363 ; Return empty list if no staves are generated
369 #(define oly
:staff
_handlers
372 '("GrandStaff" . oly
:staff
_group
_handler
)
373 '("PianoStaff" . oly
:staff
_group
_handler
)
374 '("ChoirStaff" . oly
:staff
_group
_handler
)
375 '("StaffGroup" . oly
:staff
_group
_handler
)
376 '("InnerChoirStaff" . oly
:staff
_group
_handler
)
377 '("InnerStaffGroup" . oly
:staff
_group
_handler
)
378 '("ParallelMusic" . oly
:staff
_group
_handler
)
379 '("SimultaneousMusic" . oly
:staff
_group
_handler
)
381 '("Staff" . oly
:staff
_handler
)
382 '("DrumStaff" . oly
:staff
_handler
)
383 '("RhythmicStaff" . oly
:staff
_handler
)
384 '("TabStaff" . oly
:staff
_handler
)
385 '("GregorianTranscriptionStaff" . oly
:staff
_handler
)
386 '("MensuralStaff" . oly
:staff
_handler
)
387 '("VaticanaStaff" . oly
:staff
_handler
)
388 ; staves with multiple voices
389 '("PartCombinedStaff" . oly
:part
_combined
_staff
_handler
)
390 '("ParallelVoicesStaff" . oly
:parallel
_voices
_staff
_handler
)
391 ; special cases
: Figured bass can be staff or voice type
!
392 '("FiguredBass" . oly
:figured
_bass
_staff
_handler
)
396 #(define oly
:voice
_handlers
399 '("Voice" . oly
:voice
_handler
)
400 '("CueVoice" . oly
:voice
_handler
)
401 '("DrumVoice" . oly
:voice
_handler
)
402 '("FiguredBass" . oly
:voice
_handler
)
403 '("GregorianTranscriptionVoice" . oly
:voice
_handler
)
404 '("NoteNames" . oly
:voice
_handler
)
405 '("TabVoice" . oly
:voice
_handler
)
406 '("VaticanaVoice" . oly
:voice
_handler
)
407 ;
'("Dynamics" . oly
:dynamics
_handler
)
411 #(define
(oly
:create
_voice parser piece name
)
412 (let
* ( (voice
(namedPieceInstrObject piece name
"Voice"))
413 (type
(assoc-ref oly
:voice
_types name
)) )
414 (if
(not-null? voice
)
415 ; Explicit voice variable
, use that
419 ; No entry in structure found
=> simple voice
420 (oly
:voice
_handler parser piece name
"Voice")
421 ; Entry found in structure
=> use the handler for the given type
423 (voicetype
(car type
))
424 (handler
(assoc-ref oly
:voice
_handlers voicetype
))
427 ((primitive-eval handler
) parser piece name voicetype
)
429 (ly
:warning
"No handler found for voice type ~a, using default voice handler" voicetype
)
430 (oly
:voice
_handler parser piece name voicetype
)
439 #(define
(oly
:create
_staff
_or
_group parser piece name
)
440 (let
* ( (staff
(namedPieceInstrObject piece name
"Staff"))
441 (type
_from
_structure
(assoc-ref oly
:orchestral
_score
_structure name
)) )
442 ;
(if
(not-null? staff
)
443 ;
(ly
:message
"Found staff variable for instrument ~a in piece ~a" instr piece
)
444 ;
(ly
:message
"Staff variable for instrument ~a in piece ~a NOT FOUND" instr piece
)
446 (if
(not-null? staff
)
447 ; Explicit staff variable
, use that
450 (if
(not
(list? type
_from
_structure
))
451 ; No entry in structure found
=> simple staff
452 (oly
:staff
_handler parser piece name
"Staff" '())
454 ; Entry found in structure
=> use the handler for the given type
455 (let
* ((type
(car type
_from
_structure
))
456 (handler
(assoc-ref oly
:staff
_handlers type
))
457 (children
(cadr type
_from
_structure
))
460 ((primitive-eval handler
) parser piece name type children
)
462 (ly
:warning
"No handler found for staff type ~a, using default staff handler" type
)
463 (oly
:staff
_handler parser piece name type children
)
472 #(define
(oly
:register
_staff
_type
_handler type func
)
473 ;
(ly
:message
"Registering staff handler ~a for type ~a" func type
)
474 (set
! oly
:staff
_handlers
(assoc-set
! oly
:staff
_handlers type func
))
477 #(define
(oly
:register
_voice
_type
_handler type func
)
478 ;
(ly
:message
"Registering voice type handler ~a for type ~a" func type
)
479 (set
! oly
:voice
_handlers
(assoc-set
! oly
:voice
_handlers type func
))
482 % handlers for deprecated API
483 #(oly
:register
_staff
_type
_handler
'StaffGroup
'oly
:staff
_group
_handler
)
484 #(oly
:register
_staff
_type
_handler
'ParallelMusic
'oly
:staff
_group
_handler
)
487 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
488 % Automatic score generation
489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
491 % \setUseBook ##t/##f sets a flag to determine whether the calls to createScore
492 % are from within a book block or not
493 % #(define oly:score_handler collect-scores-for-book)
494 #(define oly
:score
_handler toplevel-score-handler
)
495 #(define oly
:music
_handler toplevel-music-handler
)
496 #(define oly
:text
_handler toplevel-text-handler
)
498 setUseBook
= #(define-music-function
(parser location usebook
) (boolean?
)
501 (set
! oly
:score
_handler book-score-handler
)
502 (set
! oly
:music
_handler book-music-handler
)
503 (set
! oly
:text
_handler book-text-handler
)
506 (set
! oly
:score
_handler toplevel-score-handler
)
507 (set
! oly
:music
_handler toplevel-music-handler
)
508 (set
! oly
:text
_handler toplevel-text-handler
)
511 (make-music
'Music
'void
#t
)
515 % Two functions to handle midi-blocks: Either don't set one, or set an empty
516 % one so that MIDI is generated
517 #(define
(oly
:set
_no
_midi
_block score
) '())
518 #(define
(oly
:set
_midi
_block score
)
519 (let
* ((midiblock
(if
(defined?
'$defaultmidi
)
520 (ly
:output-def-clone $defaultmidi
)
521 (ly
:make-output-def
))))
522 (ly
:output-def-set-variable
! midiblock
'is-midi
#t
)
523 (ly
:score-add-output-def
! score midiblock
)
527 % \setCreateMidi ##t/##f sets a flag to determine wheter MIDI output should
529 #(define oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
530 setCreateMIDI
= #(define-music-function
(parser location createmidi
) (boolean?
)
532 (set
! oly
:apply
_score
_midi oly
:set
_midi
_block
)
533 (set
! oly
:apply
_score
_midi oly
:set
_no
_midi
_block
)
535 (make-music
'Music
'void
#t
)
539 % Two functions to handle layout-blocks: Either don't set one, or set an empty
540 % one so that a PDF is generated
541 #(define
(oly
:set
_no
_layout
_block score
) '())
542 #(define
(oly
:set
_layout
_block score
)
543 (let
* ((layoutblock
(if
(defined?
'$defaultlayout
)
544 (ly
:output-def-clone $defaultlayout
)
545 (ly
:make-output-def
))))
546 (ly
:output-def-set-variable
! layoutblock
'is-layout
#t
)
547 (ly
:score-add-output-def
! score layoutblock
)
551 % \setCreatePDF ##t/##f sets a flag to determine wheter PDF output should
553 #(define oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
554 setCreatePDF
= #(define-music-function
(parser location createlayout
) (boolean?
)
556 (set
! oly
:apply
_score
_layout oly
:set
_layout
_block
)
557 (set
! oly
:apply
_score
_layout oly
:set
_no
_layout
_block
)
559 (make-music
'Music
'void
#t
)
563 % Set the piece title in a new header block.
564 #(define
(oly
:set
_piece
_header score piecename
)
565 (if
(not-null? piecename
)
566 (let
* ((header
(make-module
)))
567 (module-define
! header
'piece piecename
)
568 (ly
:score-set-header
! score header
)
574 % post-filter functions. By default, no filtering is done. However,
575 % for the *NoCues* function, the cue notes should be killed
576 identity
= #(define-music-function
(parser location music
) (ly
:music?
) music
)
577 cuefilter
= #(define-music-function
(parser location music
) (ly
:music?
)
578 ((ly
:music-function-extract removeWithTag
) parser location
'cued
((ly
:music-function-extract killCues
) parser location music
))
581 #(define-public
(oly
:add-toc-item parser markup-symbol text
)
582 (oly
:music
_handler parser
(add-toc-item
! markup-symbol text
)))
585 #(define
(oly
:add-score parser score piecename
)
586 (if
(not-null? piecename
)
587 (oly
:add-toc-item parser
'tocItemMarkup piecename
))
588 (oly
:score
_handler parser score
)
590 % The helper function to build a score.
591 #(define
(oly
:createScoreHelper parser location piece children func
)
593 (staves
(oly
:staff
_group
_handler parser piece
"" "SimultaneousMusic" children
))
594 (music
(if
(not-null? staves
)
595 ((ly
:music-function-extract func
) parser location staves
)
599 (piecename
(namedPieceInstrObject piece
(car children
) "PieceName"))
600 (piecenametacet
(namedPieceInstrObject piece
(car children
) "PieceNameTacet"))
604 ; No staves
, print tacet
606 (if
(not-null? piecenametacet
) (set
! piecename piecenametacet
))
607 (if
(not-null? piecename
)
608 (oly
:add-score parser
(list
(oly
:piece-title-markup piecename
)) piecename
)
609 (ly
:warning
(_ "No music and no score title found for part ~a and instrument ~a") piece children
)
612 ; we have staves
, apply the piecename to the score and add layout
/midi blocks if needed
614 (set
! score
(scorify-music music parser
))
615 (oly
:set
_piece
_header score piecename
)
616 (oly
:apply
_score
_midi score
)
617 (oly
:apply
_score
_layout score
)
618 ; Schedule the score for typesetting
619 (oly
:add-score parser score piecename
)
623 ; This is
a void function
, the score has been schedulled for typesetting already
624 (make-music
'Music
'void
#t
)
627 createScore
= #(define-music-function
(parser location piece children
) (string? list?
)
628 (oly
:createScoreHelper parser location piece children identity
)
630 createNoCuesScore
= #(define-music-function
(parser location piece children
) (string? list?
)
631 (oly
:createScoreHelper parser location piece children cuefilter
)
634 createHeadline
= #(define-music-function
(parser location headline
) (string?
)
635 (oly
:add-toc-item parser
'tocItemMarkup headline
)
636 (oly
:score
_handler parser
(list
(oly
:piece-title-markup headline
)))
637 (make-music
'Music
'void
#t
)
642 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
643 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
645 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
646 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
648 % set the cue instrument name
649 setCue
= #(define-music-function
(parser location instr
) (string?
)
650 #{ \set Voice
.instrumentCueName
= $instr
#} )
652 % generate a cue music section with instrument names
653 % Parameters: \namedCueDuring NameOfQuote CueDirection CueInstrument OriginalInstrument music
654 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
655 % -) CueInstrument and OriginalInstrument are the displayed instrument names
657 % \namedCueDuring #"vIQuote" #UP #"V.I" #"Sop." { R1*3 }
658 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
659 % the beginning of the cue notes and "Sop." at the end
660 namedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr cuemusic
) (string? number? string? string? ly
:music?
)
662 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\setCue #$instrcue $cuemusic
\tag #'cued
\setCue #$instr
}
663 % \tag #'uncued $cuemusic
666 namedTransposedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue instr trans cuemusic
) (string? number? string? string? ly
:music? ly
:music?
)
668 \transposedCueDuring #$cuevoice
#$direction $trans
{ \tag #'cued
\setCue #$instrcue $cuemusic
\tag #'cued
\setCue #$instr
}
669 % \tag #'uncued $cuemusic
673 % set the cue instrument name and clef
674 setClefCue
= #(define-music-function
(parser location instr clef
)
677 \once \override Staff
.Clef
#'font-size
= #-
3 $clef
678 \set Voice
.instrumentCueName
= $instr
681 % generate a cue music section with instrument names and clef changes
682 % Parameters: \cleffedCueDuring NameOfQuote CueDirection CueInstrument CueClef OriginalInstrument OriginalClef music
683 % -) NameOfQuote CueDirection music are the parameters for \cueDuring
684 % -) CueInstrument and OriginalInstrument are the displayed instrument names
685 % -) CueClef and OriginalClef are the clefs for the the cue notes and the clef of the containing voice
687 % \cleffedCueDuring #"vIQuote" #UP #"V.I" #"treble" #"Basso" #"bass" { R1*3 }
688 % This adds the notes from vIQuote (defined via \addQuote) to three measures, prints "V.I" at
689 % the beginning of the cue notes and "Basso" at the end. The clef is changed to treble at the
690 % beginning of the cue notes and reset to bass at the end
691 cleffedCueDuring
= #(define-music-function
(parser location cuevoice direction instrcue clefcue instr clefinstr cuemusic
)
692 (string? number? string? ly
:music? string? ly
:music? ly
:music?
)
694 \cueDuring #$cuevoice
#$direction
{ \tag #'cued
\setClefCue #$instrcue $clefcue $cuemusic
\tag #'cued
\setClefCue #$instr $clefinstr
}
695 % \tag #'uncued $cuemusic
702 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
703 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
705 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
706 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
708 tempoMark
= #(define-music-function
(parser location padding marktext
) (number? string?
)
710 \once \override Score
. RehearsalMark
#'padding
= $padding
711 \mark \markup { \bold \smaller $marktext
}
714 shiftDynamics
= #(define-music-function
(parser location xshift yshift
) (number? number?
)
716 \once \override DynamicTextSpanner
#'padding
= $yshift
717 \once\override DynamicText
#'extra-offset
= #(cons $xshift $yshift
)
720 ffz
= #(make-dynamic-script
"ffz")
721 pf
= #(make-dynamic-script
"pf")
722 sempp
= #(make-dynamic-script
(markup
#:line
( #:with-dimensions
'(0 . 0)
723 '(0 . 0) #:right-align
#:normal-text
#:italic
"sempre" #:dynamic
"pp")))
724 parenf
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"f" #:normal-text
#:italic
#:fontsize
2 ")" )))
725 parenp
= #(make-dynamic-script
(markup
#:line
(#:normal-text
#:italic
#:fontsize
2 "(" #:dynamic
"p" #:normal-text
#:italic
#:fontsize
2 ")" )))
729 dim
= #(make-span-event
'DecrescendoEvent START
)
730 enddim
= #(make-span-event
'DecrescendoEvent STOP
)
731 decresc
= #(make-span-event
'DecrescendoEvent START
)
732 enddecresc
= #(make-span-event
'DecrescendoEvent STOP
)
733 cresc
= #(make-span-event
'CrescendoEvent START
)
734 endcresc
= #(make-span-event
'CrescendoEvent STOP
)
737 \set crescendoText
= \markup { \italic "cresc." }
738 \set crescendoSpanner
= #'text
739 \override DynamicTextSpanner
#'style
= #'dashed-line
742 \set decrescendoText
= \markup { \italic "decresc." }
743 \set crescendoSpanner
= #'text
744 \override DynamicTextSpanner
#'style
= #'dashed-line
747 \set decrescendoText
= \markup { \italic "dim." }
748 \set crescendoSpanner
= #'text
749 \override DynamicTextSpanner
#'style
= #'dashed-line
752 newOrOldClef
= #(define-music-function
(parser location new old
) (string? string?
)
753 (if
(ly
:get-option
'old-clefs
) #{ \clef $old
#} #{ \clef $new
#})
758 %%% Thanks to "Gilles THIBAULT" <gilles.thibault@free.fr>, there is a way
759 % to remove also the fermata from R1-\fermataMarkup: By filtering the music
760 % and removing the corresponding events.
761 % Documented as an LSR snippet: http://lsr.dsi.unimi.it/LSR/Item?id=372
762 #(define
(filterOneEventsMarkup event
)
763 ( let
( (eventname
(ly
:music-property event
'name
)) )
765 (or ;; add here event name you do NOT want
766 (eq? eventname
'MultiMeasureTextEvent
)
767 (eq? eventname
'AbsoluteDynamicEvent
)
768 (eq? eventname
'TextScriptEvent
)
769 (eq? eventname
'ArticulationEvent
)
770 (eq? eventname
'CrescendoEvent
)
771 (eq? eventname
'DecrescendoEvent
)
776 filterArticulations
= #(define-music-function
(parser location music
) (ly
:music?
)
777 Â Â
(music-filter filterOneEventsMarkup music
)
790 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
791 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
792 %%%%% REST COMBINATION
793 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
794 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
798 %% REST COMBINING, TAKEN FROM http://lsr.dsi.unimi.it/LSR/Item?id=336
801 %% \new Staff \with {
802 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
803 %% } << \somevoice \\ \othervoice >>
808 %% \override RestCollision #'positioning-done = #merge-rests-on-positioning
813 %% - only handles two voices
814 %% - does not handle multi-measure/whole-measure rests
816 #(define
(rest-score r
)
818 (yoff
(ly
:grob-property-data r
'Y-offset
))
819 (sp
(ly
:grob-property-data r
'staff-position
)))
821 (set
! score
(+ score
2))
822 (if
(eq? yoff
'calculation-in-progress
)
823 (set
! score
(- score
3))))
826 (set
! score
(+ score
2))
827 (set
! score
(- score
(abs
(-
1 sp
)))))
830 #(define
(merge-rests-on-positioning grob
)
831 (let
* ((can-merge
#f)
832 (elts
(ly
:grob-object grob
'elements
))
833 (num-elts
(and
(ly
:grob-array? elts
)
834 (ly
:grob-array-length elts
)))
835 (two-voice?
(= num-elts
2)))
837 (let
* ((v
1-grob
(ly
:grob-array-ref elts
0))
838 (v
2-grob
(ly
:grob-array-ref elts
1))
839 (v
1-rest
(ly
:grob-object v
1-grob
'rest
))
840 (v
2-rest
(ly
:grob-object v
2-grob
'rest
)))
844 (let
* ((v
1-duration-log
(ly
:grob-property v
1-rest
'duration-log
))
845 (v
2-duration-log
(ly
:grob-property v
2-rest
'duration-log
))
846 (v
1-dot
(ly
:grob-object v
1-rest
'dot
))
847 (v
2-dot
(ly
:grob-object v
2-rest
'dot
))
848 (v
1-dot-count
(and
(ly
:grob? v
1-dot
)
849 (ly
:grob-property v
1-dot
'dot-count -
1)))
850 (v
2-dot-count
(and
(ly
:grob? v
2-dot
)
851 (ly
:grob-property v
2-dot
'dot-count -
1))))
854 (number? v
1-duration-log
)
855 (number? v
2-duration-log
)
856 (= v
1-duration-log v
2-duration-log
)
857 (eq? v
1-dot-count v
2-dot-count
)))
859 ;; keep the rest that looks best
:
860 (let
* ((keep-v
1?
(>= (rest-score v
1-rest
)
861 (rest-score v
2-rest
)))
862 (rest-to-keep
(if keep-v
1? v
1-rest v
2-rest
))
863 (dot-to-kill
(if keep-v
1? v
2-dot v
1-dot
)))
864 ;; uncomment if you
're curious of which rest was chosen
:
865 ;;
(ly
:grob-set-property
! v
1-rest
'color green
)
866 ;;
(ly
:grob-set-property
! v
2-rest
'color blue
)
867 (ly
:grob-suicide
! (if keep-v
1? v
2-rest v
1-rest
))
868 (if
(ly
:grob? dot-to-kill
)
869 (ly
:grob-suicide
! dot-to-kill
))
870 (ly
:grob-set-property
! rest-to-keep
'direction
0)
871 (ly
:rest
::y-offset-callback rest-to-keep
)))))))
874 (ly
:rest-collision
::calc-positioning-done grob
))))
880 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
881 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
882 %%%%% TABLE OF CONTENTS
883 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
884 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
887 contentsTitle
= "Inhalt / Contents"
890 tocTitleMarkup
= \markup \fill-line
{
893 \override #(cons
'line-width
(* 7 cm
))
894 \line{ \fill-line
{\piece-title
{\contentsTitle} \null }}
899 tocItemMarkup
= \markup \fill-line
{
902 \override #(cons
'line-width
(* 7 cm
))
903 \line { \fill-line
{\fromproperty #'toc
:text
\fromproperty #'toc
:page
}}
910 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
911 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
912 %%%%% TITLE PAGE / HEADER
913 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
914 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
916 #(define-markup-command
(when-property layout props symbol markp
) (symbol? markup?
)
917 (if
(chain-assoc-get symbol props
)
918 (interpret-markup layout props markp
)
919 (ly
:make-stencil
'() '(1 . -
1) '(1 . -
1))))
921 #(define-markup-command
(vspace layout props amount
) (number?
)
922 "This produces a invisible object taking vertical space."
923 (let
((amount
(* amount
3.0)))
925 (ly
:make-stencil
"" (cons -
1 1) (cons
0 amount
))
926 (ly
:make-stencil
"" (cons -
1 1) (cons amount amount
)))))
930 titlePageMarkup
= \markup { \fontsize #2 \when-property
#'header
:title
\column {
932 \fill-line
{ \fontsize #8 \fromproperty #'header
:composer
}
934 \fill-line
{ \fontsize #8 \fromproperty #'header
:poet
}
936 \fill-line
{ \fontsize #10 \bold \fromproperty #'header
:titlepagetitle
}
938 \fontsize #2 \when-property
#'header
:subtitle
{
939 \fill-line
{ \fromproperty #'header
:subtitle
}
942 \fill-line
{ \postscript #"-20 0 moveto 40 0 rlineto stroke" }
944 \fill-line
{ \fontsize #5 \fromproperty #'header
:ensemble
}
946 \fill-line
{ \fontsize #2 \fromproperty #'header
:instruments
}
948 \fill-line
{ \fontsize #5 \fromproperty #'header
:date
}
950 \fill-line
{ \fontsize #5 \fromproperty #'header
:scoretype
}
952 \fontsize #2 \when-property
#'header
:enteredby
{
953 \fill-line
{ "Herausgegeben von: / Edited by:"}
955 \fill-line
{ \fromproperty #'header
:enteredby
}
958 \when-property
#'header
:arrangement
\column {
960 \fill-line
{ \fontsize #3 \fromproperty #'header
:arrangement
}
966 titleHeaderMarkup
= \markup {
967 \override #'(baseline-skip
. 3.5)
969 \override #'(baseline-skip
. 3.5)
973 \bigger \fromproperty #'header
:title
976 \large \smaller \bold
977 \bigger \fromproperty #'header
:subtitle
981 \fromproperty #'header
:subsubtitle
984 { \large \bold \fromproperty #'header
:instrument
}
987 \fromproperty #'header
:poet
988 \fromproperty #'header
:composer
991 \fromproperty #'header
:meter
992 \fromproperty #'header
:arranger
998 titleScoreMarkup
= \markup \piece-title
\fromproperty #'header
:piece
1001 scoreTitleMarkup
= \titleScoreMarkup
1002 bookTitleMarkup
= \titleHeaderMarkup
1007 %%%%%%%%%%%%%% headers and footers %%%%%%%%%%%%%%%%%%%%%%%%%%
1009 #(define
(first-score-page layout props arg
)
1010 (let
* ((label
'first-score-page
)
1011 (table
(ly
:output-def-lookup layout
'label-page-table
))
1012 (label-page
(and
(list? table
) (assoc label table
)))
1013 (page-number
(and label-page
(cdr label-page
)))
1015 (if
(eq?
(chain-assoc-get
'page
:page-number props -
1) page-number
)
1016 (interpret-markup layout props arg
)
1019 #(define no-header-table
'())
1020 thisPageNoHeader
= #(define-music-function
(parser location
) ()
1021 (let
* ((label
(gensym
"header")))
1022 (set
! no-header-table
(cons label no-header-table
))
1025 'page-label label
)))
1028 % TODO: Use the no-header-table!
1029 #(define
(is-header-page layout props arg
)
1030 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1032 (if
(and
(> page-number
2) (!= page-number
7))
1033 (interpret-markup layout props arg
)
1036 #(define no-footer-table
'())
1037 thisPageNoFooter
= #(define-music-function
(parser location
) ()
1038 (let
* ((label
(gensym
"footer")))
1039 (set
! no-footer-table
(cons label no-footer-table
))
1042 'page-label label
)))
1044 % TODO: Use the no-footer-table!
1045 #(define
(is-footer-page layout props arg
)
1046 (let
* ((page-number
(chain-assoc-get
'page
:page-number props -
1))
1047 (label
'first-score-page
)
1048 (table
(ly
:output-def-lookup layout
'label-page-table
))
1049 (label-page
(and
(list? table
) (assoc label table
)))
1050 ;
(page-number
(and label-page
(cdr label-page
)))
1052 (if
(and
(> page-number
2) (!= page-number
7))
1053 (interpret-markup layout props arg
)
1057 #(define copyright-footer-table
'())
1058 thisPageCopyrightFooter
= #(define-music-function
(parser location
) ()
1059 (let
* ((label
(gensym
"copyrightfooter")))
1060 (set
! copyright-footer-table
(cons label copyright-footer-table
))
1063 'page-label label
)))
1065 % TODO: Use the copyright-footer-table!
1066 #(define
(copyright-page layout props arg
)
1067 (if
(= (chain-assoc-get
'page
:page-number props -
1) 7)
1068 (interpret-markup layout props arg
)
1073 oddHeaderMarkup
= \markup \fill-line
{
1074 %% force the header to take some space, otherwise the
1075 %% page layout becomes a complete mess.
1077 \on-the-fly
#is-header-page
\fromproperty #'header
:title
1078 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1080 evenHeaderMarkup
= \markup \fill-line
{
1081 \on-the-fly
#is-header-page
\fromproperty #'page
:page-number-string
1082 \on-the-fly
#is-header-page
\fromproperty #'header
:composer
1086 oddFooterMarkup
= \markup {
1089 %% publisher header field only on title page.
1090 \on-the-fly
#first-page
\fromproperty #'header
:publisher
1093 %% copyright on the first real score page
1094 \on-the-fly
#copyright-page
\fromproperty #'header
:copyright
1095 \on-the-fly
#copyright-page
\null
1098 %% All other pages get the number of the edition centered
1099 \on-the-fly
#is-footer-page
\fromproperty #'header
:scorenumber
1116 % Interpret the given markup with the header fields added to the props.
1117 % This way, one can re-use the same functions (using fromproperty
1118 % #'header:field) in the header block and as top-level markup.
1120 % This function is originally copied from mark-up-title (file scm/titling.scm),
1121 % which is lilypond's internal function to handle the title markups. I needed
1122 % to replace the scopes and manually add the $defaultheader (which is internally
1123 % done in paper-book.cc before calling mark-up-title. Also, I don't extract the
1124 % markup from the header block, but use the given markup.
1126 % I'm not sure if I really need the page properties in props, too... But I
1127 % suppose it does not hurt, either.
1128 #(define-markup-command
(markupWithHeader layout props markup
) (markup?
)
1129 "Interpret the given markup with the header fields added to the props.
1130 This way, one can re-use the same functions (using fromproperty
1131 #'header:field) in the header block and as top-level markup."
1133 ; TODO
: I
f we are inside
a score
, add the score
's local header block
, too
!
1134 ; Currently
, I only use the global header block
, stored in $defaultheader
1135 (scopes
(list $defaultheader
))
1136 (alists
(map ly
:module-
>alist scopes
))
1139 (map
(lambda
(alist
)
1140 (map
(lambda
(entry
)
1142 (string-
>symbol
(string-append
"header:" (symbol-
>string
(car entry
))))
1146 (props
(append prefixed-alist
1148 (layout-extract-page-properties layout
)))
1150 (interpret-markup layout props markup
)
1159 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1160 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1161 %%%%% Equally spacing multiple columns (e.g. for translations)
1162 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1165 % Credits: Nicolas Sceaux on the lilypond-user mailinglist
1166 #(define-markup-command
(columns layout props args
) (markup-list?
)
1167 (let
((line-width
(/ (chain-assoc-get
'line-width props
1168 (ly
:output-def-lookup layout
'line-width
))
1169 (max
(length args
) 1))))
1170 (interpret-markup layout props
1171 (make-line-markup
(map
(lambda
(line
)
1172 (markup
#:pad-to-box `
(0 . ,line-width
) '(0 . 0)
1173 #:override `
(line-width
. ,line-width
)
1178 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1179 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1180 %%%%% Defaults for instrument names, short names, cue names, etc.
1181 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1184 %%% Clef definitions, either old-style (using the Breitkopf style) or new style
1185 FlClef
= \clef "treble"
1188 O
bClef
= \clef "treble"
1191 ClIClef
= \clef "treble"
1193 FagClef
= \clef "bass"
1195 FagIIClef
= \FagClef
1196 CFagClef
= \clef "bass"
1197 CorClef
= \clef "treble"
1199 CorIIClef
= \CorClef
1200 TrClef
= \clef "tenor"
1203 TrIIIClef
= \clef "bass"
1204 TbeIClef
= \clef "treble"
1205 TbeIIClef
= \clef "treble"
1206 TimClef
= \clef "bass"
1207 VClef
= \clef "treble"
1210 V
aClef
= \clef "alto"
1213 V
cBClef
= \clef "bass"
1216 SClef
= \clef "treble"
1217 AClef
= \clef "treble"
1218 TClef
= \clef "treble_8"
1219 BClef
= \clef "bass"
1224 OIClef
= \clef "treble"
1225 OIIClef
= \clef "bass"
1229 FlInstrumentName
= "Flauti"
1230 FlIInstrumentName
= "Flauto I"
1231 FlIIInstrumentName
= "Flauto II"
1232 O
bInstrumentName
= "Oboi"
1233 O
bIInstrumentName
= "Oboe I"
1234 O
bIIInstrumentName
= "Oboe II"
1235 ClInstrumentName
= "Clarinetti"
1236 ClIInstrumentName
= "Clarinetto I"
1237 ClIIInstrumentName
= "Clarinetto II"
1238 FagInstrumentName
= "Fagotti"
1239 FagIInstrumentName
= "Fagotto I"
1240 FagIIInstrumentName
= "Fagotto II"
1241 CFagInstrumentName
= "Contrafagotto"
1242 CorInstrumentName
= "Corni"
1243 CorIInstrumentName
= "Corno I"
1244 CorIIInstrumentName
= "Corno II"
1245 TrInstrumentName
= "Tromboni"
1246 TrIInstrumentName
= "Trombone I"
1247 TrIIInstrumentName
= "Trombone II"
1248 TrIIIInstrumentName
= "Trombone III"
1249 TbeInstrumentName
= "Trombe"
1250 TbeIInstrumentName
= "Tromba I"
1251 TbeIIInstrumentName
= "Tromba II"
1252 TimInstrumentName
= "Timpani"
1253 VIInstrumentName
= "Violino I"
1254 VIIInstrumentName
= "Violino II"
1255 V
aInstrumentName
= "Viola"
1256 V
aIInstrumentName
= "Viola I"
1257 V
aIIInstrumentName
= "Viola II"
1258 V
cBInstrumentName
= \markup {\column { "Cello e" "Contrabbasso"}}
1259 V
cInstrumentName
="Violoncello"
1260 C
bInstrumentName
="Basso"
1261 SInstrumentName
= "Soprano"
1262 AInstrumentName
= "Alto"
1263 TInstrumentName
= "Tenore"
1264 BInstrumentName
= "Basso"
1265 SSoloInstrumentName
= "Soprano Solo"
1266 TSoloInstrumentName
= "Tenore Solo"
1267 BSoloInstrumentName
= "Basso Solo"
1268 ASoloInstrumentName
= "Alto Solo"
1269 OInstrumentName
= "Organo"
1271 C
hInstrumentTitle
= "Coro"
1274 FlShortInstrumentName
= "Fl."
1275 FlIShortInstrumentName
= "Fl. I"
1276 FlIIShortInstrumentName
= "Fl. II"
1277 O
bShortInstrumentName
= "Ob."
1278 O
bIShortInstrumentName
= "Ob. I"
1279 O
bIIShortInstrumentName
= "Ob. II"
1280 ClShortInstrumentName
= "Cl."
1281 ClIShortInstrumentName
= "Cl.I"
1282 ClIIShortInstrumentName
= "Cl.II"
1283 FagShortInstrumentName
= "Fag."
1284 FagIShortInstrumentName
= "Fag. I"
1285 FagIIShortInstrumentName
= "Fag. II"
1286 CFagShortInstrumentName
= "Cfag."
1287 CorShortInstrumentName
= "Cor."
1288 CorIShortInstrumentName
= "Cor.I"
1289 CorIIShortInstrumentName
= "Cor.II"
1290 TrShortInstrumentName
= "Tr."
1291 TrIShortInstrumentName
= "Tr. I"
1292 TrIIShortInstrumentName
= "Tr. II"
1293 TrIIIShortInstrumentName
= "Tr. III"
1294 TbeShortInstrumentName
= "Tbe."
1295 TbeIShortInstrumentName
= "Tbe.I"
1296 TbeIIShortInstrumentName
= "Tbe.II"
1297 TimShortInstrumentName
= "Tim."
1298 VIShortInstrumentName
= "V.I"
1299 VIIShortInstrumentName
= "V.II"
1300 V
aShortInstrumentName
= "Va."
1301 V
aIShortInstrumentName
= "Va.I"
1302 V
aIIShortInstrumentName
= "Va.II"
1303 V
cBShortInstrumentName
= \markup{\column{"Vc." "e B."}}
1304 V
cShortInstrumentName
= "Vc."
1305 C
bShortInstrumentName
= "B."
1306 SShortInstrumentName
= "S."
1307 AShortInstrumentName
= "A."
1308 TShortInstrumentName
= "T."
1309 BShortInstrumentName
= "B."
1310 SSoloShortInstrumentName
= "S.Solo"
1311 ASoloShortInstrumentName
= "A.Solo"
1312 TSoloShortInstrumentName
= "T.Solo"
1313 BSoloShortInstrumentName
= "B.Solo"
1314 OShortInstrumentName
= "Org."
1318 newInstrument
= #(define-music-function
(parser location instr
) (string?
)
1320 \set Voice
.instrumentCueName
= #$
(string-join
(list
"+" instr
))
1323 cueText
= #(define-music-function
(parser location instr
) (string?
)
1325 \set Voice
.instrumentCueName
= $instr
1356 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1357 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1358 %%%%% SCORE NUMBERS FOR PUBLISHING
1359 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1360 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1363 #(define-markup-command
(scoreNumber layout props nr
) (markup?
)
1364 (interpret-markup layout props
(markup
(format
"~a-~a" EKnumber nr
)))
1367 FullScoreNumber
= "1"
1368 PianoScoreNumber
= "2"
1369 VocalScoreNumber
= "3"
1371 ChoirScoreNumber
= "10"
1376 SoloScoreNumber
= "15"
1384 InstrumentsNumber
= "25"
1414 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1415 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1416 %%%%% SCORE (HEADER / LAYOUT) SETTINGS
1417 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1424 bottom-margin
= 1\cm
1426 % after-title-space = 0.5\cm
1428 ragged-last-bottom
= ##f
1433 % If only one non-empty staff in a system exists, still print the backet
1434 \override SystemStartBracket
#'collapse-height
= #1
1435 \consists "Instrument_name_engraver"
1439 % If only one non-empty staff in a system exists, still print the backet
1440 \override SystemStartBracket
#'collapse-height
= #1
1441 \consists "Instrument_name_engraver"
1445 \override SystemStartBracket
#'collapse-height
= #1
1446 \consists "Instrument_name_engraver"
1450 % Force multi-measure rests to be written as one span
1451 \override MultiMeasureRest
#'expand-limit
= #3
1454 % hairpinToBarline = ##f
1455 \override BarNumber
#'break-visibility
= #end-of-line-invisible
1456 \override CombineTextScript
#'avoid-slur
= #'outside
1457 barNumberVisibility
= #(every-nth-bar-number-visible
5)
1458 \override DynamicTextSpanner
#'dash-period
= #-
1.0
1459 \override InstrumentSwitch
#'font-size
= #-
1
1462 \override RestCollision
#'positioning-done
= #merge-rests-on-positioning
1463 % Auto-Accidentals: Use modern-cautionary style...
1465 autoAccidentals
= #'(Staff
(same-octave
. 0))
1466 autoCautionaries
= #'(Staff
(any-octave
. 0) (same-octave
. 1))
1467 printKeyCancellation
= ##t
1470 \RemoveEmptyStaffContext
1474 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(0.5 . 0.5)
1482 \type "Engraver_group"
1484 % So that \cresc works, for example.
1486 \consists "Output_property_engraver"
1488 \override VerticalAxisGroup
#'minimum-Y-extent
= #'(-
1 . 1)
1489 pedalSustainStrings
= #'("Ped." "*Ped." "*")
1490 pedalUnaCordaStrings
= #'("una corda" "" "tre corde")
1492 \consists "Piano_pedal_engraver"
1493 \consists "Script_engraver"
1494 \consists "Dynamic_engraver"
1495 \consists "Text_engraver"
1497 \override TextScript
#'font-size
= #2
1498 \override TextScript
#'font-shape
= #'italic
1499 \override DynamicText
#'extra-offset
= #'(0 . 2.5)
1500 \override Hairpin
#'extra-offset
= #'(0 . 2.5)
1502 \consists "Skip_event_swallow_translator"
1504 \consists "Axis_group_engraver"
1509 % \override VerticalAlignment #'forced-distance = #7