lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme artificial harmonic (transposition within chord)


From: Rob Canning
Subject: Re: scheme artificial harmonic (transposition within chord)
Date: Tue, 15 Feb 2011 21:34:57 +0000
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Neil Puttock wrote:
On 15 February 2011 14:25, Rob Canning <address@hidden> wrote:

where lies the error or is there a better way to do this - am slightly
suprised there is not a build in function for this... maybe there is?

There are several parser limitations you're encountering here.  The
only way around them is to stay in scheme when creating the new chord:

artHarm =
#(define-music-function (parser location note) (ly:music?)
   (let ((harm (ly:music-transpose (ly:music-deep-copy (car
(ly:music-property note 'elements)))
                                   (ly:make-pitch 0 3 0))))
     (set! (ly:music-property harm 'articulations)
           (list (make-music 'HarmonicEvent)))
     (set! (ly:music-property note 'elements)
           (append (ly:music-property note 'elements)
                   (list harm)))
     note))

{  \artHarm ais }

BTW, this only works properly in absolute note mode due to the way
transposing interacts with \relative { } blocks (there's a note in the
docs warning about this under \transpose).

this is great thank you!
these  chunks of scheme really help me get my head around things.
thank you too to patrick for your link - looks like some very useful stuff there

rob
Cheers,
Neil





reply via email to

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