[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Modify a NoteEvent to RestEvent
From: |
David Kastrup |
Subject: |
Re: Modify a NoteEvent to RestEvent |
Date: |
Sun, 11 Mar 2018 08:26:46 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
paolo prete <address@hidden> 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