lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several questions concerning scheme-music-function


From: David Kastrup
Subject: Re: Several questions concerning scheme-music-function
Date: Sat, 26 May 2018 15:47:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Robert Schmaus <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]