@lilypondfile[verbatim,quote,texidoc,doctitle]
{making-glissandi-breakable.ly}
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{extending-glissandi-across-repeats.ly}
+
@seealso
Music Glossary:
@rglos{glissando}.
@cindex repeat and measure number
@cindex timing information and repeats
@cindex measure number and repeats
-@cindex repeat and slur
-@cindex slur and repeat
+@cindex repeats and slur
+@cindex slur and repeats
+@cindex glissandi and repeats
+@cindex repeats and glissandi
Slurs that span from a @code{\repeat} block into an
@code{\alternative} block will only work for the first alternative
Also, slurs cannot wrap around from the end of one
alternative back to the beginning of the repeat.
+Glissandi that span from a @code{\repeat} block into an
+@code{\alternative} block will only work for the first alternative
+ending. The visual appearance of a continuing glissando in other
+alternative blocks may be indicated by coding a glissando starting
+on a hidden grace note. For an example, see
+@qq{Extending glissandi across repeats} under Selected Snippets
+in @ref{Glissando}.
+
If a repeat that begins with an incomplete measure has an
@code{\alternative} block that contains modifications to the
@code{measureLength} property, using @code{\unfoldRepeats} will
--- /dev/null
+% DO NOT EDIT this file manually; it is automatically
+% generated from Documentation\snippets\new
+% Make any changes in Documentation/snippets/new/
+% and then run scripts/auxiliar/makelsr.py
+%
+% This file is in the public domain.
+%% Note: this file works from version 2.17.6
+\version "2.17.6"
+
+\header {
+ lsrtags = "staff-notation, tweaks-and-overrides"
+ texidoc = "
+A glissando which extends into several @code{\\alternative} blocks
+can be simulated by adding a hidden grace note with a glissando
+at the start of each @code{\\alternative} block. The grace note
+should be at the same pitch as the note which starts the initial
+glissando. This is implemented here with a music function which
+takes the pitch of the grace note as its argument.
+
+Note that in polyphonic music the grace note must be matched with
+corresponding grace notes in all other voices.
+"
+ doctitle = "Extending glissandi across repeats"
+} % begin verbatim
+
+repeatGliss = #(define-music-function (parser location grace)
+ (ly:pitch?)
+ #{
+ % the next two lines ensure the glissando is long enough
+ % to be visible
+ \once \override Glissando.springs-and-rods
+ = #ly:spanner::set-spacing-rods
+ \once \override Glissando.minimum-length = #3.5
+ \once \hideNotes
+ \grace $grace \glissando
+ #})
+
+\score {
+ \relative c'' {
+ \repeat volta 3 { c4 d e f\glissando }
+ \alternative {
+ { g2 d }
+ { \repeatGliss f g2 e }
+ { \repeatGliss f e2 d }
+ }
+ }
+}
+
+music = \relative c' {
+ \voiceOne
+ \repeat volta 2 {
+ g a b c\glissando
+ }
+ \alternative {
+ { d1 }
+ { \repeatGliss c e1 }
+ }
+}
+
+\score {
+ \new StaffGroup <<
+ \new Staff <<
+ \context Voice { \clef "G_8" \music }
+ >>
+ \new TabStaff <<
+ \context TabVoice { \clef "moderntab" \music }
+ >>
+ >>
+}
\ No newline at end of file
--- /dev/null
+\version "2.17.6"
+
+\header {
+ lsrtags = "staff-notation, tweaks-and-overrides"
+ texidoc = "
+A glissando which extends into several @code{\alternative} blocks
+can be simulated by adding a hidden grace note with a glissando
+at the start of each @code{\alternative} block. The grace note
+should be at the same pitch as the note which starts the initial
+glissando. This is implemented here with a music function which
+takes the pitch of the grace note as its argument.
+
+Note that in polyphonic music the grace note must be matched with
+corresponding grace notes in all other voices.
+"
+ doctitle = "Extending glissandi across repeats"
+}
+
+repeatGliss = #(define-music-function (parser location grace)
+ (ly:pitch?)
+ #{
+ % the next two lines ensure the glissando is long enough
+ % to be visible
+ \once \override Glissando.springs-and-rods
+ = #ly:spanner::set-spacing-rods
+ \once \override Glissando.minimum-length = #3.5
+ \once \hideNotes
+ \grace $grace \glissando
+ #})
+
+\score {
+ \relative c'' {
+ \repeat volta 3 { c4 d e f\glissando }
+ \alternative {
+ { g2 d }
+ { \repeatGliss f g2 e }
+ { \repeatGliss f e2 d }
+ }
+ }
+}
+
+music = \relative c' {
+ \voiceOne
+ \repeat volta 2 {
+ g a b c\glissando
+ }
+ \alternative {
+ { d1 }
+ { \repeatGliss c e1 }
+ }
+}
+
+\score {
+ \new StaffGroup <<
+ \new Staff <<
+ \context Voice { \clef "G_8" \music }
+ >>
+ \new TabStaff <<
+ \context TabVoice { \clef "moderntab" \music }
+ >>
+ >>
+}
\ No newline at end of file