2017-04-10 3:45 GMT+02:00 Stan Mulder <st4588...@earthlink.net>: > Hi group. > > I'm trying to construct a certain volta ending where there is a first and > second ending, but the first ending does a D.S. to the sign, while the the > second ending is a multiple repeat for solos. I seem to have made it render > correctly, but I keep getting this error. Hopefully this is enough code: > > > warning: already have a volta spanner, ending that one prematurely > > [64] > > > DSalCoda = { > \once \override Score.RehearsalMark.self-alignment-X = #RIGHT > \mark \markup "D.S. al Coda" > } > > voltaSolos = \markup { "2, 3, 4 . . ." } > > \alternative { > { > s1 > \DSalCoda > \bar "||" > } > { > \set Score.repeatCommands = #(list (list 'volta voltaSolos) > 'start-repeat) > s1 > \bar ":|." > } > } > > > Stan
Hi Stan, (1) %%%%%%%%%%%%%%%%%%% In general, the settings accepted in the argument-list for repeatCommands may manually create repeats with or without alternative endings. Drawback: \unfoldRepeats doesn't work on those manual settings. See the following example where simple repeats are done (manually and via \repeat volta ...): \unfoldRepeats \relative { c''1 \set Score.repeatCommands = #'(start-repeat) d4 e f g \set Score.repeatCommands = #'(end-repeat) c1 \repeat volta 2 { d,4 e f g } } (2) %%%%%%%%%%%%%%%%%%% If you don't care about midi you could do the following. Note that 'start-repeat would be used to begin a (new) repeated section, but _not_ to start an alternative ending. Don't use it here. \repeat volta 2 { c'1 } \alternative { { d'1 } { \set Score.repeatCommands = #(list 'end-repeat ;; print the ending repeat-bar '(volta #f) ;; finish first volta (list 'volta voltaSolos) ;; set text for second volta ) e' } } Though, in your example you don't want the closing repeat-bar, but \bar "||". Hence 'end-repeat should be deleted and to ensure a closing first VoltaBracket use \allowVoltaHook "||" at top-level. Full example: \allowVoltaHook "||" DSalCoda = { \once \override Score.RehearsalMark.self-alignment-X = #RIGHT \mark \markup "D.S. al Coda" } voltaSolos = \markup { "2, 3, 4 . . ." } \repeat volta 2 {c4 c c c } \alternative { { c4 c c c \DSalCoda \bar "||" } { \set Score.repeatCommands = #(list '(volta #f) (list 'volta voltaSolos) ) c4 c c c \bar ":|." } } (3) %%%%%%%%%%%%%%%%%%% If you need unfoldRepeats, an override may fit better: \allowVoltaHook "||" DSalCoda = { \once \override Score.RehearsalMark.self-alignment-X = #RIGHT \mark \markup "D.S. al Coda" } voltaSolos = \markup { "2, 3, 4 . . ." } voltaTxt = \once \override Score.VoltaBracket.before-line-breaking = #(lambda (grob) (ly:grob-set-property! grob 'text voltaSolos)) %\unfoldRepeats \repeat volta 2 {c4 c c c } \alternative { { c4 c c c \DSalCoda \bar "||" } { \voltaTxt c4 c c c \bar ":|." } } HTH, Harm _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user