--[[rem Author: barberofcivil@title HDR Assist@param d No.Shots@default d 1@param e No. Series@default e 1@param f Start Delay (s)@default f 0@param g Pre-focus: 0=off, 1=on @default g 1--]]if e<1 then e=1 endif d<1 then d=1 endif f<0 then f=0 endif g<0 then g=0 endif g>1 then g=1 endfunction ShutterCalc (k) local l=(k/384)*384 if k<0 then l=l-384 end local n=(k-l) local j=(((((((((30*n^3)/384)*n)/384)*n)/384)*243)/384)*7) local j=j-(((((((30*n^3)/384)*n)/384)*254)/384)*4) local j=j+(((((30*n^3)/384)*227)/384)*9) local j=j+(((9210*n^2)/384)*3) local j=j+(25500*n) local m=16^(l/384+2) local o=((((((j/18000+1)/2)+96)*m)/12288+1)/2) local q=((4915200/((((j/18000+1)/2)+96)*m)+1)/2) if m<1 then mm=16^(-l/384-2) q=((((491520000/(((j/18000+1)/2)+96))/100)*mm+1)/2) end if k<=-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,r,s,tendfunction AVCalc (x) 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,r1,s1,t1 = ShutterCalc(Tv1) o2,r2,s2,t2 = ShutterCalc(Tv2) r3,s3,t3 = AVCalc(Av0) if v==1 then xx0=">Tv:" else xx0=" Tv:" end 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 Tv1>-660 then xe1="s" else xe1="m" end if Tv2>-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==3 then print (">Av:"..r3.."."..s3..t3) else print (" Av:"..r3.."."..s3..t3) end if v==4 then print (">Shots:"..d) else print (" Shots:"..d) end if v==0 then BaseMenu() elseif v==1 then cls() if d==1 then print (xx0..xx1..xe1) else print (xx0..xx1..xe1.." to "..xx2..xe2) end print (" Av:"..r3.."."..s3..t3) print (" Shots:"..d) print ("Pause and select Tv1") print ("Any button to resume") wait_click() Tv1=(get_user_tv96()*32) v=0 elseif v==2 then cls() if d==1 then print (xx0..xx1..xe1) else print (xx0..xx1..xe1.." to "..xx2..xe2) end print (" Av:"..r3.."."..s3..t3) print (" Shots:"..d) print ("Pause and select Tv2") print ("Any button to resume") wait_click() Tv2=(get_user_tv96()*32) v=0 elseif v==3 then AdjustAV() elseif v==4 then AdjustShots() endendfunction BaseMenu() print ("L:Start R:End U:Av") print ("D:Shots 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("set") then v=-1 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 AdjustAV() print ("L:-1/3EV R:+1/3EV") print ("D:User SET:Return") wait_click() if is_key("left") then Av0=Av0+32 end if is_key("right") then Av0=Av0-32 end if is_key("down") then cls() if d==1 then print (xx0..xx1..xe1) else print (xx0..xx1..xe1.." to "..xx2..xe2) end print (">Av:"..r3.."."..s3..t3) print (" Shots:"..d) print ("Pause and select Av") print ("Any button to resume") wait_click() Av0=get_user_av96() end if is_key("set") then v=0 end if Av0<0 then Av0=0 endendfunction DELAY() if g==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 (xx1.."Start delay: "..f.."s") print (xx2.."No.Series : "..e) print ( " Pre-focus : "..xx0) if v==0 then BaseMenu2() elseif v==1 then AdjustStartD() elseif v==2 then AdjustSeries() endendfunction BaseMenu2() print ("L:Start R:Series") 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 g=1-g 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 AdjustSeries() print ("L:-1 R:+1") print ("D:Reset(1) 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=1 end if is_key("set") then v=0 end if e<1 then e=1 endend
Av0=get_user_av96()Tv1=(get_user_tv96()*32)Tv2=Tv1done=0while done==0 do v=0 o1,r1,s1,t1 = ShutterCalc(Tv1) o2,r2,s2,t2 = ShutterCalc(Tv2) r3,s3,t3 = AVCalc(Av0) 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 Tv1>-660 then xe1="s" else xe1="m" end if Tv2>-660 then xe2="s" else xe2="m" end cls() if d==1 then print (" Tv:"..xx1..xe1) else print (" Tv:"..xx1..xe1.." to "..xx2..xe2) end print (" Av:"..r3.."."..s3..t3) print (" Shots:"..d.." Series:"..e) 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 for h=1,e,1 do cls() print ("Series "..h.." of "..e) print ("Any button to proceed") wait_click() while f>0 do cls() print ("Series "..h.." of "..e) print ("Starting in "..f.."s...") sleep (1000) f=f-1 end cls() if g==0 then print("Pre-focus OFF") elseif g==1 then print("Pre-focus 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 ("Series "..h.." of "..e) print ("Shot "..i.." of "..d) if d==1 then Tv0=Tv1 else Tv0=(((Tv1*10+(((Tv2-Tv1)*(i-1)*10)/(d-1)))+5)/10) end o1,r1,s1,t1 = ShutterCalc(Tv0) r3,s3,t3 = AVCalc(Av0) if o1>=4 then xx1="1/"..o1 else xx1=r1.."."..s1..t1 end if Tv0>-660 then xe1="s" else xe1="m" end print ("Tv:"..xx1..xe1) print ("Av:"..r3.."."..s3..t3) if Tv0==0 then Tv0=1 end set_av96_direct(Av0) set_tv96_direct(Tv0) shoot() end end done=1 else print ("Script cancelled") done=1 endend
I tried your script on my sx100is and it works It's a simple script to use, I use "bracketing in continous mode" function included in chdk to do bracketing.nice work
One limitation on this one is that it is limited to usage with only available regular camera shutter speeds, not the CHDK override ones. I suppose I could've added the adjustability as included in the other script, but I didn't want it getting too cluttered.
Quote from: barberofcivil on 28 / August / 2009, 08:43:09One limitation on this one is that it is limited to usage with only available regular camera shutter speeds, not the CHDK override ones. I suppose I could've added the adjustability as included in the other script, but I didn't want it getting too cluttered.creating spherical light probe HDR? wow! the limitation is not a problem. It's quite unusual to do HDR with shutter greater than 15sec
Started by barberofcivil Script Writing
Started by a710is Feature Requests
Started by barberofcivil Completed and Working Scripts
Started by barberofcivil « 1 2 » Completed and Working Scripts
Started by oliver56 « 1 2 » Script Writing