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