Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
--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
Panel

See Also: Event ConstructorEvent Members