|
From: | Gilles THIBAULT |
Subject: | Re: Suppress NoteNames output on ties ? |
Date: | Sun, 20 Mar 2011 14:42:28 +0100 |
Why not, but not before 1 or 2 days, I have to finish a score before tomorow. (Working on this snippet was already not very reasonable ...). I have however change a bit the snippet. It is now cleaner because it deletes all tie events.Could/did you add this to the LSR?
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tiedNoteToSkip = #(define-music-function (parser location music) (ly:music?) (let ((prev-was-tie? #f)) (define (tied-note->skip evt) (let ((elt (ly:music-property evt 'element)) (elts (ly:music-property evt 'elements)) (name (ly:music-property evt 'name))) (cond ((and prev-was-tie? (eq? name 'EventChord)) (set! prev-was-tie? #f) (skip-of-length evt)) ((eq? name 'TieEvent) (set! prev-was-tie? #t) #f) ;; all tie events will be deleted (else (if (ly:music? elt) (ly:music-set-property! evt 'element (tied-note->skip elt))) (if (pair? elts) (ly:music-set-property! evt 'elements (filter-map tied-note->skip elts))) evt)))) (tied-note->skip music))) mymusic = { c'4 c' ~ c'2 } \score { << \new Voice \mymusic \context NoteNames \displayMusic \tiedNoteToSkip \mymusic >> } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Well, i never use the NoteNames context, so i have no ideas how it should behaves.It should be the default behaviour IMHO (or at least a possible tunable option).
Gilles, going back at work ...
[Prev in Thread] | Current Thread | [Next in Thread] |