[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: convert from absolute to relative
From: |
Gilles THIBAULT |
Subject: |
Re: convert from absolute to relative |
Date: |
Fri, 22 Aug 2008 23:55:53 +0200 |
notes = { a2-"hello" b4 r b2 a-"bye" < c e g c'>1-"oho" }
{ \displayLilyMusic \skipMusic \notes }
results in
{ s2-"hello" s4 s s2 s-"bye" s s s s -"oho" }
note the 4 "s" where it should be s1!
You 're right.
So it's a bit longer that i thought :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
skipMusic = #(define-music-function (parser location music) (ly:music? )
(let ((last-event-was-skipEvent #f))
(music-filter
(lambda (y)
(let* ((skipEvent? (eq? (ly:music-property y
'name)'SkipEvent))
(res (or (not last-event-was-skipEvent)
(not skipEvent?))))
(set! last-event-was-skipEvent skipEvent?)
res))
(music-map
(lambda (x)
(let ((dur (ly:music-property x 'duration)))
(if (ly:duration? dur)
(make-music 'SkipEvent 'duration dur)
x)))
music))))
notes = { a2-"hello" b4 r b2 a-"bye" < c e g c' e' g'>1-"oho ;-)" }
\displayLilyMusic \skipMusic \notes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Gilles
NB
If we go on with this discussion i think we have to open a new topic
because we are far from the original one ...
- RE: convert from absolute to relative, (continued)
- RE: convert from absolute to relative, Steve Dunlop, 2008/08/22
- Re: convert from absolute to relative, Mats Bengtsson, 2008/08/22
- Re: convert from absolute to relative, Eluze Weehaeli, 2008/08/22
- Re: convert from absolute to relative, Gilles THIBAULT, 2008/08/22
- Re: convert from absolute to relative, James E. Bailey, 2008/08/22
- Re: convert from absolute to relative, Eluze, 2008/08/22
- Re: convert from absolute to relative,
Gilles THIBAULT <=
- Re: convert from absolute to relative, Eluze, 2008/08/22
- Re: convert from absolute to relative, Valentin Villenave, 2008/08/23
- Re: convert from absolute to relative, Gilles THIBAULT, 2008/08/23
- Re: convert from absolute to relative, Johan Vromans, 2008/08/22
- Re: convert from absolute to relative, Jonathan Kulp, 2008/08/22
- Re: convert from absolute to relative, Johan Vromans, 2008/08/23
- Re: convert from absolute to relative, Yota, 2008/08/22
- Re: convert from absolute to relative, Johan Vromans, 2008/08/23