Hi everyone,
I try to understand how I can have two or more conditions in GUI elements to trigger an event, for example triggering the diskin2 opcode.
For example:
If Knob 1 is in Position “1” and Knob 2 is in Position “5” then a special sample should play.
But with the following code it gets triggered also if only one condition is met.
What is wrong with it, is there a smarter way to do it?
Snippet:
rslider bounds(466, -2, 90, 90), , channel(“switcher”), range(1, 2, 0, 1, 1)
rslider bounds(46, 0, 90, 90), , channel(“switcher2”) , range(3, 4, 0, 1, 1)
instr 1
if changed(chnget:k(“switcher”))==1 then
event “i”, 13, 0, -1, chnget:k(“switcher”)
elseif changed(chnget:k(“switcher”))==2 then
event “i”, 13, 0, -1, chnget:k(“switcher”)
elseif changed(chnget:k(“switcher2”))==1 then
event “i”, 13, 0, -1, chnget:k(“switcher2”)
elseif changed(chnget:k(“switcher2”))==2 then
event “i”, 13, 0, -1, chnget:k(“switcher2”)
endif
endin
instr 13
if(p4 == 1 && p4 == 3) then
a1 diskin2 "D://Cabbage/1.wav
a2 diskin2 "D://Cabbage/1.wav
thanks
//rootnote