2014-07-14 18:47 GMT+02:00 Thomas Morley <[email protected]>:
> 2014-07-14 14:03 GMT+02:00 John McWilliam <[email protected]>:
> I'd not mix \repeat volta ... and \alternative ... with manual repeat
> settings.
Correction, you _can_ mix them, _if_ you use correct syntax.
Though, it's a little complicated I think.
Therefore I made the following code sometime ago (and had completely
forgotten about it):
\version "2.16.2"
setRepeatCommand =
#(define-music-function (parser location arg)(scheme?)
#{
\applyContext #(lambda (ctx)
(let* ((where (ly:context-property-where-defined ctx 'repeatCommands))
(repeat-commands (ly:context-property where 'repeatCommands))
(to-append
(cond ((symbol? arg)
(list arg))
((or (boolean? arg) (markup? arg))
(list (list 'volta arg)))
(else '())))
(appended-settings (append repeat-commands to-append)))
;(newline)
;(display appended-settings)
;(newline)
(ly:context-set-property! where 'repeatCommands appended-settings)))
#})
%% maybe:
% #(allow-volta-hook "|")
startRepeat = \setRepeatCommand #'start-repeat
endRepeat = \setRepeatCommand #'end-repeat
startVolta-I = \setRepeatCommand #"1."
startVolta-II-IV = \setRepeatCommand \markup \fontsize #3 "2. - 4."
endVolta = \setRepeatCommand ##f
\relative c' {
a1
\startRepeat
b
\startVolta-I
c
\endRepeat
\endVolta
\startVolta-II-IV
d
\endVolta
e
}
voltaOne = \setRepeatCommand \markup { \text \fontsize #2 \bold "1.– " }
voltaTwo = \setRepeatCommand \markup { \text \fontsize #2 \bold "Fine" }
\relative c'' {
\time 4/2
\repeat volta 2 {
f2 g a4. (g8 f4) e
}
\alternative {
{
\voltaOne
d\breve
}
{
\endVolta
\endRepeat
\voltaTwo
d\breve
}
}
\bar "|."
}
Cheers,
Harm
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user