Vaughan McAlley <vaug...@mcalley.net.au> writes:

> I’ve spent way to long trying to work this out... the simple test file:
>
> %test1.ly
> \version "2.14.2"
>
> myTranspose =    \transpose c' c
> staffOneName = "Soprano"
>
> % Version for men’s choir
> %{
> myTranspose =  \transpose c' g
> staffOneName = "Alto"
> %}
>
> ...produces
>
> test1.ly:4:0: error: syntax error, unexpected STRING
>
> What’s going on here? There are no misplaced curly braces or the like...

That's the problem.  If you wrote

myTranspose =    \transpose c' c { }

then the transposition from c' to c would have referred to the curly
braces (and nothing else: myTranspose is just a single music
expression).  Written like you did it, it refers to staffOneName.

You probably need to write something like

myTranspose = #(define-music-function (parser location music) (ly:music?)
               #{ \transpose c' c $music #})

in order to have myTranspose take an argument.

-- 
David Kastrup


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to