yep, the only real challenge is figuring out how to handle the UI. with passersby it was easy due to existing UI library (see below)
Summary
add/edit a few things at the top:
local tn = include('tunnels/lib/tunnel')
local tab_titles = {{"Wave", "FM"}, {"Env", "Reverb"}, {"LFO", "Targets"}, {"Fate"}, {"Tunnels"}}
local tunnelmode = 1
local tgroup
local tunnelmodes_list
local tunnelmodes = {"off", "fractal landscape", "disemboguement", "post-horizon", "coded air", "failing lantern", "blue cat", "crawler"}
add this function:
local function update_tunnels()
local tm = tunnelmode
local tg = tgroup
tn.randomize(tm, tg)
end
add this to encoder function:
-- tunnels
elseif pages.index == 5 then
if n == 2 then
tunnelmodes_list:set_index_delta(util.clamp(delta, -1, 1))
tunnelmode = tunnelmodes_list.index
tgroup = 1
update_tunnels(tunnelmode)
tgroup = 2
update_tunnels(tunnelmode)
screen_dirty = true
end
end
update key function:
-- Key input
function key(n, z)
if pages.index == 5 then
if z == 1 then
if n == 1 then
softcut.buffer_clear()
elseif n == 2 then
tgroup = 1
update_tunnels(tunnelmode)
redraw()
elseif n == 3 then
tgroup = 2
update_tunnels(tunnelmode)
redraw()
end
end
else
if z == 1 then
if n == 1 then
softcut.buffer_clear()
elseif n == 2 then
pages:set_index_delta(1, true)
update_pages()
elseif n == 3 then
tabs:set_index_delta(1, true)
update_tabs()
end
end
end
end
add to init:
-- tunnels
tn.init()
-- need to set to 0 here for some reason
for i=1, 4 do
softcut.level(i, 0)
end
tunnelmodes_list = UI.ScrollingList.new(8, 8, 1, tunnelmodes)
add to redraw function:
elseif pages.index == 5 then
tunnelmodes_list:redraw()
end
I would love to add this (or other softcut things… cranes?! @dan_derks ) to Less Concepts. haven’t thought about the best way to handle it in that case. it’s only one page on norns so I suppose the UI lib could be added…