]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/automatically-change-durations.ly
Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / Documentation / snippets / automatically-change-durations.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.16.0"
8
9 \header {
10   lsrtags = "rhythms"
11
12   texidoc = "
13 <code>shiftDurations</code> can be used to change the note lengths of a
14 piece of music.  It takes two arguments - the scaling factor as a power
15 of two, and the number of dots to be added as a positive integer.
16
17 "
18   doctitle = "Automatically change durations"
19 } % begin verbatim
20
21
22 \paper { indent = 0 }
23
24 music = \relative c'' { a1 b2 c4 d8 r }
25
26 \score {
27   \new Voice {
28     \time 4/2
29     \music
30     \time 4/4
31     \shiftDurations #1 #0 { \music }
32     \time 2/4
33     \shiftDurations #2 #0 { \music }
34     \time 4/1
35     \shiftDurations #-1 #0 { \music }
36     \time 8/1
37     \shiftDurations #-2 #0 { \music }
38     \time 6/2
39     \shiftDurations #0 #1 { \music }
40     \time 7/2
41     \shiftDurations #0 #2 { \music }
42   }
43 }