lilypond-user
[Top][All Lists]
Advanced

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

Re: adding 'HarmonicEvent?


From: Marc Hohl
Subject: Re: adding 'HarmonicEvent?
Date: Sun, 26 Sep 2010 10:56:26 +0200
User-agent: Thunderbird 2.0.0.24 (X11/20100317)

Neil Puttock schrieb:
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.

Ok, I understand now better, why my soulution didn't work as expected.
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))
Works like a charm, thank you!

Marc
Cheers,
Neil





reply via email to

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