Hello,
here's a questions to the wise from a (half)newbie:
I'm just trying to write a music function which changes the
duration of notes (this is for a project with proportional Canons).
I'm using \displayMusic a lot and try to understand as much as
I can from the docs.
I made a simple example which works well so far:
%% example code
\version "2.9.8"
dottedHalf =
#(define-music-function (parser location note)
(ly:music?)
(set! (ly:music-property
(first (ly:music-property note 'elements)) 'duration)
(ly:make-duration 1 1 1 1))
note)
{ c'4 \dottedHalf c'4 }
%% end of example code
Two questions:
1) Could this be simplified with " ly:music-set-property!" ?
2) In the case of a chord, e.g. "{ \dottedHalf <c' e'>4 }" in the above
example,
this doesn't work, because the function "catches" the first NoteEvent only,
so I would need to "drill" (recursively?) into the EventChord.
Are there any examples showing this? (So far I only found examples of ADDING
things to an EventChord, but not replacing).
[Additional question: "first" is a GUILE feature?]
Hope my questions are clear enough and thanks for some hints!
Michael
(on a half sunny day in Vienna...)
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user