Robert Schmaus <robert.schm...@web.de> writes:

> Dear Ponderers,
>
> so far, I was completely satisfied with out-of-the box lilypond and
> rarely used anything involving scheme. Mainly because, I find this
> language very counter-intuitive, but that's maybe because I code in
> C-like languages all the time.
>
> Anyway, my project was to make me a function with which I could switch
> repeats from "volta" to "unfold" variants - in scores I need to have
> the unfold variant, but for some instruments it would be convenient to
> have long but repeating parts not unfolded but in volta brackets with
> an indication of the number of repetitions.
>
> As a very simple solution, I came up with this (in real life, the
> scheme is in a separate file, but this seems to make no difference
> here ...):

Real simple would be

repeattype = "volta"

... \repeat \repeattype 2 { ... } ...

> \version "2.19"
>
> useRepeatVolta = #(define urv #t)
> useRepeatUnfold = #(define urv #f)

This first defines urv as #t and assigns the result of that definition
(*undefined* I think) to useRepeatVolta, then defines urv as #f and
assigns *undefined* to useRepeatUnfold .

Sort of the equivalent of

auto useRepeatVolta = urv = true;
auto useRepeatUnfold = urv = false;

followed by later "execution" of

    useRepeatVolta;

This is not a function definition or a function call.  Try
define-void-function (even without arguments) for creating something
that behaves like a function.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to