lilypond-user
[Top][All Lists]
Advanced

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

Re: Convert rest to spacer


From: Jean Abou Samra
Subject: Re: Convert rest to spacer
Date: Mon, 13 Sep 2021 16:07:28 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

Le 13/09/2021 à 15:49, Leo Correia de Verdier a écrit :
Dear list!

How would I go about to write a scheme function that converts all rests in a 
passage of music to spacer rests?

Thanks in advance!

/Leo


\version "2.22.1"

restsToSkips =
#(define-music-function (music) (ly:music?)
   (music-map
     (lambda (m)
       (if (music-is-of-type? m 'rest-event)
           (make-music 'SkipEvent m)
           m))
     music))

\restsToSkips { r1 c'2 s4 r4 }


Some explanations about music-map, music-is-of-type?
and make-music are at
https://extending-lilypond.readthedocs.io/en/latest/music.html#music-expressions

Best,
Jean





reply via email to

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