|
From: | Gilles THIBAULT |
Subject: | Re: Suppress NoteNames output on ties ? |
Date: | Sun, 20 Mar 2011 21:53:22 +0100 |
Oups, yes i see the problem. Some event like 'LineBreakEvent are integrated an EventCHord elements listThe \noBreak is necessary to prevent system breaks at the dashed bar. I noticed that the function was not suppressing the NoteNames output for notes tied across the dashed bar lines. It appears that the \noBreak is the culprit. mymusic = { \time 7/4 c'2 c'2 ~ \bar "dashed" c'2.^"ok" | c'2 c'2 ~ { \noBreak \bar "dashed" } c'2.^"fail" | c'2 c'2 ~ \noBreak c'2.^"fail" | }
The failures are fixed if I change (cond ((and prev-was-tie? (eq? name 'EventChord))
I have not tested but it propably list to errors messages if you use several several notes for each chord.
Here is an other workaround (well the code becomes a bit heavier) %%%%%%%%%%%%%%%%%%%%%%ù 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) (pair? elts) (ly:duration? (ly:music-property (car elts) 'duration))) (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' ~ \noBreak c'2 } \score { << \new Voice \mymusic \context NoteNames \tiedNoteToSkip \mymusic >> } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Gilles
[Prev in Thread] | Current Thread | [Next in Thread] |