[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheme artificial harmonic (transposition within chord)
From: |
Neil Puttock |
Subject: |
Re: scheme artificial harmonic (transposition within chord) |
Date: |
Wed, 23 Feb 2011 23:04:58 +0000 |
On 16 February 2011 14:14, Rob Canning <address@hidden> wrote:
> 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
I don't think it's possible since you'd have to wrap the transposed
music in a RelativeOctaveMusic object, which can't be used inside a
chord.
The only alternative I can think of is to make the arguments absolute,
even inside a \relative { } block:
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)))
(trans (make-music 'TransposedMusic 'element harm)))
(set! (ly:music-property harm 'articulations)
(list (make-music 'HarmonicEvent)))
(make-music 'RelativeOctaveMusic
'element (context-spec-music
(make-simultaneous-music
(list harm note))
'Bottom))))
\relative c' {
c4
\artHarm cis'
\artHarm as
\artHarm cis''
}
Cheers,
Neil