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 ...
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user