]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/showing-the-same-articulation-above-and-below-a-note-or-chord.ly
Imported Upstream version 2.19.45
[lilypond.git] / Documentation / snippets / showing-the-same-articulation-above-and-below-a-note-or-chord.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.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.18.0"
8
9 \header {
10   lsrtags = "expressive-marks, tweaks-and-overrides, version-specific"
11
12   texidoc = "
13 By default, LilyPond does not allow the same articulation (e.g., an
14 accent, a fermata, a flageolet, etc.) to be displayed above and below a
15 note. For example, c4_\\fermata^\\fermata will only show a fermata
16 below. The fermata above will simply be ignored. However, one can stick
17 scripts (just like fingerings) inside a chord, which means it is
18 possible to have as many articulations as desired. This approach has
19 the advantage that it ignores the stem and positions the articulation
20 relative to the note head. This can be seen in the case of the
21 flageolets in the snippet. To mimic the behaviour of scripts outside a
22 chord, 'add-stem-support would be required. So, the solution is to
23 write the note as a chord and add the articulations inside the <...>.
24 The direction will always be above, but one can tweak this via a
25 \\tweak: @code{<c-\\tweak direction #DOWN-\\fermata^\\fermata>}
26
27 "
28   doctitle = "Showing the same articulation above and below a note or chord"
29 } % begin verbatim
30
31 % The same as \flageolet, just a little smaller
32 smallFlageolet =
33 #(let ((m (make-articulation "flageolet")))
34    (set! (ly:music-property m 'tweaks)
35          (acons 'font-size -2
36                 (ly:music-property m 'tweaks)))
37    m)
38
39 \relative c' {
40   s4^"Wrong:"
41   c4_\fermata^\fermata % The second fermata is ignored!
42   <e d'>4^\smallFlageolet_\smallFlageolet
43
44   s4^"Works if written inside a chord:"
45   <e_\smallFlageolet d'^\smallFlageolet>4
46   <e_\flageolet d'^\flageolet>4
47   <e_\smallFlageolet^\smallFlageolet>4
48   <e_\fermata^\fermata>4
49 }