Dear LilyPonders, I am grateful for all your input. Synthesizing all the points raised in this thread, I realized the solution was to make the .ly file in which I made the function in the absolute pitch mode. Then the original function worked as expected.
Thank you once again— Yoshi On Fri, Sep 13, 2024 at 4:19 PM David Kastrup <[email protected]> wrote: > William Rehwinkel via LilyPond user discussion <[email protected]> > 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 >
