experimental Tv mode for A450/experimental override shutter speed with metering - Script Writing - CHDK Forum supplierdeeply

experimental Tv mode for A450/experimental override shutter speed with metering

  • 8 Replies
  • 8020 Views
Advertisements
Version 0.3 For A450->http://chdk.setepontos.com/index.php/topic,1051.msg9595.html#msg9595

This is my very first script in CHDK.

I'm trying to make a script for A450 to have the Tv mode (A450 is a low end powershot. It have auto mode only :lol)

Also I'm trying to add the metering features for the override shutter speed.

I guest it should be work with another model of Powershot which using AllBest Build

Please feel free to discuss and debug it :P

Known Issue: When using the high shutter speed (should be 1/1000s in A450) this script maybe malfunctions!

(It is using the shutter_speeds_table to set the shutter)

Code: [Select]
    { -12, -384, "15", 15000000 },
    { -11, -352, "13", 13000000 },
    { -10, -320, "10", 10000000 },
    {  -9, -288, "8",   8000000 },
    {  -8, -256, "6",   6000000 },
    {  -7, -224, "5",   5000000 },
    {  -6, -192, "4",   4000000 },
    {  -5, -160, "3.2", 3200000 },
    {  -4, -128, "2.5", 2500000 },
    {  -3,  -96, "2",   2000000 },
    {  -2,  -64, "1.6", 1600000 },
    {  -1,  -32, "1.3", 1300000 },
    {   0,    0, "1",   1000000 },
    {   1,   32, "0.8",  800000 },
    {   2,   64, "0.6",  600000 },
    {   3,   96, "0.5",  500000 },
    {   4,  128, "0.4",  400000 },
    {   5,  160, "0.3",  300000 },
    {   6,  192, "1/4",  250000 },
    {   7,  224, "1/5",  200000 },
    {   8,  256, "1/6",  166667 },
    {   9,  288, "1/8",  125000 },
    {  10,  320, "1/10", 100000 },
    {  11,  352, "1/13",  76923 },
    {  12,  384, "1/15",  66667 },
    {  13,  416, "1/20",  50000 },
    {  14,  448, "1/25",  40000 },
    {  15,  480, "1/30",  33333 },
    {  16,  512, "1/40",  25000 },
    {  17,  544, "1/50",  20000 },
    {  18,  576, "1/60",  16667 },
    {  19,  608, "1/80",  12500 },
    {  20,  640, "1/100", 10000 },
    {  21,  672, "1/125",  8000 },
    {  22,  704, "1/160",  6250 },
    {  23,  736, "1/200",  5000 },
    {  24,  768, "1/250",  4000 },
    {  25,  800, "1/320",  3125 },
    {  26,  832, "1/400",  2500 },
    {  27,  864, "1/500",  2000 },
    {  28,  896, "1/640",  1563 },
    {  29,  928, "1/800",  1250 },
    {  30,  960, "1/1000", 1000 },
    {  31,  992, "1/1250",  800 },
    {  32, 1021, "1/1600",  625 },
    {  33, 1053, "1/2000",  500 },
    {  34, 1084, "1/2500",  400 },

here is my script coding

Code: [Select]
rem use A450 simulate Tv Mode
rem By MP9SIT at 20080412
@title Tv Mode
@param a Tv
@default a 0

t=a

if t=-12 then s=-384 endif
if t=-11 then s=-352 endif
if t=-10 then s=-320 endif
if t=-9 then s=-288 endif
if t=-8 then s=-256 endif
if t=-7 then s=-224 endif
if t=-6 then s=-192 endif
if t=-5 then s=-160 endif
if t=-4 then s=-128 endif
if t=-3 then s=-96 endif
if t=-2 then s=-64 endif
if t=-1 then s=-32 endif
if t=0 then s=0 endif
if t=1 then s=32 endif
if t=2 then s=64 endif
if t=3 then s=96 endif
if t=4 then s=128 endif
if t=5 then s=160 endif
if t=6 then s=192 endif
if t=7 then s=224 endif
if t=8 then s=256 endif
if t=9 then s=288 endif
if t=10 then s=320 endif
if t=11 then s=352 endif
if t=12 then s=384 endif
if t=13 then s=416 endif
if t=14 then s=448 endif
if t=15 then s=480 endif
if t=16 then s=512 endif
if t=17 then s=544 endif
if t=18 then s=576 endif
if t=19 then s=608 endif
if t=20 then s=640 endif
if t=21 then s=672 endif
if t=22 then s=704 endif
if t=23 then s=736 endif
if t=24 then s=768 endif
if t=25 then s=800 endif
if t=26 then s=832 endif
if t=27 then s=864 endif
if t=28 then s=896 endif
if t=29 then s=928 endif
if t=30 then s=960 endif
if t=31 then s=992 endif
if t=32 then s=1021 endif
if t=33 then s=1053 endif
if t=33 then s=1084 endif

