Hi David,
> for-some-music does not return music. It works on music in-place. So
> the last thing in your music function must not be for-some-music but
> rather the music that you have been working on.
So…
%%% SNIPPET BEGINS
adjustPitch =
#(define-music-function (pitchIn pitchOut music) (ly:pitch? ly:pitch? ly:music?)
(for-some-music
(lambda (m)
(if (music-is-of-type? m 'note-event)
(if (and (= (ly:pitch-notename (ly:music-property m 'pitch))
(ly:pitch-notename pitchIn))
(= (ly:pitch-alteration (ly:music-property m 'pitch))
(ly:pitch-alteration pitchIn)))
(ly:music-set-property! m 'pitch
(ly:make-pitch
(ly:pitch-octave (ly:music-property m
'pitch))
(ly:pitch-notename pitchOut)
(ly:pitch-alteration pitchOut)))
m)
#f))
music)
music)
testmusic = \fixed c' { c4 d es e f g c' es' eis }
{ \testmusic }
{ \adjustPitch ees e \testmusic }
%%% SNIPPET ENDS
??
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.