this PR implements wrapping of the led index (modulo 64, 1-indexed), akin to what norns does.
to test:
-- ------------------------------------------------------------------------
-- state
local a = nil
radial_pos = 1
-- ------------------------------------------------------------------------
-- init
local arc_redraw_clock
local ARC_FPS = 60
function init()
a = arc.connect()
arc_redraw_clock = clock.run(
function()
local step_s = 1 / ARC_FPS
while true do
clock.sleep(step_s)
arc_redraw()
end
end)
end
-- ------------------------------------------------------------------------
-- main
function arc_redraw()
-- spills over next ring after 64
radial_pos = radial_pos + 1
-- crashes
-- radial_pos = radial_pos - 1
a:all(0)
a:led(1, radial_pos, 10)
a:refresh()
end
before this change:
a:led(1, 64+1, 10)
would light led#1
on ring#2
a:led(1, 0, 10)
would crash seamstressthis PR implements wrapping of the led index (modulo 64, 1-indexed), akin to what norns does.
to test: