--[[rem Author: barberofcivil@title Shutter Stack w/Av - Adjustable@param a EV fraction (1/x EV)@default a 3@param d No.Shots@default d 1@param e Step Size (y/x EV)@default e 1@param f Start Delay (s)@default f 0@param g Delay between shots (s)@default g 0@param h Pre-focus: 0=off, 1=on @default h 1--]]if f<0 then f=0 endif g<0 then g=0 endif d<1 then d=1 endif a<1 then a=1 endif h<0 then h=0 endif h>1 then h=1 endfunction ShutterCalc (i) local k=(1-i)*e+u local p=(k*96)/a local l=(k/a/4)*4*a if k<0 then l=l-4*a end local n=(k-l) local j=(((((((((30*n^3)/(4*a))*n)/(4*a))*n)/(4*a))*243)/(4*a))*7) local j=j-(((((((30*n^3)/(4*a))*n)/(4*a))*254)/(4*a))*4) local j=j+(((((30*n^3)/(4*a))*227)/(4*a))*9) local j=j+(((30*n^2*307)/(4*a))*3) local j=j+(30*n*850) local m=16^(l/a/4+2) local o=(((((((j/(18000)+1)/2)+a)*m)/(128*a)+1))/2) local q=(((51200*a)/(((((j/18000)+1)/2)+a)*m)+1)/2) if m<1 then mm=16^(-l/a/4-2) q=(((((51200*a*100)/(((((j/18000)+1)/2)+a))/100)*mm)+1)/2) end if p<=-660 then q=q/60 end local r=q/100 local s=(q-r*100)/10 local t=q-r*100-s*10 return o,p,r,s,tendfunction AVCalc () local l=(x/192)*192 local m=2^(l/192) local n=(x-l) local j=(n^3)+650*(n^2)+360000*n local q=((j/100000+1005)/10)*m local r=q/100 local s=(q-r*100)/10 local t=q-r*100-s*10 return r,s,tendfunction ADJUST() o1,p1,r1,s1,t1 = ShutterCalc(1) o2,p2,r2,s2,t2 = ShutterCalc(d) r3,s3,t3 = AVCalc() if o1>=4 then xx1="1/"..o1 else xx1=r1.."."..s1..t1 end if o2>=4 then xx2="1/"..o2 else xx2=r2.."."..s2..t2 end if v==1 then xx0=">Tv:" else xx0=" Tv:" end if p1>-660 then xe1="s" else xe1="m" end if p2>-660 then xe2="s" else xe2="m" end cls() if d==1 then print (xx0..xx1..xe1) else print (xx0..xx1..xe1.." to "..xx2..xe2) end if v==5 then print (">Av:"..r3.."."..s3..t3) else print (" Av:"..r3.."."..s3..t3) end if v==2 then print (">Shots:"..d.." Step:"..e.."/"..a.."EV") elseif v>2 and v<5 then print (" Shots:"..d.." >Step:"..e.."/"..a.."EV") else print (" Shots:"..d.." Step:"..e.."/"..a.."EV") end if v==0 then BaseMenu() elseif v==1 then AdjustStart() elseif v==2 then AdjustShots() elseif v==3 then AdjustStep() elseif v==4 then AdjustEV() elseif v==5 then AdjustAV() endendfunction BaseMenu() print ("L:Start R:Shots U:Step") print ("D:/EV MENU:Av SET:Return") wait_click() if is_key("left") then v=1 end if is_key("right") then v=2 end if is_key("up") then v=3 end if is_key("down") then v=4 end if is_key("menu") then v=5 end if is_key("set") then v=-1 endendfunction AdjustStart() print ("L:-1/"..a.."EV R:+1/"..a.."EV") print ("D:-1EV U:+1EV SET:Return") wait_click() if is_key("left") then u=u+1 end if is_key("right") then u=u-1 end if is_key("up") then u=u-a end if is_key("down") then u=u+a end if is_key("set") then v=0 endendfunction AdjustShots() print ("L:-1 Shot R:+1 Shot") print ("D:Reset(1) SET:Return") wait_click() if is_key("left") then d=d-1 end if is_key("right") then d=d+1 end if is_key("down") then d=1 end if is_key("set") then v=0 end if d<1 then d=1 endendfunction AdjustStep() print ("L:-1/"..a.."EV R:+1/"..a.."EV") print ("D:=0 SET:Return") wait_click() if is_key("left") then e=e-1 end if is_key("right") then e=e+1 end if is_key("down") then e=0 end if is_key("set") then v=0 endendfunction AdjustEV() print ("L:-x/1EV R:+x/1EV") print ("SET:Return") wait_click() if is_key("left") then a=a-1 end if is_key("right") then a=a+1 end if is_key("set") then v=0 end if a<1 then a=1 end if a>96 then a=96 endendfunction AdjustAV() print ("L:-1/3EV R:+1/3EV") print ("D:-1EV U:+1EV SET:Return") wait_click() if is_key("left") then x=x+32 end if is_key("right") then x=x-32 end if is_key("up") then x=x-96 end if is_key("down") then x=x+96 end if is_key("set") then v=0 end if x<0 then x=0 endendfunction DELAY() if h==0 then xx0="OFF" else xx0="ON" end if v==1 then xx1=">" else xx1=" " end if v==2 then xx2=">" else xx2=" " end cls() print ( " Pre-focus : "..xx0) print (xx1.."Start delay: "..f.."s") print (xx2.."Shot delay : "..g.."s") if v==0 then BaseMenu2() elseif v==1 then AdjustStartD() elseif v==2 then AdjustShotD() endendfunction BaseMenu2() print ("L:Start R:Shot") print ("D:Pre-focus SET:Return") wait_click() if is_key("left") then v=1 end if is_key("right") then v=2 end if is_key("down") then h=1-h end if is_key("set") then v=-1 endendfunction AdjustStartD() print ("L:-1s R:+1s") print ("D:Reset(0) SET:Return") wait_click() if is_key("left") then f=f-1 end if is_key("right") then f=f+1 end if is_key("down") then f=0 end if is_key("set") then v=0 end if f<0 then f=0 endendfunction AdjustShotD() print ("L:-1s R:+1s") print ("D:Reset(0) SET:Return") wait_click() if is_key("left") then g=g-1 end if is_key("right") then g=g+1 end if is_key("down") then g=0 end if is_key("set") then v=0 end if g<0 then g=0 endend
u=(get_user_tv96()*32*a)/96x=get_user_av96()done=0while done==0 do v=0 o1,p1,r1,s1,t1 = ShutterCalc(1) o2,p2,r2,s2,t2 = ShutterCalc(d) r3,s3,t3 = AVCalc() if o1>=4 then xx1="1/"..o1 else xx1=r1.."."..s1..t1 end if o2>=4 then xx2="1/"..o2 else xx2=r2.."."..s2..t2 end if p1>-660 then xe1="s" else xe1="m" end if p2>-660 then xe2="s" else xe2="m" end cls() if d==1 then print ("One shot to be taken") print ("Tv:"..xx1..xe1) else print (d.." shots to be taken") print ("Tv:"..xx1..xe1.." to "..xx2..xe2) end print ("Av:"..r3.."."..s3..t3) print ("SET:proceed MENU:adjust") print ("DISP:setup other:cancel") wait_click() if is_key("menu") then while v>=0 do ADJUST() end elseif is_key("display") then while v>=0 do DELAY() end elseif is_key("set") then print ("Proceeding...") while f>0 do print ("Starting in "..f.."s...") sleep (1000) f=f-1 end cls() if h==0 then print("Prefocus OFF") elseif h==1 then print("Prefocus ON") local focused = false local try = 1 while not focused and try <= 5 do print("Pre-focus attempt " .. try) press("shoot_half") sleep(2000) if get_prop(18) > 0 then focused = true set_aflock(1) end release("shoot_half") sleep(500) try = try + 1 end if not focused then print "Unable to pre-focus" else print "Pre-focus complete" end end print ("Starting shots now...") for i=1,d,1 do cls() print ("Shot "..i.." of "..d) o1,p1,r1,s1,t1 = ShutterCalc(i) r3,s3,t3 = AVCalc() if o1>=4 then xx1="1/"..o1 else xx1=r1.."."..s1..t1 end if p1>-660 then xe1="s" else xe1="m" end print ("Tv:"..xx1..xe1) print ("Av:"..r3.."."..s3..t3) if p1==0 then p1=1 end set_av96_direct(x) set_tv96_direct(p1) shoot() sleep (1000*g) end done=1 else print ("Script cancelled") done=1 endend
Is there any way that I could interact with this script with a remote? I have a rig of 24x chdk cameras (yes, 24!) that I fire with a radio remote. At this stage to change the shutter speed I have to do it manually on all 24x cameras. Any thoughts?
I currently have it set up to do a held pulse for set cameras and then when I cut the voltage they fire. here's one of the results.
Started by barberofcivil Script Writing
Started by barberofcivil Completed and Working Scripts
Started by barberofcivil « 1 2 » Completed and Working Scripts
Started by genosmm « 1 2 » General Help and Assistance on using CHDK stable releases
Started by oliver56 « 1 2 » Script Writing