Jay Vara <j...@diljun.com> writes: > I am trying to display all the names that appear in a piece of music > (NoteEvent etc.) using map-some-music. It the function musShow is only > printing the top level name. What am I missing here? > > %%%%%%%%%%%%%%%%%%%% > \version "2.18.2" > #(define (showMus music) (display-scheme-music (ly:music-property music > 'name "Not Defined"))) > > musShow = #(define-music-function (parser location myx ) (ly:music?) > (map-some-music > (lambda (evt) (showMus evt )) myx) > #{ #}) > > > music = {c ~ c} > > > \musShow #music > %%%%%%%%%%%%%%%%%%%
The return value of map-some-music is interpreted. Anything but #f stops recursion. A music expression replaces the original. Since you don't want to change the original music, you probably rather want for-some-music, and then you'll still need to supply a return value indicating whether you want to recurse or not. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user