]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
b44968531f948bdd60929d3db36af05063148b4a
[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.15.40"
8
9 \header {
10   lsrtags = "workaround, contemporary-notation, vocal-music, editorial-annotations"
11
12 %% Translation of GIT committish: 57f9346bb030f49336a858fcbf1519366fe56454
13   texidocfr = "
14 Voici comment ajouter une croix aux hampes.  Le début du fragment parlé
15 est stipulé par une commande @code{\\speakOn}, et la fin par une
16 commande @code{\\speakOff}.
17
18 "
19   doctitlefr = "Adjonction d'une croix sur la hampe des notes d'un fragment parlé"
20
21   texidoc = "
22 This example shows how to put crosses on stems.  Mark the beginning of
23 a spoken section with the @code{\\speakOn} keyword, and end it with the
24 @code{\\speakOff} keyword.
25
26 "
27   doctitle = "Marking notes of spoken parts with a cross on the stem"
28 } % begin verbatim
29
30
31 speakOn = {
32   \override Stem #'stencil =
33     #(lambda (grob)
34        (let* ((x-parent (ly:grob-parent grob X))
35               (is-rest? (ly:grob? (ly:grob-object x-parent 'rest))))
36          (if is-rest?
37              empty-stencil
38              (ly:stencil-combine-at-edge
39               (ly:stem::print grob)
40               Y
41               (- (ly:grob-property grob 'direction))
42               (grob-interpret-markup grob
43                                      (markup #:center-align #:fontsize -4
44                                              #:musicglyph "noteheads.s2cross"))
45               -2.3))))
46 }
47
48 speakOff = {
49   \revert Stem #'stencil
50   \revert Flag #'stencil
51 }
52
53 \score {
54   \new Staff {
55     \relative c'' {
56       a4 b a c
57       \speakOn
58       g4 f r g
59       b4 r d e
60       \speakOff
61       c4 a g f
62     }
63   }
64 }
65