Roland Goretzki wrote:
Hello list, hello Tomas,
You wrote:
Hi,
I try to use \transpose with a variable as parameter like
mykey = {d'}
melody = \transpose c' \mykey
\relative c' {... }
what??s wrong?
I get the message:
syntax error, unexpected STRING, expecting NOTENAME_PITCH or TONICNAME_PITCH
melody = \transpose c'
mykey
Incorrect syntax.
Have a look at the documentation at 6.1.8 Transpose:
\transpose c g' \mykey
which means:
transpose from c to c' the music defined in \mykey
Roland, I think you misunderstood the question. Tomas probably wants to
do the same transposition on a number of different scores and be able to
change the transposition of all of them, by only modifying a single line
in the
.ly file, namely a definition of a variable that's used as the second
argument of
\transpose. Unfortunately, the parser of LilyPond is hard-coded to only
accept
an explicit pitch name. The solution is therefore to define your own
music function
in Scheme, that is equivalent to \transpose but can handle a variable as
the input.
See Chapter 12 "Interfaces for programmers" and in particular 12.3 "Building
complicated functions", for hints on how to do it.
/Mats
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user