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