/ HALion Developer Resource / HALion Script / Reference /

onNote

onNote(event)

Description

This callback function is called when the script module receives a note-on event.

Available in: Processor.

Arguments

ArgumentDescriptionValue Type
eventEvent object of the type noteOn.Event

Fields

FieldDescriptionValue Type
.typeThe type of event (1 = noteOn). See Event Types for details.number
.idThe note ID of the note-on 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
.tuningThe tune offset in semitones.number

Example

-- Print note ID, note number and velocity.

function onNote(event)
    local id = postEvent(event)
    print("ID: "..id..", Note #: "..event.note..", Velocity: "..event.velocity..", Tuning: "..event.tuning)
end

See Also: postEvent, playNote, releaseVoice, onRetrigger