Alec Bartsch <[email protected]> writes:
> but still be able to do this on occasion:
>
> \triplet 2 { a4 b c a b c }
> How do I do the default value properly? My guess doesn't quite work:
>
> triplet = #(define-music-function (parser location tuplet-span
> music)((ly:duration? '4) ly:music?)
> #{
> \tuplet 3/2 $tuplet-span { $music }
> #})
4 is a number. You want (ly:make-duration 2 0) instead.
At one time I considered making #{ 4 #} a duration rather than a number,
but this gets really weird when one also wants to allow #{ 4\cm #}.
But you could do
duration = #(define-scheme-function (parser location d) (ly:duration?) d)
and then write things like
((ly:duration? #{ \duration 4 #}) ly:music?)
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user