[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: |
Tue, 15 Feb 2011 21:22:40 +0000 |
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).
Cheers,
Neil