[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Weird key sig accumulation
From: |
David Kastrup |
Subject: |
Re: Weird key sig accumulation |
Date: |
Mon, 25 Apr 2016 00:48:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Simon Albrecht <address@hidden> writes:
> Hello everybody,
>
> I’ve built some music functions to handle a large, multi-section
> piece, and ran into a strange problem, which I could boil down to the
> attached example.
> If the concat-part function is called on the \key expression multiple
> times in parallel, the \key expressions are accumulated in a way I’ve
> never seen before. Why would that be?
Because you are not copying the expression and still using it multiple
times. A big no-no. Consequently, \transpose works multiple times on
the identical expression.
If you use stuff multiple times, _copy_ it. Because LilyPond will
generally _change_ expressions it is working on.
Multiple \transpose, multiple \relative, multiple other stuff: all that
you want to avoid occuring on the identical expression several times.
> \version "2.19.39"
>
> global.1 = { \key c \major }
>
> concat-part =
> #(define-music-function (al) (list?)
> (make-sequential-music (map cdr al)))
> buildPart =
> #(define-music-function () ()
> #{
> \new Voice <<
> \concat-part \global
> { c'1 }
> >>
> #})
>
> \transpose c d <<
> \buildPart
> \buildPart
>>>
--
David Kastrup