fyi here's my slicer lua code - with some stuff removed for clarity:
traktor beatphase to animate the pad leds:
Code:
capture(app, beat_event, ALL, 0, function(d2, e2, v2, p2)
-- turn off current pad
send(d, pads[slicer.data[sid].step], OFF, p)
slicer.data[sid].step = slicer.data[sid].step + 1
local jump = 0
if slicer.data[sid].step >= 9 then
slicer.data[sid].step = 1
if slicer.data[sid].loopmode then
jump = -8
end
end
if jump ~= 0 then
slicer.send_beatjump(app, jump, deck, beatjumps)
end
-- turn new pad on
send(d, pads[slicer.data[sid].step], ON, p)
pressing on pads to beatjump:
Code:
for i,e in ipairs(pads) do
-- map back from pad name to slicer step
slicer.data[sid].pads2step[e] = i
capture(d, e, ALL, p, function(d, e, v, p)
if v > 0 then
if slicer.data[sid].active == false then
return
end
local jump = slicer.data[sid].pads2step[e] - slicer.data[sid].step - 1
-- send beatjump and turn old pad off
slicer.send_beatjump(app, jump, deck, beatjumps)
send(d, pads[slicer.data[sid].step], OFF)
slicer.data[sid].step = slicer.data[sid].pads2step[e]
else
-- make sure pad led stays on (lpd8)
send(d, e, ON, p)
end
end)
Bookmarks