Last active
February 7, 2021 14:46
-
-
Save pigeonhill/7b02d3dcadddbc703940778d74cd7af2 to your computer and use it in GitHub Desktop.
MUlti Shot Image Capture script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
MUSIC | |
(MUlti Shot Image Capture) | |
MUSIC helps you quickly create bracket sets for various use cases, eg: noise reduction (NR); super resolution (SR); | |
people removal; ND simulation; Hand-held (HH) bracketing; FRSP and Zero Noise bracketing. | |
MUSIC works by taking the requested number of images according to the needs of the use case. Simply toggle through the various use cases until you find the one that fits your needs. | |
SR and HH use cases assume you are handholding to create the bracket set. Most other use cases will normally be triggered from a tripod (but it's your choice). | |
In NR mode, eg addressing high ISO shooting, your (photon) signal to noise increase will simply be sq-root(n), where n is the number of images you take. | |
Note, that if using NR mode to recover high ISO images, 4 would be a minimum and a sensible maximum number of images would be 16, giving a SNR increase of 4. | |
In some use cases MUSIC can exploit Full Res Silent Picture capture but you do need to respect some limitations: | |
- AF must be switched off in FRSP mode | |
- Shutter speed should be limited to between 0.3s to 15s (ML, not Canon, values) | |
- There will be 'time gaps' between FRSP frames, so if you can't tolerate these, then don't use FRSP mode | |
You can request the script to create a dark, bookend, image. This is useful in post to differentiate your bracket set. In FRSP mode, if your shutter is less than a second, the | |
bookend may not stand out well (but it is there). | |
Music only works in LV other than for HH bracketing, where you can enable triggering via the normal shutter, ie outside of LV, looking through the VF. | |
HH shuttered trigger does not have a bookend option. | |
HH ISO invariance limit should be set for your camera (change in UC1). | |
Note you don't need an AF lens or for AF to be on: in fact for FRSP AF must be off. | |
MUSIC has a Quick Access mode that allows you to retrigger the current use case by doing a long press of your selected QA button and time (change in UC1) | |
Canon review should be set to OFF. Switch ExpSim and Expo Override on - MUSIC handles switching these off and on, if required. | |
The usual caveat applies: the script was written for my workflow and enjoyment, and 'only' tested on a 5D3 and an EoSM with ML build Lua Fix (2020-12-28 18:15) | |
Version 1.515 | |
Garry George Feb 2021 | |
******************************************************************************************************* | |
* * | |
* If you reference this script, please consider acknowledging me: http://photography.grayheron.net/ * | |
* * | |
******************************************************************************************************* | |
--]] | |
require("config") | |
infinity = 655000 -- trap ML reported infinity | |
m_text={} | |
m_text.a = {"no","yes"} | |
m_text.b = {"Move 2 Macro","Move 2 Inf","None"} | |
m_text.c = {"+/++","-/--","-/+"} | |
m_text.d = {"None","Super Res","Noise Red","Long Exp","People X","Hand Hold","FRSP Brak","Zero Noise","Shad-2-ETTR"} | |
m_text.e = {"1/15","1/30","1/60","1/125","1/250"} | |
m_text.f = {"800","1600","3200"} | |
m_text.g = {"1 sec","2 sec","3 sec","4 sec","5 sec"} | |
SET_time = 0 | |
use_button = false | |
notification_time = 3000 | |
add_images = false | |
--[[ | |
The QA triger button can me changed, but I recommend using SET, other than the EOSM, where I suggest you use 1 finger (long) TOUCH. | |
You can then assign ETTR to double HS press or SET as required | |
button_on = KEY.TOUCH_1_FINGER | |
button_off = KEY.UNTOUCH_1_FINGER | |
or | |
button_on = KEY.SET | |
button_off = KEY.UNPRESS_SET | |
or even try | |
button_on = KEY.HALFSHUTTER | |
button_off = KEY.UNPRESS_HALFSHUTTER | |
--]] | |
button_on = KEY.SET | |
button_off = KEY.UNPRESS_SET | |
quick_access = false | |
clock_running = false | |
HH_base = 1000/30 | |
first_time = true | |
use_case = 1 | |
t_base = camera.shutter.ms | |
FRSP_ev = 1 | |
function myround(num, dp) -- written this way to eliminate rounding errors with other approaches and because ML Lua doesn't have a string.format | |
if dp and dp>0 then | |
local adjusted = false | |
if num < 1 and num >= 0 then -- number positive and less than 1 | |
num = num + 1 -- needed to protect 0s extraction | |
adjusted = true | |
elseif num < 0 and num > -1 then -- number negative and less than 1 | |
num = num - 1 -- needed to protect 0s extraction | |
adjusted = true | |
end | |
local temp = math.floor(num) -- integer part | |
local temp2 = tostring(math.floor(num*10^dp)) -- shift dp and round | |
temp2 = temp2:sub(-dp) -- decimal part | |
if adjusted and num >= 0 then | |
temp = "0" | |
elseif adjusted and num < 0 then | |
temp ="-0" | |
end | |
return temp.."."..temp2 | |
end | |
return tostring(math.floor(num)) | |
end | |
function my_shoot() -- to grab an image | |
if (MUSIC_menu.submenu["Full Res Silent?"].value == "yes") and menu.get("Shoot","Silent Picture",0) == 1 then | |
key.press(KEY.HALFSHUTTER) | |
msleep(100) | |
key.press(KEY.UNPRESS_HALFSHUTTER) | |
repeat msleep(10) until lv.running | |
msleep(MUSIC_menu.submenu["FRSP delay"].value) | |
else | |
camera.shoot(false) | |
end | |
end | |
function tidy_up() | |
if MUSIC_menu.submenu["Full Res Silent?"].value == "yes" then menu.set("Shoot","Silent Picture",0) end | |
event.keypress = music_check_keys | |
event.shoot_task = check_stuff | |
event.seconds_clock = check_4_HH | |
end | |
function press_button() | |
event.keypress = nil -- switch off key event handler | |
use_button = false | |
key.press(button_on) | |
msleep(100) | |
key.press(button_off) | |
event.keypress = music_check_keys | |
end | |
function Bookends() | |
if MUSIC_menu.submenu["Bookends?"].value == "yes" then | |
camera.shutter.ms = 1 | |
my_shoot() | |
camera.shutter.ms = t_base | |
end | |
end | |
function HH_add() | |
event.keypress = nil -- switch off event handlers whilst capturing brackets | |
event.shoot_task = nil | |
event.seconds_clock = nil | |
if MUSIC_menu.submenu["Partial MLU?"].value == "yes" then -- use partial MLU | |
lv.start() | |
repeat msleep(10) until lv.running | |
end | |
t_base = camera.shutter.ms | |
camera.shutter.ms = 1000/string.sub(MUSIC_menu.submenu["HH Shutter"].value ,3) | |
local iso_temp = camera.iso.value | |
menu.set("Shoot","Silent Picture",0) | |
menu.set("Expo","Expo. Override",0) | |
camera.shoot(false) | |
camera.iso.value = tonumber(MUSIC_menu.submenu["ISOless trigger value?"].value) | |
camera.shoot(false) | |
camera.wait() | |
if MUSIC_menu.submenu["Partial MLU?"].value == "yes" then | |
lv.stop() | |
repeat msleep(10) until not lv.running | |
end | |
menu.set("Expo","Expo. Override",1) | |
camera.iso.value = iso_temp | |
camera.shutter.ms = t_base | |
tidy_up() | |
end | |
function go() -- and run the script | |
event.keypress = nil -- switch off event handlers whilst capturing brackets | |
event.shoot_task = nil | |
t_base = camera.shutter.ms | |
local t_base_ev = camera.shutter.apex | |
local num_i = MUSIC_menu.submenu["Number of images?"].value | |
menu.close() -- just in case | |
if lens.af and MUSIC_menu.submenu["Full Res Silent?"].value == "yes" then -- warn about AF | |
display.notify_box("FRSP: switch off AF", notification_time) | |
tidy_up() | |
return | |
end | |
if lv.enabled then -- alright to use script | |
if use_case == 6 then -- non-shutter triggered HH bracketing mode | |
local iso_temp = camera.iso.value | |
menu.set("Shoot","Silent Picture",0) | |
msleep(MUSIC_menu.submenu["Delay"].value * 1000) | |
menu.set("Expo","Expo. Override",0) | |
event.keypress = nil | |
event.shoot_task = nil | |
Bookends() | |
my_shoot() | |
camera.shutter.ms = HH_base | |
my_shoot() | |
camera.iso.value = tonumber(MUSIC_menu.submenu["ISOless trigger value?"].value) | |
my_shoot() | |
menu.set("Expo","Expo. Override",1) | |
camera.iso.value = iso_temp | |
camera.shutter.ms = t_base | |
Bookends() | |
tidy_up() | |
display.notify_box("Finished", notification_time) | |
return | |
end | |
if MUSIC_menu.submenu["Full Res Silent?"].value == "yes" then | |
menu.set("Shoot","Silent Picture",1) | |
menu.set("Silent Picture","Silent Mode","Full-res") | |
menu.set("Silent Picture","Trigger Mode","Half-shutter release") | |
menu.set("Silent Picture","File Format","DNG") | |
end | |
if use_case == 7 and camera.shutter.ms <= 15000 and camera.shutter.ms > 250 then -- FRSP bracketing mode | |
msleep(MUSIC_menu.submenu["Delay"].value * 1000) | |
Bookends() | |
camera.shutter.ms = 15000 | |
if MUSIC_menu.submenu["FRSP logic"].value == "-/--" then camera.shutter.apex = t_base_ev end | |
for i = 1, MUSIC_menu.submenu["# Images"].value do | |
my_shoot() | |
camera.shutter.apex = camera.shutter.apex + FRSP_ev | |
end | |
camera.shutter.apex = t_base_ev | |
Bookends() | |
tidy_up() | |
display.notify_box("Finished", notification_time) | |
return | |
elseif use_case == 7 then -- shouldn't be able to get here | |
tidy_up() | |
display.notify_box("Adjust Shutter", notification_time) | |
return | |
end | |
if use_case == 8 then -- Zero Noise bracket trap | |
msleep(MUSIC_menu.submenu["Delay"].value * 1000) | |
Bookends() | |
my_shoot() | |
camera.shutter.apex = t_base_ev - 4 | |
my_shoot() | |
camera.shutter.ms = t_base | |
Bookends() | |
tidy_up() | |
display.notify_box("Finished", notification_time) | |
return | |
end | |
if use_case == 9 then -- exposure bracket from shadows-set shutter to an AB 'ETTR' shutter | |
local check = 0 | |
if MUSIC_menu.submenu["Bookends?"].value == "yes" then | |
check = dryos.shooting_card.file_number | |
Bookends() -- insert bookend | |
repeat msleep(50) until dryos.shooting_card.file_number ~= check -- bookend captured, safe to start AB capture with correct shutter value | |
check = 0 | |
end | |
msleep(MUSIC_menu.submenu["Delay"].value * 1000) -- user delay if requested | |
menu.set("Shoot","Advanced Bracket",1) -- set up ML AB for a shadows to 'ETTR' AB capture | |
menu.set("Advanced Bracket","Bracket type","Exposure (Tv,Ae)") | |
menu.set("Advanced Bracket","Frames","Autodetect") | |
menu.set("Advanced Bracket","EV increment",tostring(MUSIC_menu.submenu["Ev delta"].value).." EV") | |
menu.set("Advanced Bracket","Sequence","0 - --") | |
my_shoot() -- trigger advanced/auto bracketing | |
while true do -- wait until auto bracketing is finished: a bit hackish but works and slows you down :-) | |
if camera.gui.play then | |
check = dryos.shooting_card.file_number | |
end | |
sleep(2) -- there is a very small probability this time may not work, but a low prob I think | |
if camera.gui.play then -- still in play mode, so check if AB is finished | |
if dryos.shooting_card.file_number == check then break end | |
else | |
check = 0 | |
end | |
end | |
menu.set("Shoot","Advanced Bracket",0) -- finished with AB | |
key.press(KEY.HALFSHUTTER) -- HS press to return to ML LV mode, ie from AB review screen, as AB finishes in review mode :-( | |
msleep(100) | |
key.press(KEY.UNPRESS_HALFSHUTTER) | |
repeat lv.resume() until lv.running -- just in case | |
Bookends() -- check if bookend needed | |
camera.shutter.ms = t_base | |
tidy_up() -- and exit use case 9 capture | |
return | |
end | |
msleep(MUSIC_menu.submenu["Delay"].value * 1000) | |
Bookends() | |
for i = 1, num_i do | |
my_shoot() | |
camera.wait() -- needed on slower cameras like the EOSM | |
if i < num_i then msleep(MUSIC_menu.submenu["I2I Delay"].value * 1000) end | |
end | |
Bookends() | |
tidy_up() | |
display.notify_box("Finished", notification_time) | |
return | |
else | |
tidy_up() | |
display.notify_box("Switch on LV", notification_time) | |
return | |
end | |
tidy_up() -- shouldn't get here | |
end | |
function check_stuff() | |
if use_button then press_button() return true end | |
if (MUSIC_menu.submenu["Quick Access"].value == "yes" and quick_access) then | |
quick_access = false | |
task.create(go) | |
end | |
if MUSIC_menu.submenu["Quick Access"].value == "no" or not lv.overlays ==2 or menu.visible then return true end | |
if clock_running and dryos.ms_clock - SET_time > 1000*string.sub(MUSIC_menu.submenu["QA long press value?"].value,1,1) then led_blink() end | |
return true | |
end | |
function music_check_keys(kk) | |
if kk == KEY.UNPRESS_FULLSHUTTER and use_case == 6 and MUSIC_menu.submenu["Shutter triggered?"].value == "yes" then add_images = true return true end | |
if MUSIC_menu.submenu["Quick Access"].value == "no" or not lv.overlays ==2 or menu.visible then return true end | |
if kk == button_on and MUSIC_menu.submenu["Quick Access"].value == "yes" and lv.overlays ==2 then | |
SET_time = dryos.ms_clock | |
quick_access = false | |
clock_running = true | |
use_button = false | |
return false -- steal button | |
elseif kk == button_off and MUSIC_menu.submenu["Quick Access"].value == "yes" and lv.overlays ==2 then | |
if dryos.ms_clock - SET_time > 1000*string.sub(MUSIC_menu.submenu["QA long press value?"].value,1,1) then | |
clock_running = false | |
use_button = false | |
quick_access = true -- run script | |
return false -- steal button | |
else | |
quick_access = false | |
clock_running = false | |
use_button = true -- trigger button press/unpress as normal | |
return false -- steal button | |
end | |
else | |
quick_access = false | |
clock_running = false | |
use_button = false | |
return true | |
end | |
end | |
function check_4_HH(arg) | |
if add_images then | |
add_images = false | |
task.create(HH_add) | |
end | |
return | |
end | |
MUSIC_menu = menu.new | |
{ | |
parent = "Shoot", | |
name = "MUSIC Script", | |
help = "Capture bracket sets for various use cases", | |
help2 = "Note: some use cases require LV, some don't", | |
submenu = | |
{ | |
{ | |
name = "Run Script", | |
help = "Does what it says after pressing SET", | |
hidden = true, | |
select = function(this) task.create(go) end, | |
}, | |
{ | |
name = "Use Case", | |
help = "Toggle and MUSIC menus will change accordingly to use case selected", | |
min = 1, | |
max = 9, | |
value = 1, | |
update = function(this) | |
if first_time then | |
this.value = 1 | |
use_case = this.value | |
first_time = false | |
MUSIC_menu.submenu["ISOless trigger value?"].hidden = true | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Change Settings?"].hidden = false | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = true | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = true | |
MUSIC_menu.submenu["Bookends?"].hidden = true | |
MUSIC_menu.submenu["Bookends?"].value = "no" | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = true | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["QA long press value?"].hidden = true | |
while MUSIC_menu.submenu["Quick Access"].value ~= "no" do MUSIC_menu.submenu["Quick Access"].value = "no" end | |
end | |
end, | |
select = function(this,del) | |
this.value = this.value + del | |
if this.value > this.max then this.value = this.min end | |
if this.value < this.min then this.value = this.max end | |
use_case = this.value | |
if this.value == 1 then | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = true | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = true | |
MUSIC_menu.submenu["Bookends?"].hidden = true | |
MUSIC_menu.submenu["Bookends?"].value = "no" | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = true | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = false | |
elseif this.value == 2 then -- SR | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = false | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 3 then -- NR | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = false | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 4 then -- LE | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = false | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 5 then -- PE | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = false | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = false | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 6 then -- HH | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "yes" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["HH Shutter"].hidden = false | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = false | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 7 then -- FRSP Brack | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = false | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = false | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "yes" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 8 then -- Zero Noise | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Ev delta"].hidden = true | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
elseif this.value == 9 then -- Shadow exposure to ETTR | |
MUSIC_menu.submenu["HH Shutter"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].hidden = true | |
MUSIC_menu.submenu["Shutter triggered?"].value = "no" | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["FRSP logic"].hidden = true | |
MUSIC_menu.submenu["I2I Delay"].hidden = true | |
MUSIC_menu.submenu["# Images"].hidden = true | |
MUSIC_menu.submenu["HH bracket set?"].hidden = true | |
MUSIC_menu.submenu["Number of images?"].hidden = true | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].value = "no" | |
MUSIC_menu.submenu["FRSP delay"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
MUSIC_menu.submenu["Full Res Silent?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Full Res Silent?"].value = "no" | |
MUSIC_menu.submenu["HH bracket set?"].value = "no" | |
MUSIC_menu.submenu["I2I Delay"].value = 0 | |
MUSIC_menu.submenu["Delay"].value = 0 | |
MUSIC_menu.submenu["Ev delta"].hidden = false | |
MUSIC_menu.submenu["Change Settings?"].hidden = true | |
end | |
end, | |
rinfo = function(this) | |
if use_case ~= 1 then | |
MUSIC_menu.submenu["ISOless trigger value?"].hidden = true | |
MUSIC_menu.submenu["QA long press value?"].hidden = true | |
MUSIC_menu.submenu["Partial MLU?"].hidden = true | |
elseif MUSIC_menu.submenu["Change Settings?"].value == "yes" and use_case == 1 then | |
MUSIC_menu.submenu["ISOless trigger value?"].hidden = false | |
MUSIC_menu.submenu["QA long press value?"].hidden = false | |
MUSIC_menu.submenu["Partial MLU?"].hidden = false | |
elseif MUSIC_menu.submenu["Change Settings?"].value == "no" and use_case == 1 then | |
MUSIC_menu.submenu["ISOless trigger value?"].hidden = true | |
MUSIC_menu.submenu["QA long press value?"].hidden = true | |
MUSIC_menu.submenu["Partial MLU?"].hidden = true | |
end | |
return m_text.d[this.value] | |
end, | |
warning = function(this) | |
if use_case == 1 then | |
return "Remember: MUSIC needs LV, other than for use case 6" | |
elseif use_case == 6 then | |
if MUSIC_menu.submenu["Shutter triggered?"].value == "yes" then | |
MUSIC_menu.submenu["Delay"].hidden = true | |
MUSIC_menu.submenu["Bookends?"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
MUSIC_menu.submenu["Run Script"].hidden = true | |
MUSIC_menu.submenu["Delay"].value = 0 | |
elseif MUSIC_menu.submenu["Shutter triggered?"].value == "no" then | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["Delay"].hidden = false | |
MUSIC_menu.submenu["Bookends?"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
end | |
elseif MUSIC_menu.submenu["Full Res Silent?"].value == "yes" then | |
if MUSIC_menu.submenu["Full Res Silent?"].value == "yes" and lens.af then | |
return "Switch off AF" | |
elseif camera.shutter.ms > 15000 or camera.shutter.ms < 250 then | |
MUSIC_menu.submenu["Run Script"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
return "Check Shutter" | |
else | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
return | |
end | |
elseif MUSIC_menu.submenu["Full Res Silent?"].value == "no" and use_case ~= 1 then | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
end | |
end, | |
}, | |
{ | |
name = "Number of images?", | |
help = "", | |
min = 1, | |
max = 100, | |
unit = UNIT.DEC, | |
value = 4, | |
help = "", | |
rinfo = function(this) | |
if MUSIC_menu.submenu["Use Case"].value == 4 then | |
this.help = "Simulated LE time in seconds" | |
return myround(this.value*camera.shutter.ms/1000,1).."s" | |
elseif MUSIC_menu.submenu["Use Case"].value == 3 then | |
this.help = "Estimated (photon) signal to noise increase" | |
return myround(math.sqrt(this.value),1) | |
else | |
this.help = "" | |
return "" | |
end | |
end, | |
}, | |
{ | |
name = "Delay", | |
help = "Delay script start by stated number of secs", | |
min = 0, | |
max = 10, | |
value = 0, | |
}, | |
{ | |
name = "I2I Delay", | |
help = "Delay bewtween images in secs", | |
help2 = "This delay is on top of any Canon/ML delays, eg FRSP delays", | |
min = 0, | |
max = 60, | |
unit = UNIT.DEC, | |
value = 0, | |
}, | |
{ | |
name = "Bookends?", | |
help = "Places an underexposed frame at start and end of bracket set", | |
choices = m_text.a, | |
}, | |
{ | |
name = "Full Res Silent?", | |
help = "Make sure shutter is between about 0.3-15s and AF is off", | |
choices = m_text.a, | |
rinfo = function(this) | |
if camera.shutter.ms < 250 or camera.shutter.ms > 15000 then | |
return "Shutter?" | |
else | |
return "" | |
end | |
end, | |
warning = function(this) | |
if MUSIC_menu.submenu["Full Res Silent?"].value == "yes" and use_case ~= 1 then | |
if MUSIC_menu.submenu["Full Res Silent?"].value == "yes" and lens.af then | |
return "Switch off AF" | |
elseif camera.shutter.ms > 15000 or camera.shutter.ms < 250 then | |
MUSIC_menu.submenu["Run Script"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].hidden = true | |
MUSIC_menu.submenu["Quick Access"].value = "no" | |
return "Check Shutter" | |
else | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
return | |
end | |
elseif MUSIC_menu.submenu["Full Res Silent?"].value == "no" and use_case ~= 1 then | |
MUSIC_menu.submenu["Run Script"].hidden = false | |
MUSIC_menu.submenu["Quick Access"].hidden = false | |
end | |
end, | |
}, | |
{ | |
name = "# Images", | |
help = "Number of images and delta Ev to end of FRSP bracket set", | |
min = 2, | |
max = 9, | |
unit = UNIT.DEC, | |
value = 2, | |
rinfo = function(this) | |
if camera.shutter.ms < 250 or camera.shutter.ms > 15000 then | |
this.help2 = "Adjust shutter to be between 0.25 and 15 sec (ML not Canon)" | |
return "Shutter?" | |
end | |
if MUSIC_menu.submenu["FRSP logic"].value == "+/++" then | |
FRSP_ev = math.abs((math.log(camera.shutter.ms/1000)-math.log(15))/math.log(2))/(this.value-1) | |
elseif MUSIC_menu.submenu["FRSP logic"].value == "-/--" then | |
FRSP_ev = math.abs((math.log(camera.shutter.ms/1000)-math.log(0.25))/math.log(2))/(this.value-1) | |
else | |
FRSP_ev = math.abs((math.log(0.25)-math.log(15))/math.log(2))/(this.value-1) | |
end | |
this.help2 = "Current shutter = "..myround(camera.shutter.ms/1000,2).."sec. Total Ev gain ="..myround((this.value-1)*FRSP_ev,1).."Ev" | |
return myround(FRSP_ev,1).."Ev" | |
end, | |
}, | |
{ | |
name = "HH bracket set?", | |
help = "Will use time and ISO bracketing to cover maximise the exposure cover", | |
help2 = "Assumes ISO invariance starts at 1600. Change in script to suit your camera", | |
choices = m_text.a, | |
}, | |
{ | |
name = "FRSP delay", | |
min = 0, | |
max = 5000, | |
unit = UNIT.DEC, | |
value = 1000, | |
help = "In msecs: Needs to be experimentally derived", | |
}, | |
{ | |
name = "Quick Access", | |
help = "Use a long SET press to run MUSIC", | |
choices = m_text.a, | |
help2 = "Long press of >3s. MUSIC will blink to tell you it's ready", | |
}, | |
{ | |
name = "FRSP logic", | |
help = "+/++ shadow 2 max; -/-- ETTR 2 min; -/+ min 2 max", | |
choices = m_text.c, | |
}, | |
{ | |
name = "Ev delta", | |
min = 1, | |
max = 4, | |
unit = UNIT.DEC, | |
value = 1, | |
help = "Ev step value, ie between images", | |
}, | |
{ | |
name = "HH Shutter", | |
help = "Set this to be your slowest acceptable HH shutter limit", | |
choices = m_text.e, | |
warning = function(this) | |
if camera.shutter.ms > 1000/string.sub(this.value,3) then return "Check Shutter" else return "" end | |
end, | |
}, | |
{ | |
name = "Shutter triggered?", | |
help = "Will take an HH bracket set triggered by a normal shutter press", | |
help2 = "Ensure base shutter is set correctly for hand holding", | |
choices = m_text.a, | |
}, | |
{ | |
name = "Change Settings?", | |
help = "Change camera specific values here", | |
choices = m_text.a, | |
}, | |
{ | |
name = "ISOless trigger value?", | |
help = "Options are: 800, 1600 or 3200", | |
choices = m_text.f, | |
}, | |
{ | |
name = "QA long press value?", | |
help = "Options are: 1, 2, 3, 4 or 5 sec", | |
choices = m_text.g, | |
}, | |
{ | |
name = "Partial MLU?", | |
help = "Used in HH shutter triggered mode", | |
help2 = "After a normal shutter capture, LV is used", | |
choices = m_text.a, | |
}, | |
} | |
} | |
event.shoot_task = check_stuff | |
event.keypress = music_check_keys | |
event.seconds_clock = check_4_HH | |
config.create_from_menu(MUSIC_menu) -- keep a track of the script's menu state at camera close | |
menu.set("Shoot","Advanced Bracket",0) | |
menu.set("Expo","Dual ISO",0) | |
menu.set("Shoot","Silent Picture",0) | |
MUSIC_menu.submenu["Change Settings?"].value = "no" | |
while MUSIC_menu.submenu["Change Settings?"].value ~= "no" do MUSIC_menu.submenu["Change Settings?"].value = "no" end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment