lilypond-user
[Top][All Lists]
Advanced

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

Re: adding 'HarmonicEvent?


From: Neil Puttock
Subject: Re: adding 'HarmonicEvent?
Date: Sat, 25 Sep 2010 23:28:25 +0100

On 24 September 2010 08:16, Marc Hohl <address@hidden> wrote:

> How can I place the 'articulations entry in the appropriate hierarchy level?

Look for a NoteEvent instead of an EventChord, then you can be sure
you're adding the HarmonicEvent to 'articulations for the relevant
notehead.

makeHarmonic =
#(define-music-function (parser location mus) (ly:music?)
   (define (make-harmonic mus)
     (let ((elts (ly:music-property mus 'elements))
           (elt (ly:music-property mus 'element)))
       ;; using cond is more convenient here
       (cond
        ((pair? elts)
         (map make-harmonic elts))
        ((ly:music? elt)
         (make-harmonic elt))
        ((music-is-of-type? mus 'note-event)
         (set! (ly:music-property mus 'articulations)   
               (append
                ;; don't overwrite existing 'articulations list
                (ly:music-property mus 'articulations)
                (list (make-music 'HarmonicEvent))))))
       mus))
   (make-harmonic mus))

Cheers,
Neil



reply via email to

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