Page tree

Versions Compared

Key

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

Anchor
top
top

The Event class describes the properties of events.

On this page:

Table of Contents
maxLevel2
minLevel2
indent25px
exclude\d
typeflat
separator,


Panel

Class Hierarchy

Children Display
alltrue
pageClass Reference

 

 



Classes

Panel
borderColor#bbbbbb
bgColor#ffffff

Event Class

Description

The state of an Event object is described by the following fields.

Available in: Processor.

Fields

.typeThe type of event. See Event Types for details.number
.idThe ID of the event.number
.noteThe note number in the range of 0 to 127.number
.velocityThe note-on velocity in the range of 0 to 127.number
.controllerThe controller number. See Controller Numbers for a description of the different controllers.number
.valueThe value of a controller, pitch bend, or note expression event. The value range depends on the event type.number
.bendThe value of a pitch bend event in the range of -1.0 to 1.0.number
.noteExpressionTypeThe type of note expression event. See Note Expression Types for details.number
.dataAn array with the bytes of a system exclusive message. For the interpretation of these values, please consult the documentation of the MIDI data format of the device sending the system exclusive message.table
.dataTypeCurrently, there is only one data type (0 = sysex).number
.dataSizeThe number of bytes in the system exclusive message.number
.ppqPositionThe position of the event in ppq relative to the song start. The host must be in in playback. This value will be 0.0 if the host is not in playback.number

Fields per Event Type

Which of the fields are used depends on the Event Type.

 

noteOn

noteOff

controllernoteExpressionnoteRetriggerdata
.type(tick)(tick)(tick)(tick)(tick)(tick)
.id(tick)(tick)
 

(tick)(tick)
.note(tick)(tick)
 


(tick)
  

.velocity(tick)(tick)
 


(tick)
.controller
 
 


(tick)
 



.value
  


(tick)(tick)

.bend
 


(tick)
 



.noteExpressionType


(tick)
 


.data




(tick)
.
noteExpressionType
dataType
 





(tick)
 
.dataSize
 





(tick)
.ppqPosition(tick)(tick)(tick)(tick)(tick)(tick)

Example

Code Block
-- print the fields of an Event object
function printEventMembersonNote(event)
    print("Event Type:", event.type)
    print("ID:", event.id)
    print("Note #:", event.notepostEvent(event)
end

function onRelease(event)
    print("Velocity:", event.velocity)
    print("Controller #:", event.controllerpostEvent(event)
    print("Value:", event.value)
    print("Pitch Bend:", event.bendend
 
function onController(event)
    print("Note Expression Type:", event.noteExpressionType)
    print("PPQ:", event.ppqPosition, "\n"postEvent(event)
end
 
function onNoteonNoteExpression(event)
    printEventMembersprint(event)
    -- postEvent(event)
end

function onRelease(event)
    printEventMembers(event)
    postEvent(event), not needed for note expression
end
 
function onControlleronRetrigger(event)
    printEventMembersprint(event)
    postEvent(event)
end
 
function onNoteExpressiononData(event)
    printEventMembersprint(event)
    -- postEvent(event), not needed for note expression
end


Jump to Top

Constructors

Excerpt include halion
pageEvent Constructor

Jump to Top