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

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

event

Fields

.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

1 Comment