On Tue, 12 Oct 2010 01:00:28 +0200, Gilles Filippini
<gilles.filipp...@free.fr> wrote:
I thought I could trigger the mark using a function and a global
variable, but that doesn't work as expected. It seems the function is
evaluated only once while setting the "toto" part instead of being
evaluated in the context of each score:
%-------------------
repeatMark =
#(define-music-function
(parser location volte)
(number?)
(if repeat-mark-visible
#{
\once \override Score.RehearsalMark #'break-visibility =
#begin-of-line-invisible
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\once \override Score.RehearsalMark #'font-size = #0
\mark \markup $(string-join (list "repeat" (number->string volte)
"times"))
#}
#{ #}
))
toto = \relative c'' {
\mark \default
d1
\mark \default
\repeat volta 3 {
c b
}
\repeatMark #3
a
\mark \default
g
}
#(define repeat-mark-visible #t)
\score {
\toto
}
#(define repeat-mark-visible #f)
\score {
\unfoldRepeats {
\toto
}
}
%-------------------
Looking for another method :/
I think the following code does it, but putting the music inside a
function is probably not a good idea. Maybe some scheme specialist can
help you better, I'm surpassed beyond that...
%-------------------------------------------------------------------
\version "2.12.3"
repeatMark =
#(define-music-function
(parser location volte visible)
(number? boolean?)
(if visible
#{
\once \override Score.RehearsalMark #'break-visibility =
#begin-of-line-invisible
\once \override Score.RehearsalMark #'self-alignment-X = #RIGHT
\once \override Score.RehearsalMark #'font-size = #0
\mark \markup $(string-join (list "repeat" (number->string volte)
"times"))
#}
#{ #}
))
totito =
#(define-music-function
(parser location visible)
(boolean?)
#{
\relative c'' {
\mark \default
d1
\mark \default
\repeat volta 3 {
c b
}
\repeatMark #3 #$visible
a
\mark \default
g
}
#})
\score {
\totito ##t
}
\score {
\unfoldRepeats {
\totito ##f
}
}
%-------------------------------------------------------------------
greetings,
Vicente
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user