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: Wed, 16 Feb 2011 14:14:56 +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).
from the docs i see that it might be possible if somehow another \relative can be included within the transpose
doesnt work:
\relative { \transpose c d  {a4 b c d} }
does work:
\transpose c d  { \relative { a4 b c d} }

i wonder is it possible to add a relative within the function? or maybe allow the function to accept \relative as part of its input argument?i guess the former would be better if its possible

my goal is so that the interval defined in the function is always placed above the root pitch passed as an argument

any ideas if this is possible?

thanks

rob

Cheers,
Neil





reply via email to

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