*edit #2*
Made a slight debugging change (multiple shot with zero step was calling single shot)
Also rearranged the shutter speed calculation and cls/printout order. Doesn't speed it up, but removes the slight pause in the middle of the printout while shutter speed is calculated and does it before clearing the screen and reprinting. Looks a little smoother.
*edit*
I made a few minor adjustments to decrease the filesize slightly.
For those with cameras without an AllBest build, the script should be modifiable to Fingalo's build by:
replace
print "Shutter value:",p
set_tv96_direct p
with
if p>=0 and p<=19 then p=-1
print "Shutter value:",p
set_tv_override p
The line "if p>=0 and p<=19 then p=-1" is to bypass the override indexing that has been included in Fingalo's build for these values
I got an idea based on Divalent's property case tester script (
http://chdk.wikia.com/wiki/UBASIC/Scripts:_a_property_case_value_tester) and wanted to get some feedback on it before sending it to the wiki.
This is similar to my previous Shutter Speed script in it's basic usage and settings, however it has added functionality to adjust the scripts parameter on the fly.
When using this, remember that the settings changed within the script are only temporary, they will reset to your defaults when you restart the script.
The onscreen prompts are as descriptive as I could make them with limited text space. Further information is below:
After starting the script you are shown the main screen. The menu tree from here is as follows and is accessed using the directional pad:
MENU enters adjustment menu
(the parameters of the script are shown here and are updated with each adjustment so the effect can be seen)
-> LEFT enters starting shutter speed menu
-> LEFT decrease starting shutter by 1 partial stop (-1/xEV)
-> RIGHT increase starting shutter by 1 partial stop (+1/xEV)
-> UP decrease starting shutter by 1 full stop (-1EV)
-> DOWN increase starting shutter by 1 full stop (+1EV)
-> SET returns to adjustment menu
-> RIGHT enters number of shots menu
-> LEFT decrease number of shots by 1 (bounded by minimum 1)
-> RIGHT increase number of shots by 1
-> UP (not used)
-> DOWN reset number of shots to 1
-> SET returns to adjustment menu
-> UP enters step size menu
-> LEFT decrease step size by 1 partial stop (-1/xEV)
-> RIGHT increase step size by 1 partial stop (+1/xEV)
-> UP (not used)
-> DOWN reset step size to 0EV
-> SET returns to adjustment menu
-> DOWN enters EV fraction adjustment mode (warning: this affects all parameters based on the EV fraction)
-> LEFT decrease fraction base by 1 (-x/1EV)
-> RIGHT increase fraction base by 1 (+x/1EV)
-> UP (not used)
-> DOWN (not used)
-> SET returns to adjustment menu
-> SET returns to main screen
SET begins shooting sequence
Any other key cancels script
copy and paste this into a text file called "ShutterSpeedAdjust.bas" in \CHDK\SCRIPTS
rem Author: barberofcivil
rem Tested on S2 IS
rem Requires AllBest build
@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
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
h=(k-l)
m=1
for j = 1 to (l/a/4+2)
m=m*16
next j
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>=6 and v<>1 then print " Tv Start: ~1/"w"s"
if k<6 and v<>1 then print " Tv Start: ~"x"."yz"s"
if k>=6 and v=1 then print ">Tv Start: ~1/"w"s"
if k<6 and v=1 then print ">Tv Start: ~"x"."yz"s"
if k>=6 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"