Neil Puttock schrieb:
On 24 September 2010 08:16, Marc Hohl <m...@hohlart.de> 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user