[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: define-music-function -> unexpected EVENT_FUNCTION
From: |
Klaus Blum |
Subject: |
Re: define-music-function -> unexpected EVENT_FUNCTION |
Date: |
Mon, 26 Jan 2015 14:08:23 -0700 (MST) |
Hi Anders,
the "\rightHandFinger" command can only be used for a single note, not for a
whole "music" expression that could also be a chord or a sequence of notes
and rests.
Replacing "ly:music?" by "ly:pitch?" should do the trick:
%
---------------------------------------------------------------------------------
\version "2.19.15"
meTrans =
#(define-music-function (parser location mus txt) (ly:pitch? string?)
#{
\transpose c cis $mus \rightHandFinger
\markup\normal-text\bold\fontsize #0 $txt
#}
)
{
\transpose c cis c' \rightHandFinger \markup\normal-text\bold\fontsize #0
"A"
\meTrans c' "a"
}
%
---------------------------------------------------------------------------------
If you want to transpose more than just one note, you should split things
up:
One function to apply the fingering markup on single notes, another function
to transpose the whole music expression:
%
---------------------------------------------------------------------------------
\version "2.19.15"
rhf =
#(define-music-function (parser location txt) (string?)
#{
-\rightHandFinger \markup\normal-text\bold\fontsize #0 $txt
#}
)
meTrans =
#(define-music-function (parser location mus) (ly:music?)
#{
\transpose c cis $mus
#}
)
{
\transpose c cis c' \rightHandFinger \markup\normal-text\bold\fontsize #0
"A"
\meTrans {c' -\rhf "first" d' e' f' -\rhf "last"}
}
%
---------------------------------------------------------------------------------
Cheers,
Klaus
--
View this message in context:
http://lilypond.1069038.n5.nabble.com/define-music-function-unexpected-EVENT-FUNCTION-tp171024p171057.html
Sent from the User mailing list archive at Nabble.com.