2018-03-11 8:26 GMT+01:00 David Kastrup <[email protected]>:
> paolo prete <[email protected]> writes:
>
> > Hello.
> > Do you know how to modify a NoteEvent so that it becomes a RestEvent, or
> > (vice-versa) in Scheme?
>
> You can't.
>
Why do you say that I can't, if changing the 'name property did the job
(look at the snippet below)?
Do you mean that this is sort of a hack?
Thanks
%%%%%%%%%%%%%%
foo = #(define-music-function (parser location music1) (ly:music? )
(begin
(map
(lambda (x)
(if (music-is-of-type? x 'rest-event)
(begin
(ly:music-set-property! x 'name 'NoteEvent)
(ly:music-set-property! x 'pitch (ly:make-pitch 0 3))
)
;else
(begin
(ly:music-set-property! x 'name 'RestEvent)
(ly:music-set-property! x 'pitch '())
)
)
)
(ly:music-property music1 'elements)
)
#{ $music1 #}))
{ \displayMusic \foo { f'4 r } }
%%%%%%%%%%%%%%%%%%
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user