]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/rhythmic-slashes.ly
fe6797d5e0d5974f6867e7deaf18a45a4c46b745
[lilypond.git] / Documentation / snippets / rhythmic-slashes.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.dsi.unimi.it
3 %% Make any changes in LSR itself, or in Documentation/snippets/new/ ,
4 %% and then run scripts/auxiliar/makelsr.py
5 %%
6 %% This file is in the public domain.
7 \version "2.14.2"
8
9 \header {
10   lsrtags = "tweaks-and-overrides, rhythms"
11
12 %% Translation of GIT committish: 28097cf54698db364afeb75658e4c8e0e0ccd716
13   texidocfr = "
14 Il arrive, dans une feuille de chant « simple », que les notes soient
15 remplacées par une « pulsation » et que la structure de la chanson soit
16 indiquées par les accords au-dessus des mesures.  Ceci peut être utile
17 lorsque l'on crée ou retranscrit la structure d'une chanson, ainsi que
18 pour donner au guitariste et musiciens de jazz une pseudo partition.  Le
19 fonctionnement standard d'un @code{\\repeat percent} n'est pas ici
20 applicable puisque le premier temps doit être une note ou un silence.
21 Le code ci-dessous propose deux alternatives à ce problème en
22 redéfinissant l'aspect d'un silence.  Si la durée d'un temps ne
23 correspond pas à la noire, le @code{r4} inclus dans la définition devra
24 être remplacé par un silence de durée appropriée.
25
26 "
27   doctitlefr = "Barres rythmiques"
28
29   texidoc = "
30 In @qq{simple} lead-sheets, sometimes no actual notes are written,
31 instead only @qq{rhythmic patterns} and chords above the measures are
32 notated giving the structure of a song. Such a feature is for example
33 useful while creating/transcribing the structure of a song and also
34 when sharing lead sheets with guitarists or jazz musicians. The
35 standard support for this using @code{\\repeat percent} is unsuitable
36 here since the first beat has to be an ordinary note or rest. This
37 example shows two solutions to this problem, by redefining ordinary
38 rests to be printed as slashes. (If the duration of each beat is not a
39 quarter note, replace the @code{r4} in the definitions with a rest of
40 the appropriate duration).
41
42 "
43   doctitle = "Rhythmic slashes"
44 } % begin verbatim
45
46
47 % Macro to print single slash
48 rs = {
49   \once \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
50   \once \override Rest #'thickness = #0.48
51   \once \override Rest #'slope = #1.7
52   r4
53 }
54
55 % Function to print a specified number of slashes
56 comp = #(define-music-function (parser location count) (integer?)
57   #{
58     \override Rest #'stencil = #ly:percent-repeat-item-interface::beat-slash
59     \override Rest #'thickness = #0.48
60     \override Rest #'slope = #1.7
61     \repeat unfold $count { r4 }
62     \revert Rest #'stencil
63   #}
64 )
65
66 \score {
67   \relative c' {
68     c4 d e f |
69     \rs \rs \rs \rs |
70     \comp #4 |
71   }
72 }
73