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: James E. Bailey
Subject: Re: convert from absolute to relative
Date: Fri, 22 Aug 2008 19:48:11 +0200


Am 22.08.2008 um 19:21 schrieb Gilles THIBAULT:


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

You have no idea how much I love this.




reply via email to

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