Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Topic started by: ShittyWebsite on April 05, 2023, 03:28:16 AM

Title: Silent Pics Timelapse - (FRSP Day to night timelapse script)
Post by: ShittyWebsite on April 05, 2023, 03:28:16 AM
Auto ETTR does not change aperture, but this script will take your ISO and change the aperture accordingly (-1 EV for +1 EV) same with shutter speed, FRSP has a shutter speed limit, so, why not compensate with aperture?

Original Timelapse script:
https://gist.github.com/pigeonhill/c16b49d1f5da899b1d03a98c737e371f


Save as .lua:
Menu under Shoot>Timelapser
--[[
LE simulation via Bracketing, using shutterless, Full Res Silent Picture
Creates brackets for post processing a simulated LE exposure
User must set FRSP mode, ie DNG or MLV and also wheather to use Dual-ISO
Exposure Sim should be on
Should be in LV
Version 0.8: Requires the Lua Fix
*******************************************************************************************************
*   *
* If you reference this script, please consider acknowledging me: http://photography.grayheron.net/   *
*   *
*******************************************************************************************************
--]]

FRSP_brackets = 0

function my_shoot() -- to grab an image
camera.shoot(false)
end

function check_bookend() -- adds an over exposed FRSP frame
if LEmenu.submenu["Bookends?"].value == "yes"
then
local iso = camera.iso.apex
local av = camera.aperture.apex
camera.iso.apex = 10
camera.aperture.apex = camera.aperture.min.apex
my_shoot()
camera.iso.apex = iso
camera.aperture.apex = av
end
end

function go() -- and run the script
menu.close()
menu.set("Expo","Expo. Override",0)
menu.set("Expo","Auto ETTR",1)
menu.set("Auto ETTR","Trigger mode",0)
menu.set("Shoot","Silent Picture",1)
    local LE_count = 0
        msleep(LEmenu.submenu["Delay"].value * 1000)
check_bookend()
repeat
        LE_count = LE_count + 1
    my_shoot()

if (camera.shutter.apex > 5 ) then
camera.aperture.apex = 9
camera.shutter.apex = 5
end
msleep(10)
if (camera.shutter.apex < 1 ) and (camera.aperture.apex >= 5) then
camera.aperture.apex = camera.aperture.apex - 1
camera.shutter.apex = camera.shutter.apex + 1
end
msleep(10)
if (camera.iso.apex >= 6 ) and (camera.aperture.apex >= 5) then
camera.iso.apex = camera.iso.apex - 1
camera.aperture.apex = camera.aperture.apex - 1
end
if (camera.iso.apex >= 10 ) and (camera.aperture.apex <= 4) and (camera.shutter.apex <= -3) then
camera.shutter.apex = camera.shutter.apex -1
end
msleep(10)

msleep(LEmenu.submenu["Delay"].value * 1000)
until LE_count == FRSP_brackets or menu.visible == true
check_bookend()
menu.set("Shoot","Silent Picture",0)
menu.set("Expo","Auto ETTR",1)
menu.set("Auto ETTR","Trigger mode",2)
menu.set("Expo","Expo. Override",1)
lv.resume()
display.notify_box("Script Finished Running", 5000)
FRSP_brackets = 0
end


LEmenu = menu.new
{
    parent = "Shoot",
    name = "Timelapser",
    help = "Only uses FRSP",
-- depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
{
{
name = "Run Script",
help = "Does what it says after pressing SET",
-- depends_on = DEPENDS_ON.LIVEVIEW,
select = function(this) if FRSP_brackets ~= 0  then task.create(go) end
end,
},
{
name = "LE Time?",
help = "Simulated LE time in seconds",
min = 1,
max = 999,
icon_type = ICON_TYPE.BOOL,
select = function(this,delta)
this.value = this.value + delta
if this.value > this.max then
this.value = this.min
elseif this.value < this.min then
this.value = this.max
end
end,
warning = function(this)
if LEmenu.submenu["LE Time?"].value ~= 0 then
FRSP_brackets = math.ceil(LEmenu.submenu["LE Time?"].value/camera.shutter.value)
else
FRSP_brackets = 0
end
if FRSP_brackets == 0 then
return "LE bracket taking switched off"
else
return "Note: "..tostring(FRSP_brackets).." brackets will be taken"
end
end
               },
{
name = "Delay",
help = "Delays between pictures",
min = 1,
max = 30,
icon_type = ICON_TYPE.BOOL,
select = function(this,delta)
this.value = this.value + delta
if this.value > this.max then
this.value = this.min
elseif this.value < this.min then
this.value = this.max
end
end,
},{
name = "Bookends?",
help = "Places an overexposed frame at start and end of FRSP bracket set",
choices = {"no","yes"},
}
}
}



maybe you wanna tweak some lines? Here's some info:


camera.aperture.apex = 4 --F4
camera.aperture.apex = 5 --F5.6
camera.aperture.apex = 6 --F8
camera.aperture.apex = 7 --F11
camera.aperture.apex = 8 --F16
camera.aperture.apex = 9 --F22

camera.iso.apex = 5 --100
camera.iso.apex = 6 --200
camera.iso.apex = 7 --400
camera.iso.apex = 8 --800
camera.iso.apex = 9 --1600
camera.iso.apex = 10 --3200

camera.shutter.apex = 6 --1/60
camera.shutter.apex = 5 --1/30
camera.shutter.apex = 4 --1/15
camera.shutter.apex = 3 --1/8
camera.shutter.apex = 2 --1/4
camera.shutter.apex = 1 --0.5s
camera.shutter.apex = 0 --1s
camera.shutter.apex = -1 --2s
camera.shutter.apex = -2 --4s