press "shoot_half"
sleep 1000
get_av96 h
print "Av96:", h
get_bv96 i
print "Bv96:", i
release "shoot_half"
z=h+s-i
set_sv96 z
set_tv96 s
press "shoot_half"
sleep 1500
print "SET_Sv96:", z
sleep 500
press "shoot_full"
release "shoot_full"
release "shoot_half"
end
« Last Edit: 16 / April / 2008, 00:43:41 by mp9_sit »

Deleted
« Last Edit: 22 / April / 2008, 17:38:58 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

An excellent idea -- if it works, I don't have that camera to test it. This falls right in line with the whole concept behind CHDK, give your camera features that were left out or ones you always wished it had. (Because cameras right from the camera company are designed by idiot bean-counters who have never even touched a camera let alone used one, instead of designed by photographers these days. Not unlike how greed-driven insurance executives are acting as surgeons and doctors and defining what health-care you require.)

Nice job.


Thanks Barney Fife,

I've checked the S3IS's source code(shooting.c). S3IS is using the similar shutter_speeds_table(as my review most of the camera using the same table, just some high-end powershot have faster shutter speed.) and my script is only using a similar formula (Ev=Av+Tv=Bv+Sv). So I guess this script is work for other model's powershot.

So, You can have a try in S3IS too, but it will be just a duplicated function for it  :lol

Here is the version 0.2 of the script
the new version ONLY Support A450 and Possible Some DIGIC III PowerShot

Due to the A450 Limit I've used the propertycase #246 for the Sv Settings and #262 for the Tv Settings.
If someone want to Implement this script to DIGIC II Powershot.
You can try Change the
Quote
set_prop 262 s
set_prop 247 z
To
Quote
set_sv96 s
set_tv96 z

Or change the correct propertycase number refer to the Digic II

Version Histroy

0.1 ---- initial Build
0.2 ---- I. Extended Shutter Speed supported (64s~16s & 1/2000s~1/100000s)
           II. Added The Highest ISO Limit to ISO 800 (Real ISO)
           III. Added The Notice Light(The ALT Button Light) (It will be Light up when needed ISO is higher than 800)
                 (When The Notice Light is ON mean your Photo maybe underexpose)

Tv Settings Refer to the shutter speed
Code: [Select]
Value Second
-19 64
-18 50.8
-17 40.3
-16 32
-15 25.4
-14 20
-13 16
-12 15
-11 13
-10 10
-9 8
-8 6
-7 5
-6 4
-5 3.2
-4 2.5
-3 2
-2 1.6
-1 1.3
 0 1
 1 0.8
 2 0.6
 3 0.5
 4 0.4
 5 0.3
 6 1/4
 7 1/5
 8 1/6
 9 1/8
10 1/10
11 1/13
12 1/15
13 1/20
14 1/25
15 1/30
16 1/40
17 1/50
18 1/60
19 1/80
20 1/100
21 1/125
22 1/160
23 1/200
24 1/250
25 1/320
26 1/400
27 1/500
28 1/640
29 1/800
30 1/1000
31 1/1250
32 1/1600
33 1/2000
34 1/2500
35 1/3200
36 1/4000
37 1/5000
38 1/6400
39 1/8000
40 1/10000
41 1/12500
42 1/16000
43 1/20000
44 1/25000
45 1/32000
46 1/40000
47 1/50000
48 1/64000
49 1/80000
50 1/100000

Here is the Script Codes

Code: [Select]
rem use A450 simulate Tv Mode
rem By MP9SIT at 20080412
@title Tv Mode
@param a Tv
@default a 0

