lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bracket with text label


From: David Kastrup
Subject: Re: Bracket with text label
Date: Thu, 19 Sep 2013 21:35:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Alec Bartsch <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]