Thanks for the help Nicolas & Kieren. I've got the following:

fingerSwitch = #(define-music-function (parser location text) (string?)
(make-music 'SequentialMusic 'elements
 (list
  (make-music 'EventChord 'elements
   (list
    (make-music
     'TextScriptEvent
     'text
     (markup #:line (#:finger $text))
    )
   )
  )
 )
)
)

c4-\fingerSwitch "5"

but the error I get is that $text is an unbound variable. Since I don't really know much what I'm doing, I thought I'd ask for your help again.

Thanks,
Stewart

----- Original Message ----- From: "Nicolas Sceaux" <[EMAIL PROTECTED]>
To: "Stewart Holmes" <[EMAIL PROTECTED]>
Cc: <lilypond-user@gnu.org>
Sent: Tuesday, August 15, 2006 10:38 AM
Subject: Re: Markup macro?


Kieren MacMillan <[EMAIL PROTECTED]> writes:

Hi, Stewart:

I can do what I want with \markup { \finger "5-4" }, but I'm
looking for a
nice neat macro I can use instead of having to add markup every time.

Have you tried \displayMusic?  =)

Stewart,

when the straight-forward #{ #} possible solution fails, reverting to
plain scheme, with the help of \displayMusic, is indeed what should be
done.

Try:

 \displayMusic c'
 \displayMusic c'^\markup \finger "3-5"

and see the difference: that would be the body of your music function,
that will be used that way:

c'-\functionName "3-5"  %% you cannot use ^\funName or _\funName
                        %% so direction should be hard coded

If you don't find a working solution, ask again here.

BTW, these are functions, not macros.

nicolas




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

Reply via email to