]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
Merge branch 'lilypond/translation'
[lilypond.git] / Documentation / snippets / marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
1 %% Do not edit this file; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% This file is in the public domain.
4 \version "2.13.39"
5
6 \header {
7   lsrtags = "editorial-annotations, vocal-music"
8
9   texidoc = "
10 This example shows how to put crosses on stems.  Mark the beginning of
11 a spoken section with the @code{\\speakOn} keyword, and end it with the
12 @code{\\speakOff} keyword.
13
14 "
15   doctitle = "Marking notes of spoken parts with a cross on the stem"
16 } % begin verbatim
17
18 speakOn = {
19   \override Stem #'stencil =
20     #(lambda (grob)
21        (let* ((x-parent (ly:grob-parent grob X))
22               (is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
23          (if is-rest?
24              empty-stencil
25              (ly:stencil-combine-at-edge
26               (ly:stem::print grob)
27               Y
28               (- (ly:grob-property grob 'direction))
29               (grob-interpret-markup grob
30                                     (markup #:center-align #:fontsize -4
31                                             #:musicglyph "noteheads.s2cross"))
32               -2.3 0))))
33 }
34
35 speakOff = {
36   \revert Stem #'stencil
37 }
38
39 \score {
40   \new Staff {
41     \relative c'' {
42       a4 b a c
43       \speakOn
44       g4 f r g
45       b4 r d e
46       \speakOff
47       c4 a g f
48     }
49   }
50 }
51