/ HALion Developer Resource / HALion Script / Reference /
onInit
onInit()
Description
This callback function is called after executing any global statements and the onLoadIntoSlot callback function. It is the first callback function that is called when the processor thread is initialized. You can use this function to initialize variables with information from the context, for example.
❕ The program must be loaded in the Slot Rack and contain at least one zone. Otherwise, onInit won't be called.
Available in: Processor.
Example
-- Print the time signature and tempo of the host software.
function onInit()
num, denom = getTimeSignature()
tempo = getTempo()
print(num.."/"..denom)
print(tempo.." BPM")
end
See also: onLoadIntoSlot