]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
Doc-fr: update for 2.16.1 (second part)
[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.16.0"
8
9 \header {
10   lsrtags = "contemporary-notation, editorial-annotations, vocal-music, workaround"
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
22 speakOn = {
23   \override Stem #'stencil =
24     #(lambda (grob)
25        (let* ((x-parent (ly:grob-parent grob X))
26               (is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
27          (if is-rest?
28              empty-stencil
29              (ly:stencil-combine-at-edge
30               (ly:stem::print grob)
31               Y
32               (- (ly:grob-property grob 'direction))
33               (grob-interpret-markup grob
34                                      (markup #:center-align #:fontsize -4
35                                              #:musicglyph "noteheads.s2cross"))
36               -2.3))))
37 }
38
39 speakOff = {
40   \revert Stem #'stencil
41   \revert Flag #'stencil
42 }
43
44 \score {
45   \new Staff {
46     \relative c'' {
47       a4 b a c
48       \speakOn
49       g4 f r g
50       b4 r d e
51       \speakOff
52       c4 a g f
53     }
54   }
55 }