]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/rhythmic-slashes.ly
Merge master into nested-bookparts
[lilypond.git] / input / lsr / rhythmic-slashes.ly
1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
3 \version "2.11.62"
4
5 \header {
6   lsrtags = "rhythms, tweaks-and-overrides"
7
8   texidoc = "
9 In \"simple\" lead-sheets, sometimes no actual notes are written,
10 instead only \"rhythmic patterns\" and chords above the measures are
11 notated giving the structure of a song. Such a feature is for example
12 useful while creating/transcribing the structure of a song and also
13 when sharing lead sheets with guitarists or jazz musicians. The
14 standard support for this using @code{\\repeat percent} is unsuitable
15 here since the first beat has to be an ordinary note or rest. This
16 example shows two solutions to this problem, by redefining ordinary
17 rests to be printed as slashes. (If the duration of each beat is not a
18 quarter note, replace the @code{r4} in the definitions with a rest of
19 the appropriate duration). 
20
21 "
22   doctitle = "Rhythmic slashes"
23 } % begin verbatim
24 % Macro to print single slash
25 rs = {
26   \once \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
27   \once \override Rest #'thickness = #'0.48
28   \once \override Rest #'slope = #'1.7
29   r4
30 }
31
32 % Function to print a specified number of slashes
33 comp = #(define-music-function (parser location count) ( integer?)
34   #{
35     \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
36     \override Rest #'thickness = #'0.48
37     \override Rest #'slope = #'1.7
38     \repeat unfold $count { r4 }
39     \revert Rest #'stencil
40   #}
41 )
42
43 \score{
44   \relative c' {
45     c d e f |
46     \rs \rs \rs \rs |
47     \comp #4 |
48   }
49 }