]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/extending-glissandi-across-repeats.ly
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / Documentation / snippets / extending-glissandi-across-repeats.ly
1 %% DO NOT EDIT this file manually; it is automatically
2 %% generated from LSR http://lsr.di.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.19.22"
8
9 \header {
10   lsrtags = "staff-notation, tweaks-and-overrides"
11
12   texidoc = "
13 A glissando which extends into several @code{\\alternative} blocks can
14 be simulated by adding a hidden grace note with a glissando at the
15 start of each @code{\\alternative} block.  The grace note should be at
16 the same pitch as the note which starts the initial glissando.  This is
17 implemented here with a music function which takes the pitch of the
18 grace note as its argument.
19
20 Note that in polyphonic music the grace note must be matched with
21 corresponding grace notes in all other voices.
22
23 "
24   doctitle = "Extending glissandi across repeats"
25 } % begin verbatim
26
27 repeatGliss = #(define-music-function (grace)
28   (ly:pitch?)
29   #{
30     % the next two lines ensure the glissando is long enough
31     % to be visible
32     \once \override Glissando.springs-and-rods
33       = #ly:spanner::set-spacing-rods
34     \once \override Glissando.minimum-length = #3.5
35     \once \hideNotes
36     \grace $grace \glissando
37   #})
38
39 \score {
40   \relative c'' {
41     \repeat volta 3 { c4 d e f\glissando }
42     \alternative {
43       { g2 d }
44       { \repeatGliss f g2 e }
45       { \repeatGliss f e2 d }
46     }
47   }
48 }
49
50 music =  \relative c' {
51   \voiceOne
52   \repeat volta 2 {
53     g a b c\glissando
54   }
55   \alternative {
56     { d1 }
57     { \repeatGliss c \once \omit StringNumber e1\2 }
58   }
59 }
60
61 \score {
62   \new StaffGroup <<
63     \new Staff <<
64       \context Voice { \clef "G_8" \music }
65     >>
66     \new TabStaff  <<
67       \context TabVoice { \clef "moderntab" \music }
68     >>
69   >>
70 }