The wait function only works in onNote and onRelease.
If the wait function is called in a parameter’s callback, or in a function called via the spawn() function it doesn’t execute anything after the wait function.
function onSwitch()
print('Switch callback before wait')
wait(1000)
print('Switch callback after wait') -- this doesn't print
end
defineParameter('Switch', nil, false, onSwitch)
function onNote(e)
postEvent(e)
wait(1000)
print('onNote')
end
function onRelease(e)
postEvent(e)
wait(1000)
print('onRelease')
end