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

Event(type)

Description

Constructor to create a new Event object of the specified type.

Available in: Processor.

Arguments

typeThe type of event. See Event Types for details.enum or number

Return Values

Returns a new Event object of the specified type.

The fields of the Event object must be set after its creation.

Example

-- create new note-on event
function onNote(event)
    local newEvent = Event(EventType.noteOn)
    newEvent.note = event.note + 12
    newEvent.velocity = event.velocity
    local id = postEvent(newEvent)
	waitForRelease()
	releaseVoice(id)
end

See Also: Event, Event Types

1 Comment