Lukas-Fabian Moser <l...@gmx.de> writes:

> But: Whether you use music-map or map-some-music, your helper function
> (your lambda) is expected to return the new music into which the given
> argument m should be transformed. So in any case, your lambda function
> should return music - in the trivial case, it could return m itself
> without change, but in the long run, you want to return a new
> note-event, i.e. (make-music 'NoteEvent ...).
>
> For this, it will come in handy that it's possible to do
>
> (make-music 'NoteEvent m)
>
> i.e. create a new NoteEvent that takes its 'pitch (which you're going to
> overwrite using an additional 'pitch ....), 'articulation etc.
> properties from m. (This is explained somewhere in Jean's guide.)

There is no necessity to return a new NoteEvent; you can just change
pitch on the existing one.

Music functions are allowed to modify their music arguments in place.

-- 
David Kastrup

Reply via email to