Pequeños retoques.
[lilypond-ejercicios.git] / bengtsson-funcion-tresillos.ly
blob93858ab54b0265d905fcf423ee0d3b6cf95f975f
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 m1 m2 m3)
13 (ly:music? ly:music? ly:music?)
14 #{ \times 2/3 { $m1 $m2 $m3 } #})
16 \score{
17 \relative c'{
18 % Using \triplet
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 } |