lilypond-user
[Top][All Lists]
Advanced

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

Re: adding 'HarmonicEvent?


From: Éditions IN NOMINE
Subject: Re: adding 'HarmonicEvent?
Date: Tue, 21 Sep 2010 11:21:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2

Hi.
I think I see what you want to achieve : you want to write in Scheme the function \harmonicsOn \harmonicsOff shown here ?
Before I dive into Scheme, tell if I am on the right side !

Best regards
JMarc

On 21/09/2010 08:22, Marc Hohl wrote:
Éditions IN NOMINE schrieb:
Naerly the same, that works perfectly (welle I'm quite enthousiastic beacause it's my first scheme function !) :

makeHarmonic =
  #(define-music-function (parser location note)(ly:music?)
  "force noteHead to harmonic"
  (let ((result-note (ly:music-deep-copy note)))
    (set! (ly:music-property (first (ly:music-property result-note 'elements)) 'articulations)
          (list (make-music (quote HarmonicEvent)))
    )
    result-note)
    )

{c''4 \makeHarmonic c''4}

Best regards.
Thank you! It works, but only for a single note as argument, something like
\makeHarmonic < c g >4 applies the HarmonicEvent only to the first note.
And \makeHarmonic { c4 d e f g } doesn't change anything at all.

Do you have an idea how to generalize this function?

Marc




reply via email to

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