----- Original Message -----
From: "David Kastrup" <[email protected]>
To: "Phil Holmes" <[email protected]>
Cc: <[email protected]>
Sent: Sunday, June 15, 2014 4:34 PM
Subject: Re: Scheme function help
Phil Holmes <[email protected]> writes:
I'm not top posting
I'm typesetting quite a bit of mensural music, and using the same music
source for both mensural and modern. The mensural rests tend to be
pitched and the modern ones aren't. So I often have to use the following
as input:
\tag #'mens { f2 \rest } \tag #'mod { r2 }
and then I typeset the mensural version with \keepWithTag #'mens. I
thought it would be easier if I could have a music function that would
emit the tagged version from a function call; something like:
\menrest { f2 }
would provide the output shown above. I'm falling at the first hurdle of
getting the pitched rest:
menrest = #(define-music-function
(parser location noteval )
(ly:music?)
#{
\tag #'mens { #noteval \rest } \tag #'mod { #noteval }
#})
gives the error "unexpected \rest". And of course the second expression
only gives the note currently.
Could anyone point out the way forward, please?
Perhaps something like
--------------------------------------------------------------------------------
menrest = #(define-music-function (parser location note)
(ly:music?)
#{
\tag #'mens $(make-music 'RestEvent note)
\tag #'mod $(make-music 'RestEvent note 'pitch '())
#})
\displayLilyMusic \menrest f2
Thanks, David. Appreciated as ever.
--
Phil Holmes
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user