2014-07-14 14:03 GMT+02:00 John McWilliam <jsmcwill...@gmail.com>: > Hi, > I have followed this discussion with interest having had a similar > problem myself. Bagpipe music (marches) have a standard format, usually four > parts and each part is repeated and may have alternative endings. The repeat > bars are shown at the beginning and end of each part (including the > beginning) > and alternative endings may be the same for up to two parts. When this > involves > the fourth (last) part the alternative ending is usually closed with \bar > "|." > > I have had problems following this format in Lilypond. > - visuallising all repeat bars. > - combining \repeat volta and \set Score.repeatCommands causes warnings and > premature closure of the volta spanner. > - using \bar "|." in the middle of a piece (This you seem to have solved > as far as using \bar "||" is concerned but the solution doen't work for > \bar "|." > I enclose the following snippet to illustrate my problem and hope that > somebody > will be able to respond with suggestions. > > ----------------------------------------------------------- > > \version "2.18.0" > > > music = \relative c' { > \key c \major \time 4/4 > > %Part I with two alternative repeat ends > \repeat volta 2 { > e4. e8 f4. f8 } > \alternative { { > g4. g8 a4. a8 } > {
I'd not mix \repeat volta ... and \alternative ... with manual repeat settings. > % If the following volta text is introduced the previous repeat bar > disappears > % and a warning reports premature closure of the volta spanner. The spanner > % remains open to the right. > % \set Score.repeatCommands = #'((volta "2. --1,2")) > b4. b8 c4. c8 > % \set Score.repeatCommands = #'((volta #f)) > \bar ".|:-||" \break } > % The second ending should finish with \bar "|." as this is also the ending > for > % the second part and as such the end of the piece. Introducing \bar "|.", > % however, surpresses the repeat bar at the beginning of the second part. I > also \bar ".|:-|." isn't defined! You can define it yourself, though > % tried \bar ".|:-|." with a similar result. > } > %Part II with the same repeat end as part I > \repeat volta 2 { > e4. e8 f4. f8 > \set Score.repeatCommands = #'((volta "1.")) > g4. g8 f4.f8 > \set Score.repeatCommands = #'((volta #f)) > } > > }% end relative > > \score { > \new Staff { \music } > } > %.................................................. how about: \version "2.18.0" \defineBarLine ".|:-|." #'("|." ".|:" "|.") %% needed to allow the "volta-hook" mid-line: #(allow-volta-hook ".|:-|.") music = \relative c' { \key c \major \time 4/4 \bar ".|:" \set Score.repeatCommands = #'(start-repeat) e4. e8 f4. f8 \set Score.repeatCommands = #'((volta "1.")) g4. g8 a4. a8 \set Score.repeatCommands = #'((volta #f) (volta "2. --1,2") end-repeat) b4. b8 c4. c8 \bar ".|:-|." \set Score.repeatCommands = #'((volta #f)) \break %% not changed: \repeat volta 2 { e4. e8 f4. f8 \set Score.repeatCommands = #'((volta "1.")) g4. g8 f4.f8 \set Score.repeatCommands = #'((volta #f)) } }% end relative \score { \new Staff { \music } } HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user