Deutsches Lilypond Forum (Archiv)
Allgemein => Fragen zu Funktionen => Thema gestartet von: chf am Montag, 16. September 2013, 19:25
-
Liebe Freunde,
wie ihr seht, habe ich schon was gefunden (2011),
allerdings mache ich wohl etwas falsch...
Gruß
chf
-
Hallo Christa,
Du hast vergessen
\set Score.repeatCommands =
in der zweiten Klammer zu setzen. Wahrscheinlich ein copy/paste-error.
Ich mußte Deinen Code allerdings erst mal in eine leserliche Form bringen bevor ich das Problem finden konnte.
Es ist mir ein Rätsel wie irgendjemand, einschließlich Dir selber, da den Überblick behalten kann.
Folgendes funktioniert jedenfalls:
\version "2.17.19"
voltaOne = \markup { \text \fontsize #2 \bold "1.– " }
voltaTwo = \markup { \text \fontsize #2 \bold "Fine" }
\relative c'' {
\time 4/2
\repeat volta 2 {
f2 g a4. (g8 f4) e
}
\alternative {
{
\set Score.repeatCommands =
#(list (list 'volta voltaOne))
d\breve
}
{
\set Score.repeatCommands =
#(list (list 'volta #f) (list 'volta voltaTwo) 'end-repeat)
d\breve
}
}
\bar "|."
}
Btw, Du gibst 2.17.19 an. Falls Du schon eine devel-version gebrauchst, dann würde ich immer die neueste nehmen,
z.Zt. 2.17.26
Gruß,
Harm
-
Nachtrag:
Du könntest auch die Erkenntnisse aus diesem (https://liarchiv.joonet.de/index.php?topic=1533.msg8536) Thread benutzen, insbesondere meine Antwort hier (https://liarchiv.joonet.de/index.php?topic=1533.msg8536#msg8536).
Das führt zu:
\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)))
(ly:context-set-property! where 'repeatCommands appended-settings)))
#})
% startRepeat = \setRepeatCommand #'start-repeat
endVolta = \setRepeatCommand ##f
endRepeat = \setRepeatCommand #'end-repeat
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 "|."
}
Gruß,
Harm
-
Hallo Harm,
es ist immer wieder schön, wenn das Brett vorm Kopf einen Riss kriegt...
Danke!
Die Variante in "2.16.2" scheitert wieder and den zusammenstoßenden Klammern. Deshalb verwende ich in solchen Fällen jetzt "2.17..."
Sonst bleibe ich noch "stabil".
Gruß
Christa