Wikia

CHDK Wiki

UBASIC/Scripts: OMNI Intervalometer

Talk4
577pages on
this wiki

< UBASIC

Revision as of 20:19, May 14, 2009 by 83.28.30.125 (Talk)



rem Author ~Keoeeit~
rem S-Series cameras ONLY
rem Use Endless mode with caution
rem See documentation for important info
@title OMNI Intervalometer
@param a Photo=0 Vid=1 P&V=2 Burst=3
@default a 0
@param b Delay 1st Shot (Mins)
@default b 0
@param c Delay 1st Shot (Secs)
@default c 0
@param d Number of Shots/Vids/Burst
@default d 5
@param e Interval (Minutes)
@default e 0
@param f Interval (Seconds)
@default f 0
@param g Interval (10th Seconds)
@default g 5
@param h Video/Burst Minutes
@default h 0
@param i Video/Burst Seconds
@default i 0
@param j Endless? No=0 Yes=1
@default j 0
p=b*600+c*10
t=e*600+f*10+g
v=h*600+i*10
if a<0 then a=0
if a>3 then a=3
if d<1 then d=5
if t<1 then t=1
if j<0 then j=0
if j>1 then j=1
if p<0 then p=0
if v<10 then v=10
if a=0 then v=0
u=t
get_tv k
if a=1 then k=-14
if a=2 then t=t+10*d
if a=3 then t=t+25*d
if k=-12 then t=t+330
if k=-11 then t=t+270
if k=-10 then t=t+210
if k=-9 then t=t+170
if k=-8 then t=t+130
if k=-7 then t=t+110
if k=-6 then t=t+90
if k=-5 then t=t+70
if k=-4 then t=t+60
if k=-3 then t=t+50
if k=-2 then t=t+40
if k=-1 then t=t+35
if k=0 then t=t+18
if k=1 then t=t+15
if k=2 then t=t+13
if k=3 then t=t+11
if k=4 then t=t+10
if k=5 then t=t+8
if k=6 then t=t+6
x=p+(v*d)+(t*(d-1))
print "1 Cycle Time:", x/600; "min", x%600/10; "sec"
goto "interval"
:interval
  if p>0 then gosub "pause"
  for n=1 to d
  print "Shot", n, "of", d
  if n>1 then sleep u*100
  if a=0 then shoot
  if a=1 then gosub "vid"
  if a=2 then gosub "vid"
  if a=3 then gosub "burst"
  next n
  if j=1 then goto "interval" else end
:pause
  r=(b*60)+c
  for m=1 to r
  q=r-m
  print "Intvl Begins:", q/60; "min", q%60; "sec"
  sleep 930
  next m
  return
:vid
  if a=2 then shoot
  if a=2 then sleep 1000
  click "video"
  sleep v*100
  click "video"
  return
:burst
  click "timer"
  press "shoot_half"
  sleep 500
  press "shoot_full"
  sleep v*100
  release "shoot_full"
  release "shoot_half"
  sleep 2000
  click "timer"
  click "timer"
  return

== OMNI Intervalometer 3==

