paolo prete <paoloprete...@gmail.com> writes:

> Hello.
> Do you know how to modify a NoteEvent so that it becomes a RestEvent, or
> (vice-versa) in Scheme?

You can't.

> I tried:
>
> (ly:music-set-property! x 'name 'RestEvent)
>
> The note actually becomes a rest, but I don't know if it's the proper way
> to obtain that, because if I display the scheme object with \displayMusic I
> see (note the duplication of 'RestEvent token):
>
> (make-music
>     'RestEvent
>     'name
>     'RestEvent
>     'duration
>     (ly:make-duration 2))

You can create a new, different event taking the original as template.
Like

(make-music 'RestEvent x)

However, do you actually want 'pitch copied here?

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to