LSR: Redo local update.
[lilypond/mpolesky.git] / Documentation / snippets / marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
bloba8e13775180487ed3ea9044ffb6fbbe8e64030fb
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.16"
6 \header {
7 lsrtags = "editorial-annotations, vocal-music"
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.
15 doctitle = "Marking notes of spoken parts with a cross on the stem"
16 } % begin verbatim
18 speakOn = {
19 \override Stem #'stencil = #(lambda (grob)
20 (let* ((x-parent (ly:grob-parent grob X))
21 (is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
22 (if is-rest?
23 empty-stencil
24 (ly:stencil-combine-at-edge
25 (ly:stem::print grob)
27 (- (ly:grob-property grob 'direction))
28 (grob-interpret-markup grob
29 (markup #:hspace -1.025 #:fontsize -4
30 #:musicglyph "noteheads.s2cross"))
31 -2.3 0))))
34 speakOff = {
35 \revert Stem #'stencil
38 \score {
39 \new Staff {
40 \relative c'' {
41 a4 b a c
42 \speakOn
43 g4 f r g
44 b4 r d e
45 \speakOff
46 c4 a g f