lilypond-user
[Top][All Lists]
Advanced

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

Re: Suppress NoteNames output on ties ?


From: Xavier Scheuer
Subject: Re: Suppress NoteNames output on ties ?
Date: Sun, 20 Mar 2011 09:57:24 +0100

On 20 March 2011 09:35, Gilles THIBAULT <address@hidden> wrote:
>
> Try that
>
> %%%%%%%%%%%%%%%%%%%
> 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)
>               evt)
>           (else
>               (if (ly:music? elt) (ly:music-set-property! evt 'element
>                                           (tied-note->skip elt)))
>               (if (pair? elts) (ly:music-set-property! evt 'elements
>                                          (map tied-note->skip elts)))
>               evt))))
> (tied-note->skip music)))
>
> mymusic = { c'4 c' ~ c'2 }
> \score {
> <<
> \new Voice \mymusic
> \context NoteNames \tiedNoteToSkip \mymusic
> >>
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Good Week-end.

Could/did you add this to the LSR?
It should be the default behaviour IMHO (or at least a possible tunable
option).

Maybe one could discuss this with the devs and suggest Gilles' code as
a PATCH.

Cheers,
Xavier

-- 
Xavier Scheuer <address@hidden>



reply via email to

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