3 texidoc
= "Incipit can be printed using an InstrumentName grob."
10 #(set-object-property
! 'music
'backend-type? ly
:music?
)
11 #(set-object-property
! 'music
'backend-doc
"Incipit music")
15 %% All this would be shortcuted by an appropriate music function:
16 \override Staff
.InstrumentName
#'music
= ##{ \clef "petrucci-c1" c'4 d' e' f' #}
17 \override Staff
.InstrumentName
#'self-alignment-X
= #RIGHT
18 \override Staff
.InstrumentName
#'self-alignment-Y
= #UP
19 \override Staff
.InstrumentName
#'Y-offset
= #4
20 \override Staff
.InstrumentName
#'padding
= #0
21 \override Staff
.InstrumentName
#'stencil
=
23 (let
* ((instrument-name
(ly
:grob-property grob
'long-text
))
24 (layout
(ly
:output-def-clone
(ly
:grob-layout grob
)))
25 (music
(make-music
'SequentialMusic
26 'elements
(list
(make-music
'ContextSpeccedMusic
27 'context-type
'MensuralStaff
28 'element
(make-music
'PropertySet
29 'symbol
'instrumentName
30 'value instrument-name
))
31 (ly
:grob-property grob
'music
))))
32 (score
(ly
:make-score music
))
33 (mm
(ly
:output-def-lookup layout
'mm
))
34 (indent
(ly
:output-def-lookup layout
'indent
))
35 (incipit-width
(ly
:output-def-lookup layout
'incipit-width
))
36 (scaled-incipit-width
(if
(number? incipit-width
)
39 (ly
:output-def-set-variable
! layout
'indent
(- indent scaled-incipit-width
))
40 (ly
:output-def-set-variable
! layout
'line-width indent
)
41 (ly
:output-def-set-variable
! layout
'ragged-right
#f)
42 (ly
:score-add-output-def
! score layout
)
43 (set
! (ly
:grob-property grob
'long-text
)
44 (markup
#:score score
))
45 (ly
:system-start-text
::print grob
)))
47 %% the instrument name definition is separated:
48 \set Staff
.instrumentName
= \markup Instrument