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

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

EventType.type

Description

Available in: Processor.

Event Types

The event type can be determined with these enums or numbers:

EnumIndex 
EventType.noteOn1Note-on events.
EventType.noteOff2Note-off events.
EventType.controller3Continuous controller events.
EventType.noteExpression4

Note expression events.

EventType.programChange5Only used for Standard MIDI files.

Example

--print the event type
function printEventType(event)
    if event.type == EventType.noteOn then
        print("Note-on event received!")
    elseif event.type == EventType.noteOff then
        print("Note-off event received!")
    elseif event.type == EventType.controller then
        print("Controller event received!")
    elseif event.type == EventType.noteExpression then
        print("Note Expression event received!")
    end
end

function onNote(event)
    printEventType(event)
    postEvent(event)
end
 
function onRelease(event)
    printEventType(event)
    postEvent(event)
end
  
function onController(event)
    printEventType(event)
    postEvent(event)
end
  
function onNoteExpression(event)
    printEventType(event)
    --postEvent(event), not needed for note expression
end
  • No labels