Shutter Speed script - adjustable - Completed and Working Scripts - CHDK Forum
supplierdeeply

Shutter Speed script - adjustable

  • 0 Replies
  • 3995 Views
Shutter Speed script - adjustable
« on: 19 / January / 2009, 15:25:22 »
Advertisements
I have modified my adjustable shutter speed script to fix the errors present in my regular shutter speed one.

This one is the same as the other script, but also allows you to change the parameters on the fly.  Read the onscreen prompts for directions.

Code: [Select]
rem Author: barberofcivil
rem Tested on S2/A570

@title Shutter Speed - adjustable
@param a EV fraction (1/x EV)
@default a 3
@param b Start Tv (1EV)
@default b -11
@param c Start Tv (1/xEV)
@default c 0
@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

cls
if f<0 then f=0
if g<0 then g=0
if d<1 then d=1
if a<1 then a=1
if c>=a then c=a-1
if c<0 then c=0
if b<0 then c=-c

u=b*a+c

:loop
if d=1 then gosub "Single" else gosub "Multiple"

print "SET:proceed  MENU:adjust"
print "Any other key to cancel"

v=0
wait_click
is_key x "set"
  if x=1 then print "Proceeding..."
is_key y "menu"
  if y=1 then gosub "Adjust"
if (x+y)=0 then gosub "Cancel"

for w=1 to f
  if f>0 then print "Starting in",(f-w+1),"s..."
  if f>0 then sleep 1000
next w

print "Starting shots now..."

for i=1 to d
  gosub "ShutterCalc"
  cls
  print "Shot",i,"of",d
  if k>=6 then print "Shutter ~1/"o,"s" else print "Shutter ~"r"."st,"s"
  print "Shutter value:",p
  if p=0 then p=1
  set_tv96_direct p
  shoot
  sleep 1000*g
next i

end

:ShutterCalc
  k=(1-i)*e-u
  l=(k/a/4)*4*a
  if k<0 then l=l-4*a
  m=1
  for j = 1 to (l/a/4+3)
    m=m*16
  next j
  m=m/16
  h=(k-l)
  j=(((((((((30*h*h*h)/(4*a))*h)/(4*a))*h)/(4*a))*243)/(4*a))*7)
  j=j-(((((((30*h*h*h)/(4*a))*h)/(4*a))*254)/(4*a))*4)
  j=j+(((((30*h*h*h)/(4*a))*227)/(4*a))*9)
  j=j+(((30*h*h*307)/(4*a))*3)
  j=j+(30*h*850)
  o=(((((((j/(18000)+1)/2)+a)*m)/(128*a)+1))/2)
  p=(k*96)/a
  q=(((51200*a)/(((((j/18000)+1)/2)+a)*m)+1)/2)
  r=q/100
  s=(q-r*100)/10
  t=q-r*100-s*10
return

:Cancel
  print "Shots cancelled"
  end

:Single
  if e=0 and d>1 then print "Tv locked (step=0)"
  i=1
    gosub "ShutterCalc"

  cls
  print "One shot to be taken"
  if k>=6 then print "Tv: ~1/"o,"s" else print "Tv: ~"r"."st,"s"
return

:Multiple
  i=1
    gosub "ShutterCalc"
    w=o
    x=r
    y=s
    z=t
  i=d
    gosub "ShutterCalc"

  cls
  print d,"shots to be taken"
  if k>=6 then print "Tv Start: ~1/"w,"s" else print "Tv Start: ~"x"."yz,"s"
  if k>=6 then print "Tv End:   ~1/"o,"s" else print "Tv End:   ~"r"."st,"s"
return

:Adjust
  i=1
    gosub "ShutterCalc"
    w=o
    x=r
    y=s
    z=t

  i=d
    gosub "ShutterCalc"

  cls
  if k>=(2*a) and v<>1 then print " Tv Start: ~1/"w"s"
  if k<(2*a)  and v<>1 then print " Tv Start: ~"x"."yz"s"
  if k>=(2*a) and v=1 then print ">Tv Start: ~1/"w"s"
  if k<(2*a)  and v=1 then print ">Tv Start: ~"x"."yz"s"
  if k>=(2*a) then print " Tv End:   ~1/"o"s" else print " Tv End:   ~"r"."st"s"

  if v=2 then print ">Shots:"d"  Step:"e"/"a"EV"
  if v>2 then print " Shots:"d" >Step:"e"/"a"EV"
  if v<2 then print " Shots:"d"  Step:"e"/"a"EV"

  if v=0 then goto "BaseMenu"
  if v=1 then goto "AdjustStart"
  if v=2 then goto "AdjustShots"
  if v=3 then goto "AdjustStep"
  if v=4 then goto "AdjustEV"

:BaseMenu
  print "L:Start  R:Shots  U:Step"
  print "D:EVFraction  SET:Return"
  wait_click
  if is_key "left"  then v=1
  if is_key "right" then v=2
  if is_key "up"    then v=3
  if is_key "down"  then v=4
  if is_key "set"   then goto "loop"
  goto "Adjust"

: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
  if is_key "right" then u=u+1
  if is_key "up"    then u=u+a
  if is_key "down"  then u=u-a
  if is_key "set"   then v=0
  goto "Adjust"

:AdjustShots
  print "L:-1 Shot R:+1 Shot"
  print "D:Reset(1) SET:Return"
  wait_click
  if is_key "left"  then d=d-1
  if is_key "right" then d=d+1
  if is_key "down"  then d=1
  if is_key "set"   then v=0
  if d<1 then d=1
  goto "Adjust"

: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
  if is_key "right" then e=e+1
  if is_key "down" then e=0
  if is_key "set"   then v=0
  goto "Adjust"

:AdjustEV
  print "L:-x/1EV R:+x/1EV"
  print "SET:Return"
  wait_click
  if is_key "left"  then a=a-1
  if is_key "right" then a=a+1
  if is_key "set"   then v=0
  if c>=a then c=a-1
  u=b*a+c
  goto "Adjust"

 

Related Topics