I tried to change the tiedNoteToSkip procedure to also skip slurs. For some
reason, it does not seem to work the same way. It skips the first note in a
3 note slur, but not the second.

Here is the script:

\version "2.19.15"

#(define (name-of music) (ly:music-property music 'name))

tiedNoteToSkip = #(define-music-function (parser location music) (ly:music?)

(let ((prev-was-tie? #f))

(map-some-music

(lambda (evt)

(cond ((memq (name-of evt) '(EventChord NoteEvent))

(let ((old-flag prev-was-tie?))

(set! prev-was-tie? #f)

(let ((res (music-filter (lambda(x)

(or (not (or (eq? (name-of x) 'SlurEvent)

(eq? (name-of x) 'TieEvent)))

(begin (set! prev-was-tie? #t)

#f)))

evt)))

(if old-flag (skip-of-length evt) res))))

(else (ly:music-property music 'duration #f))))

music)))

 music = \relative c' {e4 e8 ( d16 e16) g2 g g16 (c16 a8) g4 c4 ~c~ c}

mus = \tiedNoteToSkip \music

\score {

\new Staff {

<<

\new Voice {

\music

}

\context NoteNames {

 \mus

  }

>>

}

\layout {

\context {

\Voice

%\consists \SarigamaEngraver

\remove Note_heads_engraver

\remove Rest_engraver

\consists Completion_heads_engraver

\consists Completion_rest_engraver

 }

} }



[image: Inline image 1]
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to