lilypond-user-fr
[Top][All Lists]
Advanced

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

Re: Une fonction pour saisir plus simplement certain rythmes


From: Gilles THIBAULT
Subject: Re: Une fonction pour saisir plus simplement certain rythmes
Date: Thu, 14 Feb 2008 10:41:51 +0100

Cette version fonctionne aussi pour les accords ...

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.11.37" %%devrait marcher aussi pour la 2.10

#(define isOdd #f)

#(define (transformEachNote chordElt)
( let ((dur (ly:music-property chordElt 'duration)))
(if (ly:duration? dur)
 (if isOdd
(set! (ly:music-property chordElt 'duration) (ly:make-duration 3 1 1 1)) ;; croche pointée (set! (ly:music-property chordElt 'duration) (ly:make-duration 4 0 1 1)) ;; double
 )
)
chordElt
))

#(define (getChords musicElt)
(begin
(if (eq? 'EventChord (ly:music-property musicElt 'name))
 (begin
  (map transformEachNote (ly:music-property musicElt 'elements))
  (set! isOdd (not isOdd))
 )
)
musicElt
))

MakeChrochePointeDouble = #(define-music-function (parser location m) (ly:music?)
(begin
(set! isOdd #t)
(music-map getChords  m)
))

%%%%%%%%%%%%%%

{ \new Staff \relative{
 \MakeChrochePointeDouble {c d e f g f e d <c e> <d f> <e g> <d f> }
 <c e>2
}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




reply via email to

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