[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 22:48:48 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Alec Bartsch <address@hidden> writes:
> On Sep 19, 2013, at 12:35 PM, David Kastrup <address@hidden> wrote:
>
>> 4 is a number. You want (ly:make-duration 2 0) instead.
>
> OK, great, this version is going in my jazz \include and will tighten up my
> code considerably:
>
> triplet = #(define-music-function (parser location tuplet-span music)
>
> ((ly:duration? (ly:make-duration 2 0)) ly:music?)
> #{
> \tuplet 3/2 $tuplet-span { $music }
> #})
When in doubt, you can always make do with the following:
triplet = #(define-music-function (parser location tuplet-span music)
((ly:duration?) ly:music?)
(if tuplet-span
#{
\tuplet 3/2 $tuplet-span $music
#}
#{
\tuplet 3/2 4 $music
#}))
Just using the default #f for a defaulted value can save a lot of
thinking sometimes.
--
David Kastrup
Re: Bracket with text label, Alec Bartsch, 2013/09/19