:'''Written for/on:''' Powershot S3 IS - CHDK Allbest or [http://chdk.setepontos.com/index.php/topic,688.0.html JuciPhoX] Builds Required. JuciPhoX build available at http://www.saunalahti.fi/nirsku/chdk/
:'''Also works on:''' S2?, S5?, The A, G, and SD/IXUS models would need the ":vid" subroutine modified.


An updated version to work with the newer Allbest and JuciPhox builds of CHDK. This script requires that your build of CHDK recognizes the '''get_tv96''' and '''get_raw_nr''' uBASIC commands. If you find those strings listed in your diskboot.bin file (view with any editor that allows seeing binary files, i.e. UltraEdit) then you can use this script.

The only difference in this script is that it more accurately calculates the Total Time Per Cycle reported. It now detects if you have noise-reduction turned to Auto, Off, or On and adds in the approximate noise-reduction time needed for each cycle as the case may be. It also calculates the overall cycle time more accurately if using shutter speeds below 1 second. This is merely a cosmetic feature for the intervalometer "cycle time" that is printed to your viewfinder screen, as it does not actually change the functionality nor timing of the shots per cycle and the cycles themselves (from the previous version). I just thought that if it's going to report the cycle time, it should be closer to what is actually going to occur. Even so, these calculated times are just a close approximation due to various cameras' file-saving and processing overhead. A fudge-factor of 0.2 to 0.5 seconds or so was added in to account for slower cameras, slower SD cards, and NR processing during the longer shutter speeds.

One caveat: While this script will account for shutter times whether you are using the camera's own settings or using the CHDK Override settings, it requires that you half-press the shutter once while NOT in <ALT> mode before actually running the script in <ALT> mode. This sets the get_tv96 variable that is read (by the script) for whatever shutter time is selected by any means. This was the only way available to detect the correct shutter time whether selected by CHDK Override or by the camera's own auto-modes. Using any of the other get_tv variables available would account for one but not the other, resulting in the wrong cycle times being calculated.

<pre>
rem Author ~Keoeeit~
@title OMNI Intervalometer 3
@param a Photo=0 Vid=1 P&V=2 Burst=3
@default a 0
@param b Delay 1st Shot (Mins)
@default b 0
@param c Delay 1st Shot (Secs)
@default c 0
@param d Number of Shots/Vids/Burst
@default d 5
@param e Interval (Minutes)
@default e 0
@param f Interval (Seconds)
@default f 0
@param g Interval (10th Seconds)
@default g 5
@param h Video/Burst Minutes
@default h 0
@param i Video/Burst Seconds
@default i 0
@param j Endless? No=0 Yes=1
@default j 0
p=b*600+c*10
t=e*600+f*10+g
v=h*600+i*10
if a<0 then a=0
if a>3 then a=3
if d<1 then d=5
if t<1 then t=1
if j<0 then j=0
if j>1 then j=1
if p<0 then p=0
if v<10 then v=10
if a=0 then v=0
u=t
k=get_tv96
if a=1 then k=1
if a=2 then t=t+10*d
if a=3 then t=t+25*d
if get_raw_nr = 1 then gosub "addtv"
if get_raw_nr <> 1 then gosub "addnr"
x=p+(v*d)+(t*(d-1))
print "1 Cycle Time:", x/600; "min", x%600/10; "sec"
goto "interval"
:interval
  if p>0 then gosub "pause"
  for n=1 to d
  print "Shot", n, "of", d
  if n>1 then sleep u*100
  if a=0 then shoot
  if a=1 then gosub "vid"
  if a=2 then gosub "vid"
  if a=3 then gosub "burst"
  next n
  if j=1 then goto "interval" else end
:pause
  r=(b*60)+c
  for m=1 to r
  q=r-m
  print "Intvl Begins:", q/60; "min", q%60; "sec"
  sleep 930
  next m
  return
:vid
  if a=2 then shoot
  if a=2 then sleep 1000
  click "video"
  sleep v*100
  click "video"
  return
:burst
  click "timer"
  press "shoot_half"
  sleep 500
  press "shoot_full"
  sleep v*100
  release "shoot_full"
  release "shoot_half"
  sleep 2000
  click "timer"
  click "timer"
  return
:addtv
 if k=-576 then t=t+645
 if k=-544 then t=t+513
 if k=-512 then t=t+408
 if k=-480 then t=t+325
 if k=-448 then t=t+259
 if k=-416 then t=t+205
 if k=-384 then t=t+165
 if k=-352 then t=t+132
 if k=-320 then t=t+105
 if k=-288 then t=t+85
 if k=-256 then t=t+68
 if k=-224 then t=t+55
 if k=-192 then t=t+45
 if k=-160 then t=t+35
 if k=-128 then t=t+30
 if k=-96 then t=t+25
 if k=-64 then t=t+20
 if k=-32 then t=t+17
 return
:addnr
 if k=-576 then t=t+1300
 if k=-544 then t=t+1030
 if k=-512 then t=t+820
 if k=-480 then t=t+650
 if k=-448 then t=t+520
 if k=-416 then t=t+410
 if k=-384 then t=t+330
 if k=-352 then t=t+270
 if k=-320 then t=t+210
 if k=-288 then t=t+170
 if k=-256 then t=t+130
 if k=-224 then t=t+110
 if k=-192 then t=t+90
 if k=-160 then t=t+70
 if k=-128 then t=t+60
 if k=-96 then t=t+50
 if k=-64 then t=t+40
 if k=-32 then t=t+35
 if k=0 then t=t+18
 if k=32 then t=t+15
 if k=64 then t=t+13
 if k=96 then t=t+11
 if k=128 then t=t+10
 if k=160 then t=t+8
 if k=192 then t=t+6
 return

Around Wikia's network

Random Wiki