lilypond-user
[Top][All Lists]
Advanced

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

Re: rhythm template function


From: Stefan Thomas
Subject: Re: rhythm template function
Date: Tue, 3 Jun 2008 11:21:31 +0200

Dear Gilles,
thanks for Your tipp! But I tried it with an own example, that does not work, I don't know why:
\include "rhythmen.ly"

 sax = #(define-music-function (parser location musicA musicB musicC)
              (ly:music? ly:music? ly:music?)
#{
     \set tupletSpannerDuration = #(ly:make-moment 1 4)
   
     \times 4/5 \makeRhythm $musicA "16 16 16 16 16"
   
     \unset tupletSpannerDuration
     \makeRhythm $musicB "4"
    
#})
 
 
\new Staff \relative
{
    \sax  { c d e f g } a
 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

2008/6/2 Gilles THIBAULT <address@hidden>:
 
Yes, I tried the snippet You mentioned below (http://lsr.dsi.unimi.it/LSR/Item?id=390), but there is another problem: unfortunately it is difficult to integrate tuplets in it!

Using the rhythm.ly  defined in this snippet, you can do something like that.
 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\include rhythm.ly 
 
myRhythmWithTuplet = #(define-music-function (parser location musicA musicB musicC)
              (ly:music? ly:music? ly:music?)
#{
     \set tupletSpannerDuration = #(ly:make-moment 1 4)
     \times 2/3 \makeRhythm $musicA "8 8 8 8 8 8"  
     \times 4/5 \makeRhythm $musicB "16 16 16 16 16" 
     \times 2/3 \makeRhythm $musicC "8 8 8"
     \unset tupletSpannerDuration
#})
 
 
 
\new Staff \relative
{
 \myRhythmWithTuplet { c d e f g a} {b c d e f } {g a b}
 \myRhythmWithTuplet { c b a g f e} {d c b a g } {f e d}
 c1
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
You just have to define several arguments in your function.
 
Gilles


reply via email to

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