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: Fri, 24 Sep 2010 09:16:15 +0200
User-agent: Thunderbird 2.0.0.24 (X11/20100317)

Marc Hohl schrieb:
[...]

Meanwhile, it tried to expand your function by adapting some lsr snippets,
http://lsr.dsi.unimi.it/LSR/Item?id=82
http://lsr.dsi.unimi.it/LSR/Item?id=696
Playing (or struggling?) with the latter, I came up with the following:

---8<---
\version "2.13.32"

#(define (make-harmonic music)
(let (
   (eventname (ly:music-property  music 'name))
   (elts (ly:music-property music 'elements))
   (elt  (ly:music-property music 'element))
)
(if (pair? elts)
    (begin
      (if (and (eq? eventname 'EventChord)
               (eq? (ly:music-property (car elts) 'name) 'NoteEvent))
          (set! (ly:music-property music 'elements)
(append elts (list 'articulations (list (make-music 'HarmonicEvent))))))
      (map make-harmonic elts)))
(if (ly:music? elt)
    (make-harmonic elt))
music
))

makeHarmonic = #(define-music-function (parser location music) (ly:music?)
(make-harmonic music)

)

\relative c' {
 \displayMusic <a\harmonic >4
 \displayMusic { \makeHarmonic { g f < c e > } }
}

---8<---

but as you can see in the output on the console, the 'articulations is still
at the same lavel as 'elements, not inside the 'elements list.
How can I place the 'articulations entry in the appropriate hierarchy level?


but all I can achieve so far is either an unchanged note head or a segfault :-(

The segfault disappeared, but the note heads are (of course) still unchanged.

TIA

Marc





reply via email to

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