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