[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme function help
From: |
David Kastrup |
Subject: |
Re: Scheme function help |
Date: |
Sun, 15 Jun 2014 17:34:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Phil Holmes <address@hidden> 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
--
David Kastrup