]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/rhythmic-slashes.ly
Add a TODO comment re grace note spacing.
[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.35"
4
5 \header {
6   lsrtags = "rhythms, editorial-and-educational-use, 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 noted 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.
13
14 The standard support for this is described in section \"Measure
15 repeats\", but  then the first beat has to be an ordinary note or rest. 
16
17 This example shows two solutions to this problem, by redefining
18 ordinary rests to be printed as slashes. (If the duration of each beat
19 is not a quarter note, replace the r4 in the definitions by a rest of
20 the appropriate duration).
21 " }
22 % begin verbatim
23 % Macro to print single slash
24 rs = {
25   \once \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
26   \once \override Rest #'thickness = #'0.48
27   \once \override Rest #'slope = #'1.7
28   r4
29 }
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 | \rs \rs \rs \rs | \comp #4 |
46   }
47 }