def onValueChange(channel, sampleIndex, val, prev): save_x = op('tx')['tx'] save_y = op('ty')['ty'] click = op('click')['click'] if(click == 0): A = op('table1') A.clear() A.appendRow(save_x) A.appendRow(save_y) B = op('table2') B.clear() B.appendRow(save_x) B.appendRow(save_y) op('switch1').par.index = 1 op('switch2').par.index = 1 op('level3').par.opacity = op('timer1')['timer_seconds'] elif(click == 1): B = op('table2') B.clear() B.appendRow(save_x) B.appendRow(save_y) op('switch1').par.index = 0 op('switch2').par.index = 0 op('level3').par.opacity = op('null1')['timer_seconds'] op('timer1').par.initialize.pulse() op('timer1').par.start.pulse() return