Hi Kieren,
I’m a little confused that the output of
%%% SNIPPET BEGINS
\version "2.25.11"
adjustPitch =
#(define-music-function (pitchIn pitchOut music) (ly:pitch? ly:pitch? ly:music?)
(music-map
(lambda (m)
(ly:message "Pitch is: ~a" (ly:music-property m 'pitch)) m)
music))
\adjustPitch es es \fixed c' { c4 d e f g a b c' }
%%% SNIPPET ENDS
is
Pitch is: #<Pitch c' >
Pitch is: #<Pitch d' >
Pitch is: #<Pitch e' >
Pitch is: #<Pitch f' >
Pitch is: #<Pitch g' >
Pitch is: #<Pitch a' >
Pitch is: #<Pitch b' >
Pitch is: #<Pitch c'' >
Pitch is: ()
Pitch is: ()
What is causing the last two output lines?
Elaborating on David's explanation, it might be instructive to study the
output of:
\version "2.25.9"
mappingFunction =
#(define-music-function (music) (ly:music?)
(music-map
(lambda (m)
(ly:message "Considering music:\n~a\n---------\n"
((@@ (lily) music->lily-string) m))
m)
music))
\mappingFunction
\new PianoStaff
<<
\new Staff \relative { c'4 d e c }
\new Staff \relative { c' g c c }
>>
In short: music-map really considers every music object in a music tree.
Lukas