]> git.donarmstrong.com Git - lilypond.git/blob - input/new/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
Make relative-includes configurable with a -d option.
[lilypond.git] / input / new / marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
1 \version "2.11.62"
2
3 \header {
4   lsrtags = "editorial-annotations, vocal-music"
5
6   texidoc = "
7 This example shows how to put crosses on stems. Mark the beginning
8 of a spoken section with the @code{\\speakOn} keyword, and end it
9 with the @code{\\speakOff} keyword.  Remember to end cross sections
10 before entering any rest: this function also adds crosses to the
11 invisible stems of rests.
12 "
13   doctitle = "Marking notes of spoken parts with a cross on the stem"
14 }
15
16 speakOn = {
17   \override Stem #'stencil = #(lambda (grob)
18   (ly:stencil-combine-at-edge
19     (ly:stem::print grob)
20     Y
21     (- (ly:grob-property grob 'direction))
22     (grob-interpret-markup grob
23       (markup #:hspace -1.025 #:fontsize -4
24         #:musicglyph "noteheads.s2cross"))
25     -2.3 0))
26 }
27
28 speakOff = {
29   \revert Stem #'stencil
30 }
31
32 \score {
33   \new Staff {
34     \relative c'' {
35       a4 b a c
36       \speakOn
37       g4 f r g
38       b4 r d e
39       \speakOff
40       c4 a g f
41     }
42   }
43 }