Thank you!

On abr. 21 2022, at 9:10 pm, Jean Abou Samra <[email protected]> wrote:
> Le 21/04/2022 à 19:50, Martín Rincón Botero a écrit :
> > Would it be possible to update it to work on Lilypond 2.22.1?
>
>
> The code contains spurious Unicode "zero-width space" characters, one among
> the newlines between the end of append-merge and "mergeSkips =", and another
> between the end of \mergeFullBarRests and \score. Try removing these.
> Updated
> snippet:
>
> \version "2.22.2"
> #(define (append-merge x l r)
> "Add x to the head of list l, merging skips,
> and if r is true also merging full measure rests."
> (if (and (pair? l)
> (ly:music? x)
> (ly:music? (car l))
> (or (and (music-is-of-type? x 'skip-event)
> (music-is-of-type? (car l) 'skip-event))
> (and r
> (music-is-of-type? x 'multi-measure-rest)
> (music-is-of-type? (car l) 'multi-measure-rest)))
> (not (pair? (ly:music-property (car l) 'articulations))))
> (let ((total
> (ly:moment-add
> (ly:music-duration-length (car l))
> (ly:music-duration-length x)
> )))
> (set! (ly:music-property x 'duration)
> (make-duration-of-length total))
> (cons x (cdr l)))
> (cons x l)))
>
> mergeSkips = #(define-music-function
> (parser location rests-also music) ((boolean?) ly:music?)
> "Merge successive skips in sequential music,
> optionally merge full-measure rests as well."
> (music-map
> (lambda (m)
> (if (music-is-of-type? m 'sequential-music)
> (ly:music-set-property! m
> 'elements
> (fold-right (lambda (x l)
> (append-merge x l rests-also))
> '()
> (ly:music-property m 'elements))))
> m)
> music))
>
> mergeFullBarRests = #(define-music-function
> (parser location music) (ly:music?)
> #{ \mergeSkips ##t $music #})
>
> \score {
> \mergeFullBarRests {
> \context Staff = "staff1" {
> \compressEmptyMeasures
> c1 R1 R1 R1
> }
> }
> }
>
>
> Best,
> Jean
>

Reply via email to