Skip to content

Commit

Permalink
bug fix: moving loops moved ui dash
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Feb 12, 2021
1 parent a3b92c6 commit 4abf5a9
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions oooooo.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- oooooo v1.5.0
-- oooooo v1.5.2
-- 6 x digital tape loops
--
-- llllllll.co/t/oooooo
Expand Down Expand Up @@ -213,7 +213,7 @@ function init()
filter_resonance=controlspec.new(0.05,1,'lin',0,1,'')
filter_freq=controlspec.new(20,20000,'exp',0,20000,'Hz')
for i=1,6 do
params:add_group("loop "..i,34)
params:add_group("loop "..i,35)
-- id name min max default k units
params:add_control(i.."start","start",controlspec.new(0,uC.loopMinMax[2],"lin",0.01,0,"s",0.01/uC.loopMinMax[2]))
params:add_control(i.."start lfo amp","start lfo amp",controlspec.new(0,1,"lin",0.01,0.2,"",0.01))
Expand Down Expand Up @@ -304,6 +304,17 @@ function init()
end
end
}
params:add{type='binary',name="reset trig",id=i..'reset trig',behavior='momentary',
action=function(v)
if v==1 then
if uS.recording[i]>0 then
tape_stop_rec(i)
end
tape_reset(i)
uS.updateUI=true
end
end
}
params:add_file(i.."load_file","load audio",_path.audio)
params:set_action(i.."load_file",function(x)
if #x<=#_path.audio then
Expand Down Expand Up @@ -715,7 +726,7 @@ function update_positions(i,x)
do return end
end
if uP[i].position<0 then
uP[i].position=0
uP[i].position=uP[i].loopStart
end
uS.updateUI=true
end
Expand Down Expand Up @@ -969,11 +980,11 @@ function tape_reset(i)
if i<7 and params:get(i.."sync tape with") > 1 then
tape_reset(i+params:get(i.."sync tape with")-1)
end
if uP[i].position==0 then
if uP[i].position==uP[i].loopStart then
do return end
end
print("tape_reset "..i)
uP[i].position=0
uP[i].position=uP[i].loopStart
softcut.position(i,uC.bufferMinMax[i][2]+uP[i].loopStart)
if params:get(i.."randomize on reset")>1 then
if params:get(i.."randomize on reset")==2 then
Expand Down Expand Up @@ -1543,7 +1554,7 @@ function redraw()

-- draw pixels at position if it has data or
-- its being recorded/primed
angle=360*(uP[i].loopLength-uP[i].position)/(uP[i].loopLength)+90
angle=-1*360*(uP[i].position-uP[i].loopStart)/(uP[i].loopLength)+90
if params:get(i.."isempty")==1 or i==uS.loopNum or uS.recording[i]>0 then
for j=-1,1 do
screen.pixel(x+(r-j)*math.sin(math.rad(angle)),y+(r-j)*math.cos(math.rad(angle)))
Expand Down Expand Up @@ -1577,7 +1588,7 @@ function redraw()

-- draw pixels at position if it has data or
-- its being recorded/primed
angle=360*(uP[i].loopLength-uP[i].position)/(uP[i].loopLength)+90
angle=-1*360*(uP[i].position-uP[i].loopStart)/(uP[i].loopLength)+90
if params:get(i.."isempty")==1 or i==uS.loopNum or uS.recording[i]>0 then
for j=-1,1 do
screen.pixel(x+(r-j)*math.sin(math.rad(angle)),y+(r-j)*math.cos(math.rad(angle)))
Expand Down

0 comments on commit 4abf5a9

Please sign in to comment.