/ HALion Developer Resource / HALion Script / Reference /

onController

onController(event)

Description

This callback function is called when the script module receives a continuous controller event. If the script doesn't implement onAfterTouch or onPitchBend, the respective aftertouch or pitch bend events will be passed on to onController. This way, continuous controller, aftertouch and pitch bend events can be treated in the same callback function onController.

Available in: Processor.

Arguments

ArgumentDescriptionValue Type
eventEvent object of the type controllerEvent

Fields

FieldDescriptionValue Type
.typeThe type of event (3 = controller). See Event Types for details.number
.controllerThe controller number. See Controller Numbers for a description of the different controllers.number
.valueThe controller value in the range of 0 to 127.number

Example

-- Exclude MIDI mode messages and other special controllers.

function onController(event)
    if event.controller < 120 then
        print("Controller #: "..event.controller..", Value: "..event.value)
        postEvent(event)
    end
end

See also: controlChange, getCC, onAfterTouch, onPitchBend