]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/rhythmic-slashes.ly
Issue 5167/6: Changes: show \markup xxx = ... \etc assignments
[lilypond.git] / Documentation / snippets / rhythmic-slashes.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.19.22"
8
9 \header {
10   lsrtags = "rhythms, tweaks-and-overrides"
11
12   texidoc = "
13 In @qq{simple} lead-sheets, sometimes no actual notes are written,
14 instead only @qq{rhythmic patterns} and chords above the measures are
15 notated giving the structure of a song. Such a feature is for example
16 useful while creating/transcribing the structure of a song and also
17 when sharing lead sheets with guitarists or jazz musicians. The
18 standard support for this using @code{\\repeat percent} is unsuitable
19 here since the first beat has to be an ordinary note or rest. This
20 example shows two solutions to this problem, by redefining ordinary
21 rests to be printed as slashes. (If the duration of each beat is not a
22 quarter note, replace the @code{r4} in the definitions with a rest of
23 the appropriate duration).
24
25 "
26   doctitle = "Rhythmic slashes"
27 } % begin verbatim
28
29 % Macro to print single slash
30 rs = {
31   \once \override Rest.stencil = #ly:percent-repeat-item-interface::beat-slash
32   \once \override Rest.thickness = #0.48
33   \once \override Rest.slope = #1.7
34   r4
35 }
36
37 % Function to print a specified number of slashes
38 comp = #(define-music-function (count) (integer?)
39   #{
40     \override Rest.stencil = #ly:percent-repeat-item-interface::beat-slash
41     \override Rest.thickness = #0.48
42     \override Rest.slope = #1.7
43     \repeat unfold $count { r4 }
44     \revert Rest.stencil
45   #}
46 )
47
48 \score {
49   \relative c' {
50     c4 d e f |
51     \rs \rs \rs \rs |
52     \comp #4 |
53   }
54 }