[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question re: scheme, \transpose function
From: |
David Kastrup |
Subject: |
Re: Question re: scheme, \transpose function |
Date: |
Fri, 13 Sep 2024 22:19:09 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
William Rehwinkel via LilyPond user discussion <lilypond-user@gnu.org>
writes:
> Dear Yoshi,
>
> Actually, I think the procedure is working correctly, but using the
> \transpose function within a \relative is causing some weird
> output. For example, the file
>
> % --------
> \version "2.25.18"
> \relative c' {
> c16 <c \transpose c f c>
> c16 <c \transpose c f b>
> }
> % --------
>
> does not result in the output that I was expecting. Maybe someone else
> can say why this is, but I'll investigate more later.
I have no idea what you were expecting, but transposition produces
absolute music that is impervious to the effects of \relative.
And it is hard to see how this could be otherwise since
\relative c' { c c c }
repeats the same note while
\relative c' { c' c' c' }
generated three different notes, so translating
\relative c' { \transpose c c' { c } }
would produce { c'' c''' c'''' } if it were behaving like you appear to
think it should.
That is not what people expect from transposition.
You can of course write \transpose c c' \relative c' { c c c }
and that will work as expected.
The next thing to remember is that #music does not create a copy of
music while $music and \music do. And any music function (specifically
\transpose ) is allowed to change its arguments at will. Which means
that anything that is used more than once in a music function in a
manner that may modify it (like passing it to \transpose) _has_ to be
copied in order not to affect other uses of it.
--
David Kastrup