So I've inserted this into PeriodicalEvent(elapsed):
Code: Select all
# crossfader control
if run :
if sec > 0 :
pos = modul8.getValue ('ctrl_master_crossfader_slider',0)
inc = (elapsed / sec) * dir
pos += inc
if pos > 1 : pos = 1; run = 0
elif pos < 0 : pos = 0 ; run = 0
elif dir == 1 : pos = 1 ; run = 0
else : pos = 0 ; run = 0
modul8.setValue ('ctrl_master_crossfader_slider',pos,0)
And then when I open Modul8 I get:
"NameError: name 'run' is not defined"
So some pointers on how do I best define a name for the above code.
Thanks.