Function to post the event to the engine. The second argument is optional. It allows you to delay the event by a specific time in milliseconds.
Available in: Processor.
|event||The Event object that will be posted.||Event|
|delay||Delay time in milliseconds. The default is 0 ms.||number, optional|
Returns a note ID in case of a note-on event,
nil for any other type of event. For this reason, assigning the return value of postEvent to a variable is only meaningful in the onNote callback.
local delayTime = 1000 -- post event and print note ID function onNote(event) local id = postEvent(event, delayTime) print("ID: "..id) end -- post event and print note ID function onRelease(event) postEvent(event, delayTime) print("ID: "..event.id) end -- post event, then print controller number and value function onController(event) postEvent(event) print("Controller #: "..event.controller..", Value: "..event.value) end