From 784e1e7a6b4b5c086a54267aa2d1e34e5aaa254c Mon Sep 17 00:00:00 2001 From: Trevor Daniels Date: Fri, 9 Nov 2012 23:12:08 +0000 Subject: [PATCH] Doc: Add example of extending glissandi over repeats (2591) --- Documentation/notation/expressive.itely | 3 + Documentation/notation/repeats.itely | 14 +++- .../extending-glissandi-across-repeats.ly | 69 +++++++++++++++++++ .../new/extending-glissandi-across-repeats.ly | 62 +++++++++++++++++ 4 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 Documentation/snippets/extending-glissandi-across-repeats.ly create mode 100644 Documentation/snippets/new/extending-glissandi-across-repeats.ly diff --git a/Documentation/notation/expressive.itely b/Documentation/notation/expressive.itely index 82614e6d2b..1fb946b017 100644 --- a/Documentation/notation/expressive.itely +++ b/Documentation/notation/expressive.itely @@ -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}. diff --git a/Documentation/notation/repeats.itely b/Documentation/notation/repeats.itely index 67317a670c..53da1bdf74 100644 --- a/Documentation/notation/repeats.itely +++ b/Documentation/notation/repeats.itely @@ -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 index 0000000000..629b657ebf --- /dev/null +++ b/Documentation/snippets/extending-glissandi-across-repeats.ly @@ -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 index 0000000000..0c7496c0d2 --- /dev/null +++ b/Documentation/snippets/new/extending-glissandi-across-repeats.ly @@ -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 -- 2.39.2