Hi again,
> There is no necessity to return a new NoteEvent; you can just change
> pitch on the existing one.
>
> Music functions are allowed to modify their music arguments in place.
This is what I have so far, which appears to do what I want:
%%% SNIPPET BEGINS
\version "2.25.11"
adjustPitch =
#(define-music-function (pitchIn pitchOut music) (ly:pitch? ly:pitch? ly:music?)
(music-map
(lambda (m)
(if (music-is-of-type? m 'note-event)
(if (equal? (ly:pitch-notename (ly:music-property m 'pitch))
(ly:pitch-notename pitchIn))
(ly:music-set-property! m 'pitch (ly:make-pitch
(ly:pitch-octave (ly:music-property m 'pitch)) (ly:pitch-notename pitchOut) 0))
(make-music 'NoteEvent m))
(ly:message "Not of type"))
m)
music))
\adjustPitch ees e \fixed c' { c4 d es f g c' es' }
%%% SNIPPET ENDS
Comments before I move to the next step…?
Thanks,
Kieren.
______________________________________________
My work day may look different than your work day. Please do not feel obligated
to read or respond to this email outside of your normal working hours.