Richard Shann <[email protected]> writes:
> In music which has a commentary the commentary often refers to excerpts
> from the main music. When the main music is transposed it is sometimes
> desirable that the music excerpts in the commentary should have the same
> transposition.
> To save editing these separately I would like to create a music function
> which would be invoked before both the music and any excerpts and would
> apply a given transposition.
>
> I have got as far as this, for transposing up a semitone as in
> \transpose c cis
>
> \version "2.18.0"
>
> #(define denemo-transpose (ly:make-pitch 0 0 (/ 1 2)))
You can write 1/2 instead of (/ 1 2) here. In 2.19.0, you can actually
write
#(define denemo-transpose #{ cis #})
but I am afraid that this interpretation is not available in 2.18.0
> myfunc = #(define-music-function
> (parser location arg)
> (ly:music?)
> #{
> \transpose c' #denemo-transpose #arg
> #})
>
>
> {c' d' e'
> \myfunc
> {c' d' e'}}
>
> As you can see I have defined a global variable denemo-transpose to be
> the pitch that c' should be transposed to.
> My problem is that the syntax for ly:make-pitch is difficult to
> generate, but I can't seem to find anything to convert a string like
> "cis'" to an ly:pitch? datum.
You could try
denemo-transpose = cis'
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user