t=a
if t=-19 then s=-576 endif
if t=-18 then s=-544 endif
if t=-17 then s=-512 endif
if t=-16 then s=-480 endif
if t=-15 then s=-448 endif
if t=-14 then s=-416 endif
if t=-13 then s=-384 endif
if t=-12 then s=-384 endif
if t=-11 then s=-352 endif
if t=-10 then s=-320 endif
if t=-9 then s=-288 endif
if t=-8 then s=-256 endif
if t=-7 then s=-224 endif
if t=-6 then s=-192 endif
if t=-5 then s=-160 endif
if t=-4 then s=-128 endif
if t=-3 then s=-96 endif
if t=-2 then s=-64 endif
if t=-1 then s=-32 endif
if t=0 then s=0 endif
if t=1 then s=32 endif
if t=2 then s=64 endif
if t=3 then s=96 endif
if t=4 then s=128 endif
if t=5 then s=160 endif
if t=6 then s=192 endif
if t=7 then s=224 endif
if t=8 then s=256 endif
if t=9 then s=288 endif
if t=10 then s=320 endif
if t=11 then s=352 endif
if t=12 then s=384 endif
if t=13 then s=416 endif
if t=14 then s=448 endif
if t=15 then s=480 endif
if t=16 then s=512 endif
if t=17 then s=544 endif
if t=18 then s=576 endif
if t=19 then s=608 endif
if t=20 then s=640 endif
if t=21 then s=672 endif
if t=22 then s=704 endif
if t=23 then s=736 endif
if t=24 then s=768 endif
if t=25 then s=800 endif
if t=26 then s=832 endif
if t=27 then s=864 endif
if t=28 then s=896 endif
if t=29 then s=928 endif
if t=30 then s=960 endif
if t=31 then s=992 endif
if t=32 then s=1021 endif
if t=33 then s=1053 endif
if t=34 then s=1088 endif
if t=35 then s=1120 endif
if t=36 then s=1152 endif
if t=37 then s=1184 endif
if t=38 then s=1216 endif
if t=39 then s=1248 endif
if t=40 then s=1280 endif
if t=41 then s=1312 endif
if t=42 then s=1344 endif
if t=43 then s=1376 endif
if t=44 then s=1408 endif
if t=45 then s=1440 endif
if t=46 then s=1472 endif
if t=47 then s=1504 endif
if t=48 then s=1536 endif
if t=49 then s=1568 endif
if t=50 then s=1600 endif

print s
press "shoot_half"
sleep 1000
get_av96 h
print "Av96:", h
get_bv96 i
print "Bv96:", i
release "shoot_half"
z=h+s-i
print "SET_Sv96:", z
if z>759 then
z=759
set_led 8 1
endif
press "shoot_half"
sleep 1500
set_prop 262 s
set_prop 247 z
print "SET_Sv96:", z
print "SET_Tv96:", s
press "shoot_full"
release "shoot_full"
set_led 8 0
release "shoot_half"
end
« Last Edit: 16 / April / 2008, 00:42:28 by mp9_sit »


Here is the version 0.3 of the script
the new version ONLY Support A450 and Possible Some DIGIC III PowerShot

Due to the A450 Limit I've used the propertycase #246 for the Sv Settings and #262 for the Tv Settings.
If someone want to Implement this script to DIGIC II Powershot.
You can try Change the
Quote
set_prop 262 s
set_prop 247 z
get_prop 107 e

to the correct propertycase number refer to the Digic II

Version Histroy

0.1 ---- initial Build
0.2 ---- I. Extended Shutter Speed supported (64s~16s & 1/2000s~1/100000s)
           II. Added The Highest ISO Limit to ISO 800 (Real ISO)
           III. Added The Notice Light(The ALT Buttone Light) (It will be Light up when needed ISO is higher than 800)
