Page tree
Skip to end of metadata
Go to start of metadata

clone(event)

Description

Function to create a copy of the specified event. For example, if you want to transpose the events of a MIDI sequence, and you do not want to modify the original data, you can clone the events before transposing them.

Available in: Processor.

Arguments

eventThe Event object to be cloned.Event

Return Values

Returns a copy of the specified event.

Example

-- create a copy of the event and transpose it
function onNote(event)
    eventCopy = clone(event)
    eventCopy.note = event.note + 12
    local id = postEvent(eventCopy)
    waitForRelease()
    releaseVoice(id)
end

See Also: Event Constructor

1 Comment