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