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