]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/rhythmic-slashes.ly
Merge branch 'master' of /home/lilycvs/git/lily/
[lilypond.git] / input / lsr / rhythmic-slashes.ly
1 %% Do not edit this file; it is auto-generated from LSR!
2 %% Tags: rhythms, editorial-and-educational-use, tweaks-and-overrides
3 \version "2.11.35"
4
5 \header { texidoc = "
6 In \"simple\" lead-sheets, sometimes no actual notes are written,
7 instead only \"rhythmic patterns\" and chords above the measures are
8 noted giving the structure of a song.  Such a feature is for example
9 useful while creating/transcribing the structure of a song and also
10 when sharing lead sheets with guitarists or jazz musicians.
11
12 The standard support for this is described in section \"Measure
13 repeats\", but  then the first beat has to be an ordinary note or rest. 
14
15 This example shows two solutions to this problem, by redefining
16 ordinary rests to be printed as slashes. (If the duration of each beat
17 is not a quarter note, replace the r4 in the definitions by 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
30 % Function to print a specified number of slashes
31 comp = #(define-music-function (parser location count) ( integer?)
32 #{
33 \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
34 \override Rest #'thickness = #'0.48
35 \override Rest #'slope = #'1.7
36 \repeat unfold $count { r4 }
37 \revert Rest #'stencil
38 #})
39
40 \score{
41 \relative c'{
42  c d e f | \rs \rs \rs \rs | \comp #4 |
43 }
44 }