]> git.donarmstrong.com Git - lilypond.git/commitdiff
Doc: Add example of extending glissandi over repeats (2591)
authorTrevor Daniels <t.daniels@treda.co.uk>
Fri, 9 Nov 2012 23:12:08 +0000 (23:12 +0000)
committerTrevor Daniels <t.daniels@treda.co.uk>
Wed, 14 Nov 2012 08:01:55 +0000 (08:01 +0000)
Documentation/notation/expressive.itely
Documentation/notation/repeats.itely
Documentation/snippets/extending-glissandi-across-repeats.ly [new file with mode: 0644]
Documentation/snippets/new/extending-glissandi-across-repeats.ly [new file with mode: 0644]

index 82614e6d2bfc70c2fd299912a7227dded9aacdae..1fb946b0178b9f96d7e63b2aad9a37a02ad95aa8 100644 (file)
@@ -1099,6 +1099,9 @@ Different styles of glissandi can be created.  For details, see
 @lilypondfile[verbatim,quote,texidoc,doctitle]
 {making-glissandi-breakable.ly}
 
+@lilypondfile[verbatim,quote,texidoc,doctitle]
+{extending-glissandi-across-repeats.ly}
+
 @seealso
 Music Glossary:
 @rglos{glissando}.
index 67317a670cc301ec4847a6b5782b3259bcb5a9b2..53da1bdf743b8e27e29cd35c72c1d4619f5f8351 100644 (file)
@@ -318,8 +318,10 @@ Internals Reference:
 @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
@@ -334,6 +336,14 @@ are shown in @ref{Modifying ties and slurs}.
 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
diff --git a/Documentation/snippets/extending-glissandi-across-repeats.ly b/Documentation/snippets/extending-glissandi-across-repeats.ly
new file mode 100644 (file)
index 0000000..629b657
--- /dev/null
@@ -0,0 +1,69 @@
+% 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
diff --git a/Documentation/snippets/new/extending-glissandi-across-repeats.ly b/Documentation/snippets/new/extending-glissandi-across-repeats.ly
new file mode 100644 (file)
index 0000000..0c7496c
--- /dev/null
@@ -0,0 +1,62 @@
+\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