I found a way!
in2 chnget “in2”
in3 chnget “in3”
in4 chnget “in4”
in5 chnget “in5”
in6 chnget “in6”
iamp1 chnget “iamp1”
iamp2 chnget “iamp2”
iamp3 chnget “iamp3”
iamp4 chnget “iamp4”
iamp5 chnget “iamp5”
iamp6 chnget “iamp6”
iNoteArray [] fillarray 0, in2, in3, in4, in5, in6
iAmpArray [] fillarray iamp1, iamp2, iamp3, iamp4, iamp5, iamp6
kNoteIndex init 0
kAmpIndex init 0
if chnget:k("enableArp") == 1 then
kTempo chnget "tempo"
kMetro metro kTempo
if kMetro == 1 then
;trigger sounds from instrument 1000, which in turns calls synth UDO..
event "i", 4, 0, chnget:k("duration"), p4+iNoteArray[kNoteIndex], p5*iAmpArray[kAmpIndex]
kNoteIndex = kNoteIndex<5 ? kNoteIndex + 1 : 0
kAmpIndex = kAmpIndex<5 ? kAmpIndex + 1 : 0
endif