0.3 ----  I. Added a menu
           II. Added +/-2EV Support (Base On original Canon's Setup)

Tv Settings Refer to the shutter speed
Code: [Select]
Value Second
-19 64
-18 50.8
-17 40.3
-16 32
-15 25.4
-14 20
-13 16
-12 15
-11 13
-10 10
-9 8
-8 6
-7 5
-6 4
-5 3.2
-4 2.5
-3 2
-2 1.6
-1 1.3
 0 1
 1 0.8
 2 0.6
 3 0.5
 4 0.4
 5 0.3
 6 1/4
 7 1/5
 8 1/6
 9 1/8
10 1/10
11 1/13
12 1/15
13 1/20
14 1/25
15 1/30
16 1/40
17 1/50
18 1/60
19 1/80
20 1/100
21 1/125
22 1/160
23 1/200
24 1/250
25 1/320
26 1/400
27 1/500
28 1/640
29 1/800
30 1/1000
31 1/1250
32 1/1600
33 1/2000
34 1/2500
35 1/3200
36 1/4000
37 1/5000
38 1/6400
39 1/8000
40 1/10000
41 1/12500
42 1/16000
43 1/20000
44 1/25000
45 1/32000
46 1/40000
47 1/50000
48 1/64000
49 1/80000
50 1/100000


Code: [Select]
rem use A450 simulate Tv Mode
rem By MP9SIT at 20080415
@title Tv Mode
@param a Tv
@default a 0

t=a
if t=-19 then s=-576 endif
if t=-18 then s=-544 endif
if t=-17 then s=-512 endif
if t=-16 then s=-480 endif
if t=-15 then s=-448 endif
if t=-14 then s=-416 endif
if t=-13 then s=-384 endif
if t=-12 then s=-384 endif
if t=-11 then s=-352 endif
if t=-10 then s=-320 endif
if t=-9 then s=-288 endif
if t=-8 then s=-256 endif
if t=-7 then s=-224 endif
if t=-6 then s=-192 endif
if t=-5 then s=-160 endif
if t=-4 then s=-128 endif
if t=-3 then s=-96 endif
if t=-2 then s=-64 endif
if t=-1 then s=-32 endif
if t=0 then s=0 endif
if t=1 then s=32 endif
if t=2 then s=64 endif
if t=3 then s=96 endif
if t=4 then s=128 endif
if t=5 then s=160 endif
if t=6 then s=192 endif
if t=7 then s=224 endif
if t=8 then s=256 endif
if t=9 then s=288 endif
if t=10 then s=320 endif
if t=11 then s=352 endif
if t=12 then s=384 endif
if t=13 then s=416 endif
if t=14 then s=448 endif
if t=15 then s=480 endif
if t=16 then s=512 endif
if t=17 then s=544 endif
if t=18 then s=576 endif
if t=19 then s=608 endif
if t=20 then s=640 endif
if t=21 then s=672 endif
if t=22 then s=704 endif
if t=23 then s=736 endif
if t=24 then s=768 endif
if t=25 then s=800 endif
if t=26 then s=832 endif
if t=27 then s=864 endif
if t=28 then s=896 endif
if t=29 then s=928 endif
if t=30 then s=960 endif
if t=31 then s=992 endif
if t=32 then s=1021 endif
if t=33 then s=1053 endif
if t=34 then s=1088 endif
if t=35 then s=1120 endif
if t=36 then s=1152 endif
if t=37 then s=1184 endif
if t=38 then s=1216 endif
if t=39 then s=1248 endif
if t=40 then s=1280 endif
if t=41 then s=1312 endif
if t=42 then s=1344 endif
if t=43 then s=1376 endif
if t=44 then s=1408 endif
if t=45 then s=1440 endif
if t=46 then s=1472 endif
if t=47 then s=1504 endif
if t=48 then s=1536 endif
if t=49 then s=1568 endif
if t=50 then s=1600 endif

  print "Menu for Focus"
  print "Display for Shoot"
  print "left for Macro"
do
  wait_click
  if is_key "menu" then gosub "half"
  if is_key "display" then gosub "full"
  if is_key "left" then gosub "macro"

until is_key "set"

goto "the_end"

:macro
set_prop 6 m
if m=0 then
  m=1
  print "Macro Mode"
else
  m=0
  print "Normal Mode"
endif
set_prop 6 m
return

:half
press "shoot_half"
sleep 1500
release "shoot_half"
return

:full
press "shoot_half"
sleep 500
get_av96 h
get_bv96 i
release "shoot_half"
get_prop 107 e
if e>65000 then
e=65536-e
endif
z=h+s-i-e
if z>759 then
z=759
set_led 8 1
endif
press "shoot_half"
sleep 1500
set_prop 262 s
set_prop 247 z
press "shoot_full"
release "shoot_full"
set_led 8 0
release "shoot_half"
return

:the_end
end

Deleted
« Last Edit: 22 / April / 2008, 17:39:29 by Barney Fife »
[acseven/admin commented out: please refrain from more direct offensive language to any user. FW complaints to me] I felt it imperative to withdraw my TOTAL participation. Nobody has my permission, nor the right, to reinstate MY posts. Make-do with my quoted text in others' replies only. Bye

Now I get the point to your previous script...

I was wondering why I need to use your script in AUTO mode, when I have Tv and Av for the same result :)

Ideally, this should have been posted in the main Script Writing forum, and the final version moved here to "Completed and Working Scripts" when you get the main bugs worked out.

I'll move this there after you read this, just to let you know what's going on.

Then once you have your final final version, please do copy just that post to the "completed and working" section.

Eventually some motivated Wikia editor in the future will be able to go through just the "Complete and Working Scripts" to copy them over to the Wikia archive. Without having to wade through tomes of experiments. (The purpose of doing it this way.)



Barney Fife Please move my message. In fact, i found I'm in the wrong zone. i just think this is the zone for "Completed and Working "ON" Scripts". seems this is my fault to mis-understand the zone :D

Please Kindly move my both script to main Script Writing forum


Now I get the point to your previous script...

I was wondering why I need to use your script in AUTO mode, when I have Tv and Av for the same result :)

Mainly -> Because the A450 only got Auto Mode :D

and the Tv mode metering is not supported the "extended range" shutter speed :D
« Last Edit: 16 / April / 2008, 00:40:49 by mp9_sit »

 

Related Topics