[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Convert rest to spacer
From: |
Leo Correia de Verdier |
Subject: |
Re: Convert rest to spacer |
Date: |
Mon, 13 Sep 2021 18:01:37 +0200 |
Thanks a lot!
Especially for the extending lilypond doc, which I knew is out there but didn’t
know the name of and couldn’t find. Great work!
> 13 sep. 2021 kl. 16:07 skrev Jean Abou Samra <jean@abou-samra.fr>:
>
> 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
>
>