lilypond-user
[Top][All Lists]
Advanced

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

Replace slur events with skip


From: Jay Vara
Subject: Replace slur events with skip
Date: Mon, 17 Nov 2014 12:37:51 +0000

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

}

} }



Inline image 1


reply via email to

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