lilypond-user
[Top][All Lists]
Advanced

[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 19:21:51 +0200


Talking about utilities: Has anybody ever seen one that transforms a simple voice (pitches and durations) into a "ghost voice" consisting of spacers and
durations only  (e.g. c2 d e ==> s2 s s).

In scheme, it can be quite short :

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
skipMusic = #(define-music-function (parser location music) (ly:music? )
 (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" }

\skipMusic \notes
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Gilles




reply via email to

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