LSR: Update.
[lilypond.git] / input / lsr / marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
blob8331189ec49c2afaf037f3681121b30350ca634e
1 %% Do not edit this file; it is auto-generated from input/new
2 %% This file is in the public domain.
3 %% Note: this file works from version 2.12.0
4 \version "2.13.1"
6 \header {
7 lsrtags = "editorial-annotations, vocal-music"
9 texidoc = "
10 This example shows how to put crosses on stems. Mark the beginning
11 of a spoken section with the @code{\\speakOn} keyword, and end it
12 with the @code{\\speakOff} keyword.
14 doctitle = "Marking notes of spoken parts with a cross on the stem"
15 } % 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