1 % Many many thanks to Mats for this useful snippet!
4 % First version, with a single argument, i.e. the
5 % syntax is \triplet{ c d e }
6 triplet
= #(define-music-function
(parser location music
) (ly
:music?
)
7 #{ \times 2/3 $music
#})
10 % Second version, with three arguments, i.e. the
11 % syntax is \trip c d e
12 trip
= #(define-music-function
(parser location m
1 m
2 m
3)
13 (ly
:music? ly
:music? ly
:music?
)
14 #{ \times 2/3 { $m
1 $m
2 $m
3 } #})
19 c4 \triplet{ d8 e f } g4 \triplet{ f8 e d16 e } |
20 % Using \trip. Note the last beat, where you have to
21 % add curly braces to get exactly three arguments to \trip
22 c4 \trip d8 e f g4 \trip f8 e { d16 e } |